Skip to content

Commit 441816c

Browse files
author
“Akshay
committed
Making the branch release ready
Gradle changes are becoming importantly necessary. Sooner we merge the ongoing upgrade branch in master, we dont have to deal with workarounds like this commit
1 parent 3b87dec commit 441816c

File tree

12 files changed

+66
-6
lines changed

12 files changed

+66
-6
lines changed

app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ android {
1717
defaultConfig {
1818
applicationId "com.iterable.iterableapi.testapp"
1919
minSdkVersion 16
20-
targetSdkVersion 27
20+
targetSdkVersion 31
2121
versionCode 1
2222
versionName "1.0"
2323
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

app/src/main/AndroidManifest.xml

+11-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
android:theme="@style/AppTheme">
1313
<activity
1414
android:name="com.iterable.androidsdk.AnonTrackingTestActivity"
15-
android:exported="false" />
15+
android:exported="true" />
1616
<activity
1717
android:name="com.iterable.androidsdk.MainActivity"
18+
android:exported="true"
1819
android:label="@string/app_name"
1920
android:theme="@style/AppTheme.NoActionBar">
2021
<intent-filter>
@@ -23,6 +24,15 @@
2324
<category android:name="android.intent.category.LAUNCHER" />
2425
</intent-filter>
2526
</activity>
27+
<activity
28+
android:name="androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity"
29+
android:exported="true" />
30+
<activity
31+
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity"
32+
android:exported="true" />
33+
<activity
34+
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity"
35+
android:exported="true" />
2636
</application>
2737

2838
</manifest>

app/src/main/java/com/iterable/androidsdk/AnonTrackingTestActivity.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ public String onAuthTokenRequested() {
177177
} else {
178178
userEmail = null;
179179
}
180-
final Duration days7 = Duration.ofDays(7);
180+
Duration days7 = null;
181+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
182+
days7 = Duration.ofDays(7);
183+
}
181184
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
182185
jwtToken = IterableJwtGenerator.generateToken(secret, days7, userEmail, userId);
183186
}

iterableapi-ui/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ android {
88

99
defaultConfig {
1010
minSdkVersion 16
11-
targetSdkVersion 28
11+
targetSdkVersion 31
1212
vectorDrawables.useSupportLibrary = true
1313
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1414
}

iterableapi-ui/src/main/res/layout-v21/banner_view.xml

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
android:layout_gravity="center_vertical"
88
android:layout_marginTop="8dp"
99
android:layout_marginStart="16dp"
10+
android:layout_marginLeft="16dp"
1011
android:layout_marginBottom="12dp"
1112
app:cardCornerRadius="8dp"
1213
app:cardElevation="0dp"
@@ -18,6 +19,7 @@
1819
android:layout_width="240dp"
1920
android:layout_height="wrap_content"
2021
android:layout_marginStart="16dp"
22+
android:layout_marginLeft="16dp"
2123
android:layout_marginTop="16dp"
2224
android:ellipsize="end"
2325
android:maxLines="2"
@@ -34,6 +36,7 @@
3436
android:layout_width="240dp"
3537
android:layout_height="wrap_content"
3638
android:layout_marginStart="16dp"
39+
android:layout_marginLeft="16dp"
3740
android:layout_marginTop="8dp"
3841
android:ellipsize="end"
3942
android:maxLines="2"
@@ -73,7 +76,9 @@
7376
android:background="@drawable/primary_banner_button_background"
7477
android:ellipsize="end"
7578
android:layout_marginStart="16dp"
79+
android:layout_marginLeft="16dp"
7680
android:layout_marginEnd="8dp"
81+
android:layout_marginRight="8dp"
7782
android:paddingTop="8dp"
7883
android:paddingBottom="8dp"
7984
android:paddingStart="12dp"

iterableapi-ui/src/main/res/layout-v21/card_view.xml

+6
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939
android:layout_width="match_parent"
4040
android:layout_height="wrap_content"
4141
android:layout_marginStart="16dp"
42+
android:layout_marginLeft="16dp"
4243
android:layout_marginEnd="16dp"
44+
android:layout_marginRight="16dp"
4345
android:layout_marginTop="16dp"
4446
android:ellipsize="end"
4547
android:maxLines="2"
@@ -55,7 +57,9 @@
5557
android:layout_width="match_parent"
5658
android:layout_height="wrap_content"
5759
android:layout_marginStart="16dp"
60+
android:layout_marginLeft="16dp"
5861
android:layout_marginEnd="16dp"
62+
android:layout_marginRight="16dp"
5963
android:layout_marginTop="8dp"
6064
android:ellipsize="end"
6165
android:maxLines="2"
@@ -84,7 +88,9 @@
8488
android:background="@drawable/primary_card_button_background"
8589
android:ellipsize="end"
8690
android:layout_marginStart="16dp"
91+
android:layout_marginLeft="16dp"
8792
android:layout_marginEnd="8dp"
93+
android:layout_marginRight="16dp"
8894
android:paddingTop="8dp"
8995
android:paddingBottom="8dp"
9096
android:paddingStart="12dp"

iterableapi-ui/src/main/res/layout/banner_view.xml

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
android:layout_gravity="center_vertical"
88
android:layout_marginTop="8dp"
99
android:layout_marginStart="16dp"
10+
android:layout_marginLeft="16dp"
1011
android:layout_marginBottom="12dp"
1112
app:cardCornerRadius="8dp"
1213
app:cardElevation="0dp"
@@ -18,6 +19,7 @@
1819
android:layout_width="240dp"
1920
android:layout_height="wrap_content"
2021
android:layout_marginStart="16dp"
22+
android:layout_marginLeft="16dp"
2123
android:layout_marginTop="16dp"
2224
android:ellipsize="end"
2325
android:maxLines="2"
@@ -33,6 +35,7 @@
3335
android:id="@+id/embedded_message_body"
3436
android:layout_width="240dp"
3537
android:layout_height="wrap_content"
38+
android:layout_marginLeft="16dp"
3639
android:layout_marginStart="16dp"
3740
android:layout_marginTop="8dp"
3841
android:ellipsize="end"
@@ -51,6 +54,7 @@
5154
android:layout_height="80dp"
5255
android:layout_marginTop="16dp"
5356
android:layout_marginEnd="16dp"
57+
android:layout_marginRight="16dp"
5458
android:contentDescription=""
5559
app:layout_constraintEnd_toEndOf="parent"
5660
app:layout_constraintTop_toTopOf="parent" />
@@ -72,6 +76,7 @@
7276
android:background="@drawable/primary_banner_button_background"
7377
android:ellipsize="end"
7478
android:layout_marginStart="16dp"
79+
android:layout_marginLeft="16dp"
7580
android:paddingTop="8dp"
7681
android:paddingBottom="8dp"
7782
android:paddingStart="12dp"
@@ -88,6 +93,7 @@
8893
android:layout_width="wrap_content"
8994
android:layout_height="36dp"
9095
android:layout_marginEnd="16dp"
96+
android:layout_marginRight="16dp"
9197
android:background="@drawable/secondary_banner_button_background"
9298
android:ellipsize="end"
9399
android:paddingTop="8dp"

iterableapi-ui/src/main/res/layout/card_view.xml

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<androidx.constraintlayout.widget.ConstraintLayout
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
xmlns:app="http://schemas.android.com/apk/res-auto"
5+
xmlns:tools="http://schemas.android.com/tools"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
78
android:layout_gravity="center_vertical"
@@ -39,6 +40,8 @@
3940
android:layout_width="match_parent"
4041
android:layout_height="wrap_content"
4142
android:layout_marginStart="16dp"
43+
android:layout_marginLeft="16dp"
44+
android:layout_marginRight="16dp"
4245
android:layout_marginEnd="16dp"
4346
android:layout_marginTop="16dp"
4447
android:ellipsize="end"
@@ -55,6 +58,8 @@
5558
android:layout_width="match_parent"
5659
android:layout_height="wrap_content"
5760
android:layout_marginStart="16dp"
61+
android:layout_marginLeft="16dp"
62+
android:layout_marginRight="16dp"
5863
android:layout_marginEnd="16dp"
5964
android:layout_marginTop="8dp"
6065
android:ellipsize="end"
@@ -81,7 +86,9 @@
8186
android:layout_width="0dp"
8287
android:layout_height="36dp"
8388
android:layout_marginStart="16dp"
89+
android:layout_marginLeft="16dp"
8490
android:layout_marginEnd="8dp"
91+
android:layout_marginRight="8dp"
8592
android:background="@drawable/primary_card_button_background"
8693
android:ellipsize="end"
8794
android:paddingStart="8dp"
@@ -90,13 +97,15 @@
9097
android:stateListAnimator="@null"
9198
android:textAllCaps="false"
9299
android:textColor="@color/white"
93-
app:cornerRadius="32dp" />
100+
app:cornerRadius="32dp"
101+
tools:ignore="Suspicious0dp" />
94102

95103
<Button
96104
android:id="@+id/embedded_message_second_button"
97105
android:layout_width="0dp"
98106
android:layout_height="36dp"
99107
android:layout_marginEnd="16dp"
108+
android:layout_marginRight="16dp"
100109
android:layout_weight="1"
101110
android:background="@drawable/secondary_card_button_background"
102111
android:ellipsize="end"

iterableapi-ui/src/main/res/layout/notification_view.xml

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
android:layout_marginTop="8dp"
99
android:layout_marginBottom="12dp"
1010
android:layout_marginStart="16dp"
11+
android:layout_marginLeft="16dp"
1112
app:cardCornerRadius="8dp"
1213
app:cardElevation="0dp"
1314
android:background="@drawable/notification_view_border"
@@ -18,6 +19,8 @@
1819
android:layout_width="match_parent"
1920
android:layout_height="wrap_content"
2021
android:layout_marginStart="16dp"
22+
android:layout_marginLeft="16dp"
23+
android:layout_marginRight="16dp"
2124
android:layout_marginTop="16dp"
2225
android:layout_marginEnd="16dp"
2326
android:ellipsize="end"
@@ -34,6 +37,8 @@
3437
android:layout_width="match_parent"
3538
android:layout_height="wrap_content"
3639
android:layout_marginStart="16dp"
40+
android:layout_marginLeft="16dp"
41+
android:layout_marginRight="16dp"
3742
android:layout_marginTop="8dp"
3843
android:layout_marginEnd="16dp"
3944
android:ellipsize="end"
@@ -62,6 +67,7 @@
6267
android:layout_width="wrap_content"
6368
android:layout_height="36dp"
6469
android:layout_marginStart="16dp"
70+
android:layout_marginLeft="16dp"
6571
android:textColor="@color/notification_text_color"
6672
android:background="@drawable/primary_notification_button_background"
6773
android:ellipsize="end"
@@ -80,6 +86,7 @@
8086
android:layout_width="wrap_content"
8187
android:layout_height="36dp"
8288
android:layout_marginEnd="16dp"
89+
android:layout_marginRight="16dp"
8390
android:textColor="@color/notification_text_color"
8491
android:background="@drawable/secondary_notification_button_background"
8592
android:ellipsize="end"

iterableapi/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ android {
1717

1818
defaultConfig {
1919
minSdkVersion 16
20-
targetSdkVersion 27
20+
targetSdkVersion 31
2121

2222
buildConfigField "String", "ITERABLE_SDK_VERSION", "\"3.6.0-beta1\""
2323

iterableapi/src/main/AndroidManifest.xml

+12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
55

6+
<uses-permission android:name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS"
7+
tools:ignore="ProtectedPermissions" />
8+
69
<application>
710
<!--FCM-->
811
<service
@@ -28,6 +31,15 @@
2831
android:launchMode="singleInstance"
2932
android:excludeFromRecents="true"
3033
android:theme="@style/TrampolineActivity.Transparent"/>
34+
<activity
35+
android:name="androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity"
36+
android:exported="true" />
37+
<activity
38+
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity"
39+
android:exported="true" />
40+
<activity
41+
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity"
42+
android:exported="true" />
3143

3244
<uses-library android:name="androidx.security" android:required="false" />
3345
</application>

iterableapi/src/main/java/com/iterable/iterableapi/IterableTaskStorage.java

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.iterable.iterableapi;
22

3+
import android.annotation.SuppressLint;
34
import android.content.ContentValues;
45
import android.content.Context;
56
import android.database.Cursor;
@@ -184,6 +185,7 @@ IterableTask getTask(String id) {
184185
return task;
185186
}
186187

188+
@SuppressLint("Range")
187189
private IterableTask createTaskFromCursor(Cursor cursor) {
188190
String id, name;
189191
IterableTaskType type = null;

0 commit comments

Comments
 (0)