Skip to content

Commit

Permalink
Merge pull request #848 from Iterable/MOB-10410-TargetSDK31
Browse files Browse the repository at this point in the history
[MOB-10410] - Making SDK Target SDK 31 compliant
  • Loading branch information
Ayyanchira authored Dec 12, 2024
2 parents c80a471 + 3aa3e19 commit 8fdec83
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ android {
defaultConfig {
applicationId "com.iterable.iterableapi.testapp"
minSdkVersion 16
targetSdkVersion 27
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,23 @@
android:theme="@style/AppTheme">
<activity
android:name="com.iterable.androidsdk.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity"
android:exported="true" />
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity"
android:exported="true" />
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity"
android:exported="true" />
</application>
</manifest>
2 changes: 1 addition & 1 deletion iterableapi-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {

defaultConfig {
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 31
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
5 changes: 5 additions & 0 deletions iterableapi-ui/src/main/res/layout-v21/banner_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
android:layout_gravity="center_vertical"
android:layout_marginTop="8dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginBottom="12dp"
app:cardCornerRadius="8dp"
app:cardElevation="0dp"
Expand All @@ -18,6 +19,7 @@
android:layout_width="240dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:ellipsize="end"
android:maxLines="2"
Expand All @@ -34,6 +36,7 @@
android:layout_width="240dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:maxLines="2"
Expand Down Expand Up @@ -74,6 +77,8 @@
android:ellipsize="end"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="8dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:paddingStart="12dp"
Expand Down
6 changes: 6 additions & 0 deletions iterableapi-ui/src/main/res/layout-v21/card_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:ellipsize="end"
android:maxLines="2"
Expand All @@ -56,6 +58,8 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:maxLines="2"
Expand Down Expand Up @@ -85,6 +89,8 @@
android:ellipsize="end"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="8dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:paddingStart="12dp"
Expand Down
6 changes: 6 additions & 0 deletions iterableapi-ui/src/main/res/layout/banner_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
android:layout_gravity="center_vertical"
android:layout_marginTop="8dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginBottom="12dp"
app:cardCornerRadius="8dp"
app:cardElevation="0dp"
Expand All @@ -18,6 +19,7 @@
android:layout_width="240dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:ellipsize="end"
android:maxLines="2"
Expand All @@ -34,6 +36,7 @@
android:layout_width="240dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:maxLines="2"
Expand All @@ -51,6 +54,7 @@
android:layout_height="80dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:contentDescription=""
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Expand All @@ -72,6 +76,7 @@
android:background="@drawable/primary_banner_button_background"
android:ellipsize="end"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:paddingStart="12dp"
Expand All @@ -88,6 +93,7 @@
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:background="@drawable/secondary_banner_button_background"
android:ellipsize="end"
android:paddingTop="0dp"
Expand Down
16 changes: 13 additions & 3 deletions iterableapi-ui/src/main/res/layout/card_view.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:layout_gravity="center_vertical"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginLeft="16dp"
android:layout_marginBottom="12dp"
Expand Down Expand Up @@ -40,6 +41,8 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:ellipsize="end"
android:maxLines="2"
Expand All @@ -56,6 +59,8 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:maxLines="2"
Expand All @@ -82,6 +87,8 @@
android:layout_height="36dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="8dp"
android:background="@drawable/primary_card_button_background"
android:ellipsize="end"
android:paddingStart="8dp"
Expand All @@ -92,13 +99,16 @@
android:stateListAnimator="@null"
android:textAllCaps="false"
android:textColor="@color/white"
app:cornerRadius="32dp" />
app:cornerRadius="32dp"
tools:ignore="Suspicious0dp"/>

<Button
android:id="@+id/embedded_message_second_button"
android:layout_width="0dp"
android:layout_height="36dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:layout_weight="1"
Expand Down
7 changes: 7 additions & 0 deletions iterableapi-ui/src/main/res/layout/notification_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
android:layout_marginTop="8dp"
android:layout_marginBottom="12dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
app:cardCornerRadius="8dp"
app:cardElevation="0dp"
android:background="@drawable/notification_view_border"
Expand All @@ -18,6 +19,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:ellipsize="end"
Expand All @@ -36,6 +39,8 @@
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:ellipsize="end"
android:maxLines="2"
android:text=""
Expand All @@ -62,6 +67,7 @@
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:textColor="@color/notification_text_color"
android:background="@drawable/primary_notification_button_background"
android:ellipsize="end"
Expand All @@ -80,6 +86,7 @@
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:textColor="@color/notification_text_color"
android:background="@drawable/secondary_notification_button_background"
android:ellipsize="end"
Expand Down
2 changes: 1 addition & 1 deletion iterableapi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ android {

defaultConfig {
minSdkVersion 16
targetSdkVersion 27
targetSdkVersion 31

buildConfigField "String", "ITERABLE_SDK_VERSION", "\"3.5.4\""

Expand Down
12 changes: 12 additions & 0 deletions iterableapi/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS"
tools:ignore="ProtectedPermissions" />

<application>
<!--FCM-->
Expand Down Expand Up @@ -29,6 +31,16 @@
android:excludeFromRecents="true"
android:theme="@style/TrampolineActivity.Transparent"/>

<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity"
android:exported="true" />
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity"
android:exported="true" />
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity"
android:exported="true" />

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.iterable.iterableapi;

import android.annotation.SuppressLint;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
Expand Down Expand Up @@ -184,6 +185,7 @@ IterableTask getTask(String id) {
return task;
}

@SuppressLint("Range")
private IterableTask createTaskFromCursor(Cursor cursor) {
String id, name;
IterableTaskType type = null;
Expand Down

0 comments on commit 8fdec83

Please sign in to comment.