Skip to content

Commit

Permalink
[PR-19613] Migrate to AndroidX and actualise Facebook SDK (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtv authored Jun 12, 2023
1 parent 6ebc867 commit 6a562b9
Show file tree
Hide file tree
Showing 25 changed files with 104 additions and 131 deletions.
32 changes: 17 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -45,3 +40,10 @@ jobs:
path: ~/junit
- store_artifacts:
path: ~/junit

workflows:
workflow:
jobs:
- build:
context:
- org-global
File renamed without changes.
4 changes: 4 additions & 0 deletions .circleci/config/keystore.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
keyAlias = circleci
keyPassword = circleci
storeFile = ./../keystore.jks
storePassword = circleci
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ captures/
*.jks

# Keys and passwords
keystore.properties
/keystore.properties
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
```

Expand Down
16 changes: 10 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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'
}
7 changes: 5 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package="com.talkable.demo">

<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.INTERNET"/>

<application
android:allowBackup="true"
Expand All @@ -13,7 +14,8 @@
android:name=".DemoApp">
<activity
android:name="com.talkable.demo.MainActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation">
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down Expand Up @@ -43,8 +45,9 @@
<!-- Facebook -->

<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>

<provider android:authorities="com.facebook.app.FacebookContentProvider549932915208564"
<provider android:authorities="com.facebook.app.FacebookContentProvider784708545842451"
android:name="com.facebook.FacebookContentProvider"
android:exported="true"/>

Expand Down
43 changes: 22 additions & 21 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
android:layout_height="wrap_content"
android:orientation="vertical">

<android.support.design.widget.TextInputLayout

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/emailTextLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -29,15 +30,15 @@
android:layout_alignParentTop="true"
android:hint="@string/emailTextLabel">

<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/emailText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:text="@string/emailTextDefault" />
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>

<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/orderNumberTextLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -46,15 +47,15 @@
android:layout_below="@+id/emailTextLayout"
android:hint="@string/orderNumberTextLabel">

<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/orderNumberText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:text="@string/orderNumberTextDefault" />
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>

<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/couponTextLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -63,14 +64,14 @@
android:layout_below="@+id/orderNumberTextLayout"
android:hint="@string/couponTextLabel">

<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/couponText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/couponTextDefault" />
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>

<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/subtotalTextLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -79,15 +80,15 @@
android:layout_below="@+id/couponTextLayout"
android:hint="@string/subtotalTextLabel">

<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/subtotalText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:text="@string/subtotalTextDefault" />
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>

<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/eventCategoryTextLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -96,14 +97,14 @@
android:layout_below="@+id/subtotalTextLayout"
android:hint="@string/eventCategoryTextLabel">

<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/eventCategoryText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/eventCategoryTextDefault" />
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>

<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/webUUIDTextLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -112,14 +113,14 @@
android:layout_below="@+id/eventCategoryTextLayout"
android:hint="@string/webUUIDTextLabel">

<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/webUUIDText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>

<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/offerIDTextLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -128,12 +129,12 @@
android:layout_below="@+id/webUUIDTextLayout"
android:hint="@string/offerIDTextLabel">

<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/offerIDText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>


<Button
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
<string name="affiliateMemberViaApiBtnLabel">Affiliate Member via API</string>
<string name="deepLinkingBtnLabel">Handle Deep Linking Params</string>

<string name="facebook_app_id">549932915208564</string>
<string name="facebook_app_id">784708545842451</string>
<string name="facebook_client_token">1898aa5e79cdc62cf0664fad34fe0e74</string>
<string name="couponTextDefault">TKBL_COUPON</string>
<string name="orderNumberTextDefault">12345</string>
<string name="emailTextDefault">[email protected]</string>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.android.tools.build:gradle:3.4.3'
classpath 'de.mobilej.unmock:UnMockPlugin:0.6.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'

Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
22 changes: 11 additions & 11 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ apply plugin: 'com.github.dcendents.android-maven'
group='com.github.talkable'

android {
compileSdkVersion 27
compileSdkVersion 31

defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionCode 40
versionName "0.5.11"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
targetSdkVersion 31
versionCode 41
versionName "0.5.12"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
Expand Down Expand Up @@ -49,14 +49,14 @@ dependencies {
exclude module: 'objenesis'
}

androidTestImplementation 'com.android.support:support-annotations:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test:rules:1.0.1'
androidTestImplementation 'androidx.annotation:annotation:1.0.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test:rules:1.1.1'

implementation 'com.android.support:support-annotations:27.1.1'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.2.0' // update to a new version when https://github.com/square/okhttp/issues/3928 will be fixed
implementation 'com.squareup.okhttp3:logging-interceptor:3.2.0'
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
implementation 'com.facebook.android:facebook-android-sdk:14.1.1'
implementation 'com.google.code.gson:gson:2.8.+'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

import android.content.Context;
import android.content.Intent;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import android.test.ActivityInstrumentationTestCase2;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Expand Down
10 changes: 9 additions & 1 deletion sdk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,12 @@
</intent-filter>
</receiver>
</application>
</manifest>

<queries>
<intent>
<action android:name="android.intent.action.SENDTO"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="mailto"/>
</intent>
</queries>
</manifest>
2 changes: 1 addition & 1 deletion sdk/src/main/java/com/talkable/sdk/Talkable.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 6a562b9

Please sign in to comment.