diff --git a/.circleci/config.yml b/.circleci/config.yml
index 116334f..0b1e672 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,35 +1,30 @@
-version: 2
+version: 2.1
jobs:
build:
docker:
- - image: circleci/android:api-27-alpha
+ - auth:
+ username: $DOCKERHUB_USERNAME
+ password: $DOCKERHUB_ACCESS_TOKEN
+ image: cimg/android:2023.04
environment:
+ JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
JVM_OPTS: -Xmx3200m
- working_directory: ~/android-sdk
-
steps:
- checkout
- run:
- name: Create configuration files
- command: |
- touch api_keys.properties
- cat > keystore.properties << EOL
- keyAlias = circleci
- keyPassword = circleci
- storeFile = ./../keystore.jks
- storePassword = circleci
- EOL
+ name: Copy configuration files
+ command: cp .circleci/config/* .
- restore_cache:
- key: v1-dependencies-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
+ key: v2-dependencies-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Download dependencies
command: ./gradlew androidDependencies
- save_cache:
paths:
- ~/.gradle
- key: v1-dependencies-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
+ key: v2-dependencies-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Run tests
@@ -45,3 +40,10 @@ jobs:
path: ~/junit
- store_artifacts:
path: ~/junit
+
+workflows:
+ workflow:
+ jobs:
+ - build:
+ context:
+ - org-global
diff --git a/.keep b/.circleci/config/api_keys.properties
similarity index 100%
rename from .keep
rename to .circleci/config/api_keys.properties
diff --git a/.circleci/config/keystore.properties b/.circleci/config/keystore.properties
new file mode 100644
index 0000000..89fcec8
--- /dev/null
+++ b/.circleci/config/keystore.properties
@@ -0,0 +1,4 @@
+keyAlias = circleci
+keyPassword = circleci
+storeFile = ./../keystore.jks
+storePassword = circleci
diff --git a/.gitignore b/.gitignore
index f7cf2b6..3590440 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,4 +42,4 @@ captures/
*.jks
# Keys and passwords
-keystore.properties
+/keystore.properties
diff --git a/README.md b/README.md
index 620dd18..a02ece9 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ allprojects {
```gradle
dependencies {
- implementation 'com.github.talkable:android-sdk:0.5.11'
+ implementation 'com.github.talkable:android-sdk:0.5.12'
}
```
diff --git a/app/build.gradle b/app/build.gradle
index 2edfa2a..2a64840 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -13,13 +13,13 @@ android {
storePassword keystoreProperties['storePassword']
}
}
- compileSdkVersion 27
+ compileSdkVersion 31
defaultConfig {
applicationId "com.talkable.demo"
minSdkVersion 16
- targetSdkVersion 27
- versionCode 33
- versionName "0.5.2"
+ targetSdkVersion 31
+ versionCode 34
+ versionName "0.5.3"
}
buildTypes {
release {
@@ -28,12 +28,16 @@ android {
signingConfig signingConfigs.config
}
}
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(path: ':sdk')
- implementation 'com.android.support:design:27.1.1'
- implementation 'com.android.support:support-v4:27.1.1'
+ implementation 'com.google.android.material:material:1.0.0'
+ implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index be019c5..828657c 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -3,6 +3,7 @@
package="com.talkable.demo">
+
+ android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
+ android:exported="true">
@@ -43,8 +45,9 @@
+
-
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index ee404c2..fd4e777 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -20,7 +20,8 @@
android:layout_height="wrap_content"
android:orientation="vertical">
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
diff --git a/sdk/src/main/java/com/talkable/sdk/Talkable.java b/sdk/src/main/java/com/talkable/sdk/Talkable.java
index 3f3ffc7..38d1901 100644
--- a/sdk/src/main/java/com/talkable/sdk/Talkable.java
+++ b/sdk/src/main/java/com/talkable/sdk/Talkable.java
@@ -6,7 +6,7 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
-import android.support.v4.app.FragmentActivity;
+import androidx.fragment.app.FragmentActivity;
import android.util.Base64;
import android.util.Log;
import android.webkit.WebSettings;
diff --git a/sdk/src/main/java/com/talkable/sdk/TalkableActivity.java b/sdk/src/main/java/com/talkable/sdk/TalkableActivity.java
index 736a7d0..510783b 100644
--- a/sdk/src/main/java/com/talkable/sdk/TalkableActivity.java
+++ b/sdk/src/main/java/com/talkable/sdk/TalkableActivity.java
@@ -1,8 +1,8 @@
package com.talkable.sdk;
import android.os.Bundle;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
+import androidx.fragment.app.FragmentActivity;
+import androidx.fragment.app.FragmentManager;
import android.util.Log;
import com.talkable.sdk.TalkableOfferFragment.TalkableOfferFragmentListener;
diff --git a/sdk/src/main/java/com/talkable/sdk/TalkableApi.java b/sdk/src/main/java/com/talkable/sdk/TalkableApi.java
index a4246b3..d59a0a3 100644
--- a/sdk/src/main/java/com/talkable/sdk/TalkableApi.java
+++ b/sdk/src/main/java/com/talkable/sdk/TalkableApi.java
@@ -1,7 +1,7 @@
package com.talkable.sdk;
import android.content.Context;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import android.util.Log;
import com.google.gson.JsonArray;
diff --git a/sdk/src/main/java/com/talkable/sdk/TalkableOfferFragment.java b/sdk/src/main/java/com/talkable/sdk/TalkableOfferFragment.java
index fc66fae..206b543 100644
--- a/sdk/src/main/java/com/talkable/sdk/TalkableOfferFragment.java
+++ b/sdk/src/main/java/com/talkable/sdk/TalkableOfferFragment.java
@@ -13,10 +13,10 @@
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
-import android.support.v4.content.ContextCompat;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.core.content.ContextCompat;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
diff --git a/sdk/src/main/java/com/talkable/sdk/TalkablePreferencesStore.java b/sdk/src/main/java/com/talkable/sdk/TalkablePreferencesStore.java
index 33c0ab3..c6aa182 100644
--- a/sdk/src/main/java/com/talkable/sdk/TalkablePreferencesStore.java
+++ b/sdk/src/main/java/com/talkable/sdk/TalkablePreferencesStore.java
@@ -2,12 +2,8 @@
import android.content.Context;
import android.provider.Settings;
-import android.util.Log;
-import com.talkable.sdk.api.ApiError;
-import com.talkable.sdk.interfaces.Callback1;
import com.talkable.sdk.models.OfferWebData;
-import com.talkable.sdk.models.Visitor;
import com.talkable.sdk.utils.PreferencesStore;
import java.io.UnsupportedEncodingException;
diff --git a/sdk/src/main/java/com/talkable/sdk/utils/FacebookUtils.java b/sdk/src/main/java/com/talkable/sdk/utils/FacebookUtils.java
index ee14fd4..ad149b4 100644
--- a/sdk/src/main/java/com/talkable/sdk/utils/FacebookUtils.java
+++ b/sdk/src/main/java/com/talkable/sdk/utils/FacebookUtils.java
@@ -7,9 +7,7 @@
import com.facebook.CallbackManager;
import com.facebook.FacebookCallback;
import com.facebook.FacebookException;
-import com.facebook.internal.FacebookDialogBase;
import com.facebook.share.Sharer;
-import com.facebook.share.model.ShareContent;
import com.facebook.share.model.ShareLinkContent;
import com.facebook.share.widget.MessageDialog;
import com.facebook.share.widget.ShareDialog;
@@ -55,7 +53,7 @@ private static ShareLinkContent shareContent(String url) {
return new ShareLinkContent.Builder().setContentUrl(Uri.parse(url)).build();
}
- private static void registerCallback(FacebookDialogBase dialog, final TalkableOfferFragment fragment, final String sharingChannel) {
+ private static void registerCallback(ShareDialog dialog, final TalkableOfferFragment fragment, final String sharingChannel) {
if (callbackManager == null) {
return;
}
@@ -77,7 +75,7 @@ public void onError(FacebookException error) {
});
}
- private static void showDialog(FacebookDialogBase dialog, String url) {
+ private static void showDialog(ShareDialog dialog, String url) {
dialog.show(shareContent(url));
}
}
diff --git a/sdk/src/main/java/com/talkable/sdk/utils/JsonUtils.java b/sdk/src/main/java/com/talkable/sdk/utils/JsonUtils.java
index 488b58f..300f8f3 100644
--- a/sdk/src/main/java/com/talkable/sdk/utils/JsonUtils.java
+++ b/sdk/src/main/java/com/talkable/sdk/utils/JsonUtils.java
@@ -1,6 +1,6 @@
package com.talkable.sdk.utils;
-import android.support.annotation.Nullable;
+import androidx.annotation.Nullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
diff --git a/sdk/src/main/java/com/talkable/sdk/utils/NativeFeatures.java b/sdk/src/main/java/com/talkable/sdk/utils/NativeFeatures.java
index b12cf21..1f1b8d7 100644
--- a/sdk/src/main/java/com/talkable/sdk/utils/NativeFeatures.java
+++ b/sdk/src/main/java/com/talkable/sdk/utils/NativeFeatures.java
@@ -57,7 +57,9 @@ public static void initialize(Context context) {
isMessengerInstalled = MessengerUtils.hasMessengerInstalled(context);
isWhatsAppAvailable = isPackageInstalled("com.whatsapp", context);
- Intent sendNativeMailIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:"));
+ Intent sendNativeMailIntent = new Intent(Intent.ACTION_SENDTO);
+ sendNativeMailIntent.setData(Uri.parse("mailto:"));
+ sendNativeMailIntent.addCategory(Intent.CATEGORY_DEFAULT);
List resolveInfos = context.getPackageManager().queryIntentActivities(sendNativeMailIntent, 0);
if (!resolveInfos.isEmpty()) {
// for some android emulators there is always "com.android.fallback/.Fallback" intent
diff --git a/solano-pre_setup.sh b/solano-pre_setup.sh
deleted file mode 100644
index 51372a1..0000000
--- a/solano-pre_setup.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-
-# Solano CI pre_setup hook
-
-ANDROID_COMPILE_SDK="26"
-ANDROID_BUILD_TOOLS="26.0.1"
-ANDROID_SDK_TOOLS_REV="3859397" # "26.0.1"
-
-# Only trigger the android SDK download if it is not already installed
-if ! test -d $ANDROID_HOME; then
- mkdir $HOME/.android # For sdkmanager configs
- echo 'count=0' > $HOME/.android/repositories.cfg # Avoid warning
-
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS_REV}.zip
- mkdir $PWD/android-sdk-linux
- unzip -qq android-sdk.zip -d $PWD/android-sdk-linux
-
- echo y | $ANDROID_HOME/tools/bin/sdkmanager --update
- echo y | $ANDROID_HOME/tools/bin/sdkmanager 'tools'
- echo y | $ANDROID_HOME/tools/bin/sdkmanager 'platform-tools'
- echo y | $ANDROID_HOME/tools/bin/sdkmanager 'build-tools;'$ANDROID_BUILD_TOOLS
- echo y | $ANDROID_HOME/tools/bin/sdkmanager 'platforms;android-'$ANDROID_COMPILE_SDK
-fi
-
-chmod +x ./gradlew
-./gradlew clean
diff --git a/solano.yml b/solano.yml
deleted file mode 100644
index 14fcf19..0000000
--- a/solano.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-# Solano Labs example Github Android App
-
-hooks:
- pre_setup: export ANDROID_HOME=$PWD/android-sdk-linux && chmod +x ./solano-pre_setup.sh && ./solano-pre_setup.sh
-
-cache:
- key_paths:
- - ./solano-pre_setup.sh
- - build.gradle
- save_paths:
- - .gradle
- - HOME/android-sdk-linux
- - HOME/.gradle
-
-java:
- java_version: java-8-openjdk
-
-# timeout_hook values must be long enough for the initial android-sdk and gradle installs.
-# Subsequent Solano sessions will use cached versions.
-timeout_hook: 300
-
-tests: # For faster results, split tests into individual commands to allow them to run in parallel
- - 'export ANDROID_HOME=$PWD/android-sdk-linux && ./gradlew :sdk:test'