Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/migrate androidx #683

Merged
merged 13 commits into from
Jan 18, 2021
20 changes: 13 additions & 7 deletions build-system/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ ext {
buildToolsVersion = '28.0.3'

// Libraries version
supportLibraryVersion = '28.0.0'
appCompatVersion = '1.2.0'
supportLibAndroidX = '1.0.0'
playAuthVersion = '15.0.1'
okHttpVersion = '3.10.0'
retrofitVersion = '2.4.0'
Expand All @@ -22,14 +23,15 @@ ext {
smsVerifyVersion = '0.3.1'
zxingVersion = '3.5.0'
cardAndroidVersion = '5.5.1'
localizationVersion = '1.2.6'

// TODO: Migrate to AndroidX
supportLibraries = [
appCompat : "com.android.support:appcompat-v7:${supportLibraryVersion}",
supportV4 : "com.android.support:support-v4:${supportLibraryVersion}",
recyclerview: "com.android.support:recyclerview-v7:${supportLibraryVersion}",
cardView : "com.android.support:cardview-v7:${supportLibraryVersion}",
design : "com.android.support:design:${supportLibraryVersion}",
appCompat : "androidx.appcompat:appcompat:$appCompatVersion",
supportV4 : "androidx.legacy:legacy-support-v4:$supportLibAndroidX",
recyclerview: "androidx.recyclerview:recyclerview:$supportLibAndroidX",
cardView : "androidx.cardview:cardview:$supportLibAndroidX",
design : "com.google.android.material:material:$supportLibAndroidX",
]

playServicesLibraries = [
Expand Down Expand Up @@ -60,7 +62,7 @@ ext {
mockitoVersion = '1.10.19'

testLibraries = [
runner : "com.android.support.test:runner:${testRunnerVersion}",
runner : 'androidx.test.ext:junit:1.1.1',
powermock : "org.powermock:powermock-mockito-release-full:${powermockVersion}",
junit : "junit:junit:${junitVersion}",
mockito : "org.mockito:mockito-core:${mockitoVersion}",
Expand All @@ -70,4 +72,8 @@ ext {
powermockXstream : "org.powermock:powermock-classloading-xstream:${powermockVersion}",
espresso : "com.android.support.test.espresso:espresso-core:${espressoVersion}",
]

localizationLibraries = [
localization: "com.akexorcist:localization:${localizationVersion}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried this lib? Or at least confirming that the issue isn't happening on the SDK itself or affecting the host app. I'm seeing some open issue may become critical if affecting our merchant's app :

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we have tested it. and also the merchant have tested that our sdk using that lib. and if I use release build it's still running well. but let re-test by QA.

Copy link

@akexorcist akexorcist Feb 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@farhanpahlevi @askur87 Feel free to ask for help when you have any critical problem from my library in your SDK. Open issue in my repository or send an email is fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thanks @akexorcist. will let you know if we facing some issue with your library.

]
}
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ buildscript {
repositories {
maven { url 'https://maven.google.com' }
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
}
}
Expand All @@ -17,6 +18,7 @@ allprojects {
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
jcenter()
google()
}

project.plugins.whenPluginAdded { plugin ->
Expand All @@ -32,4 +34,4 @@ allprojects {

task clean(type: Delete) {
delete rootProject.buildDir
}
}
2 changes: 1 addition & 1 deletion corekit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
versionCode 2
versionName versionSdk

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

buildConfigField "String", "CALLBACK_STRING", "\"/token/callback/\""
buildConfigField "String", "CALLBACK_URL", "\"https://hangout.betas.in/veritrans/api/paymentstatus\""
Expand Down
18 changes: 9 additions & 9 deletions corekit/consumer-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
-keep class com.midtrans.sdk.uikit.BuildConfig { *; }

# http://stackoverflow.com/questions/29679177/cardview-shadow-not-appearing-in-lollipop-after-obfuscate-with-proguard/29698051
-keep class android.support.v7.widget.RoundRectDrawable { *; }
-keep class androidx.cardview.widget.RoundRectDrawable { *; }

# keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }
-keep public class androidx.preference.internal.** { *; }
#-keep public class android.support.v7.internal.view.menu.** { *; }

-keep public class * extends android.support.v4.view.ActionProvider {
-keep public class * extends androidx.core.view.ActionProvider {
public <init>(android.content.Context);
}

Expand All @@ -70,10 +70,10 @@
public void *(android.view.MenuItem);
}

-dontwarn android.support.design.**
-keep class android.support.design.** { *; }
-keep interface android.support.design.** { *; }
-keep public class android.support.design.R$* { *; }
-dontwarn com.google.android.material.**
-keep class com.google.android.material.** { *; }
-keep interface com.google.android.material.** { *; }
-keep public class com.google.android.material.R$* { *; }

# Retrofit 1.X

Expand Down Expand Up @@ -230,4 +230,4 @@ public static final *** NULL; }
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions

-dontwarn javax.annotation.**
-dontwarn javax.annotation.**
18 changes: 9 additions & 9 deletions corekit/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
-keep class com.midtrans.sdk.uikit.BuildConfig { *; }

# http://stackoverflow.com/questions/29679177/cardview-shadow-not-appearing-in-lollipop-after-obfuscate-with-proguard/29698051
-keep class android.support.v7.widget.RoundRectDrawable { *; }
-keep class androidx.cardview.widget.RoundRectDrawable { *; }

# keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }
-keep public class androidx.preference.internal.** { *; }
#-keep public class android.support.v7.internal.view.menu.** { *; }

-keep public class * extends android.support.v4.view.ActionProvider {
-keep public class * extends androidx.core.view.ActionProvider {
public <init>(android.content.Context);
}

Expand All @@ -70,10 +70,10 @@
public void *(android.view.MenuItem);
}

-dontwarn android.support.design.**
-keep class android.support.design.** { *; }
-keep interface android.support.design.** { *; }
-keep public class android.support.design.R$* { *; }
-dontwarn com.google.android.material.**
-keep class com.google.android.material.** { *; }
-keep interface com.google.android.material.** { *; }
-keep public class com.google.android.material.R$* { *; }

# Retrofit 1.X

Expand Down Expand Up @@ -231,4 +231,4 @@ public static final *** NULL; }
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions

-dontwarn javax.annotation.**
-dontwarn javax.annotation.**
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import android.app.Activity;
import android.content.Context;
import android.support.annotation.NonNull;
import android.text.TextUtils;

import androidx.annotation.NonNull;

import com.midtrans.sdk.analytics.MixpanelAnalyticsManager;
import com.midtrans.sdk.corekit.BuildConfig;
import com.midtrans.sdk.corekit.callback.BankBinsCallback;
Expand Down Expand Up @@ -1905,4 +1906,4 @@ private boolean isTransactionRequestAvailable() {
public String getLanguageCode() {
return languageCode;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.midtrans.sdk.corekit.core;

import android.content.Context;
import android.support.annotation.NonNull;

import androidx.annotation.NonNull;

/**
* Created by shivam on 10/20/15.
Expand Down Expand Up @@ -75,4 +76,4 @@ public SdkCoreFlowBuilder setMerchantBaseUrl(String merchantBaseUrl) {
this.merchantServerUrl = merchantBaseUrl;
return this;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.midtrans.sdk.corekit.core;

import android.support.annotation.NonNull;
import android.text.TextUtils;

import com.google.gson.annotations.SerializedName;
import androidx.annotation.NonNull;

import com.midtrans.sdk.corekit.models.BcaBankTransferRequestModel;
import com.midtrans.sdk.corekit.models.BillInfoModel;
import com.midtrans.sdk.corekit.models.BillingAddress;
Expand Down Expand Up @@ -426,4 +426,4 @@ public Shopeepay getShopeepay() {
public void setShopeepay(Shopeepay shopeepay) {
this.shopeepay = shopeepay;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.midtrans.sdk.corekit.core.themes;

import android.content.Context;
import android.support.v4.content.ContextCompat;
import androidx.core.content.ContextCompat;

import com.midtrans.sdk.corekit.R;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.midtrans.sdk.corekit.models.snap;

import android.support.annotation.StringDef;
import androidx.annotation.StringDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand All @@ -17,4 +17,4 @@
String AUTH_3DS = "3ds";
String AUTH_NONE = "none";
String AUTH_RBA = "rba";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
import android.content.Context;
import android.content.res.Resources;
import android.net.ConnectivityManager;
import android.support.annotation.NonNull;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

import androidx.annotation.NonNull;

import com.midtrans.sdk.corekit.core.Logger;
import com.midtrans.sdk.corekit.models.snap.Authentication;

Expand Down Expand Up @@ -272,4 +273,4 @@ public static String getDeviceType(Activity activity) {

return deviceType;
}
}
}
5 changes: 3 additions & 2 deletions demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ android {
versionCode 4
versionName "1.21.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

resValue "string", "app_name", "Midtrans Demo Dev"
}
Expand Down Expand Up @@ -96,6 +96,7 @@ dependencies {
implementation supportLibraries.cardView
implementation supportLibraries.design
implementation libraries.swipeLayout
implementation localizationLibraries.localization
implementation(libraries.crashlytics) {
transitive = true
}
Expand All @@ -104,4 +105,4 @@ dependencies {
exclude module: 'uikit'
exclude module: 'corekit'
}
}
}
26 changes: 13 additions & 13 deletions demo/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@
-keep class com.midtrans.sdk.coreflow.BuildConfig { *; }

# Keep the support library
-keep class android.support.v4.** { *; }
-keep interface android.support.v4.** { *; }
-keep class androidx.legacy.** { *; }
-keep interface androidx.legacy.** { *; }

# http://stackoverflow.com/questions/29679177/cardview-shadow-not-appearing-in-lollipop-after-obfuscate-with-proguard/29698051
-keep class android.support.v7.widget.RoundRectDrawable { *; }
-keep class androidx.cardview.widget.RoundRectDrawable { *; }

# keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }
-keep public class androidx.preference.internal.** { *; }
#-keep public class android.support.v7.internal.view.menu.** { *; }

-keep public class * extends android.support.v4.view.ActionProvider {
-keep public class * extends androidx.core.view.ActionProvider {
public <init>(android.content.Context);
}

Expand All @@ -59,10 +59,10 @@
*** get*();
}

-dontwarn android.support.design.**
-keep class android.support.design.** { *; }
-keep interface android.support.design.** { *; }
-keep public class android.support.design.R$* { *; }
-dontwarn com.google.android.material.**
-keep class com.google.android.material.** { *; }
-keep interface com.google.android.material.** { *; }
-keep public class com.google.android.material.R$* { *; }

# Retrofit 1.X

Expand Down Expand Up @@ -192,11 +192,11 @@ public static final *** NULL; }
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers class * extends android.support.v7.app.AppCompatActivity{
-keepclassmembers class * extends androidx.appcompat.app.AppCompatActivity{
public void *(android.view.View);
}
-keepclassmembers public class * extends android.support.v4.app.Fragment{
-keepclassmembers public class * extends androidx.legacy.app.Fragment{
public *** on*(...);
public *** *Dialog();
public void *(android.view.View);
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.midtrans.demo;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.TextInputLayout;
import android.support.v4.app.DialogFragment;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;

import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.textfield.TextInputLayout;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.midtrans.demo;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.TextInputLayout;
import android.support.v4.app.DialogFragment;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;

import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.textfield.TextInputLayout;
import android.text.Editable;
import android.text.InputFilter;
import android.text.InputFilter.LengthFilter;
Expand Down
10 changes: 4 additions & 6 deletions demo/src/main/java/com/midtrans/demo/DemoAccountActivity.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package com.midtrans.demo;

import android.content.Intent;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.text.TextUtils;
import android.view.View;
import android.widget.RelativeLayout;

/**
* Created by ziahaqi on 5/3/17.
Expand Down
Loading