Skip to content

Commit 2e67f6c

Browse files
Adds a close button to 3DS window (#147)
* Update Android Gradle Plugin to 7.1.3 - Older versions don't work on ARM computers * Add close button to 3DS popup * Update dependencies to fix Jacoco reports * Correct version name
1 parent a0ba7a0 commit 2e67f6c

File tree

9 files changed

+54
-26
lines changed

9 files changed

+54
-26
lines changed

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.jacocoVersion = '0.8.5'
4+
ext.jacocoVersion = '0.8.7'
55
ext.versions = [
6-
'kotlin' : '1.4.30',
6+
'kotlin' : '1.7.22',
77
'coroutines' : '1.4.2',
88
'robolectric' : '4.4',
99
'mockito' : '3.8.0',
@@ -16,7 +16,7 @@ buildscript {
1616
google()
1717
}
1818
dependencies {
19-
classpath 'com.android.tools.build:gradle:4.0.0'
19+
classpath 'com.android.tools.build:gradle:7.4.0'
2020
classpath 'org.robolectric:robolectric-gradle-plugin:1.1.0'
2121
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
2222
// NOTE: Do not place your application dependencies here; they belong
@@ -63,8 +63,8 @@ ext {
6363
compileSdkVersion = 29
6464
minSdkVersion = 16
6565
targetSdkVersion = 29
66-
versionCode = 18
66+
versionCode = 19
6767

6868
buildToolsVersion = "29.0.2"
69-
versionName = "3.1.2"
69+
versionName = "3.2.0-alpha02"
7070
}

example/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
3232

3333
android {
3434
compileSdkVersion rootProject.ext.compileSdkVersion
35-
buildToolsVersion rootProject.ext.buildToolsVersion
3635

3736
defaultConfig {
3837
applicationId "co.paystack.example"

example/src/main/java/co/paystack/example/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class MainActivity extends AppCompatActivity {
3737
// Step 5. Copy the url generated by heroku (format https://some-url.herokuapp.com) into the space below
3838
String backend_url = "https://infinite-peak-60063.herokuapp.com";
3939
// Set this to a public key that matches the secret key you supplied while creating the heroku instance
40-
String paystack_public_key = "pk_live_2bf31d4aea08ab31f5d0cfd645c7e4f67025d259";
40+
String paystack_public_key = "pk_test_9eb0263ed776c4c892e0281348aee4136cd0dd52";
4141

4242
EditText mEditCardNum;
4343
EditText mEditCVC;

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ android.useAndroidX=true
2525
org.gradle.daemon=true
2626
org.gradle.jvmargs=-Xmx2560m
2727
GROUP=co.paystack.android
28-
VERSION_NAME=3.1.2
28+
VERSION_NAME=3.2.0-alpha02
2929
POM_DESCRIPTION=Android SDK for Paystack
3030
POM_URL=https://github.com/PaystackHQ/paystack-android
3131
POM_SCM_URL=https://github.com/PaystackHQ/paystack-android
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Jun 03 13:36:41 WAT 2020
1+
#Wed Jan 18 10:19:42 WAT 2023
22
distributionBase=GRADLE_USER_HOME
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
34
distributionPath=wrapper/dists
4-
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
6+
zipStoreBase=GRADLE_USER_HOME

paystack/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ android {
4141
targetSdkVersion rootProject.ext.targetSdkVersion
4242
versionName rootProject.ext.versionName
4343
consumerProguardFiles 'proguard-rules.pro'
44+
45+
buildConfigField 'int', 'VERSION_CODE', "${rootProject.ext.versionCode}"
46+
buildConfigField 'String', 'VERSION_NAME', "\"${rootProject.ext.versionName}\""
4447
}
4548
buildTypes {
4649
debug {

paystack/src/main/java/co/paystack/android/ui/AuthActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
import android.app.Activity;
44
import android.os.Build;
55
import android.os.Bundle;
6+
import android.view.View;
67
import android.view.WindowManager;
78
import android.webkit.JavascriptInterface;
89
import android.webkit.WebView;
910
import android.webkit.WebViewClient;
11+
import android.widget.ImageView;
1012

1113
import co.paystack.android.R;
1214
import co.paystack.android.api.di.ApiModule;
@@ -42,6 +44,8 @@ public void handleResponse() {
4244
protected void setup() {
4345
setContentView(R.layout.co_paystack_android____activity_auth);
4446

47+
findViewById(R.id.iv_close).setOnClickListener(v -> finish());
48+
4549
webView = findViewById(R.id.webView);
4650
webView.setKeepScreenOn(true);
4751

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<vector android:height="24dp" android:tint="#FFFFFF"
2+
android:viewportHeight="24" android:viewportWidth="24"
3+
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
4+
<path android:fillColor="@android:color/white" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
5+
</vector>
Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout
3-
xmlns:android="http://schemas.android.com/apk/res/android"
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
43
xmlns:tools="http://schemas.android.com/tools"
54

65
android:layout_width="match_parent"
@@ -11,7 +10,7 @@
1110
<Space
1211
android:layout_width="match_parent"
1312
android:layout_height="0dp"
14-
android:layout_weight="1"/>
13+
android:layout_weight="1" />
1514

1615
<LinearLayout
1716
android:layout_width="match_parent"
@@ -22,7 +21,7 @@
2221
<Space
2322
android:layout_width="0dp"
2423
android:layout_height="match_parent"
25-
android:layout_weight="1"/>
24+
android:layout_weight="1" />
2625

2726
<LinearLayout
2827
android:layout_width="0dp"
@@ -31,38 +30,56 @@
3130
android:background="#292929"
3231
android:orientation="vertical">
3332

34-
<TextView
33+
<LinearLayout
3534
android:layout_width="match_parent"
3635
android:layout_height="0dp"
37-
android:layout_marginLeft="@dimen/paystack__view__margin"
38-
android:layout_marginRight="@dimen/paystack__view__margin"
39-
android:layout_marginTop="@dimen/paystack__view__margin"
4036
android:layout_weight="1"
41-
android:background="#292929"
42-
android:gravity="center"
43-
android:text="Please conclude challenge from your bank to authorize payment"/>
37+
android:orientation="horizontal"
38+
android:paddingStart="4dp"
39+
android:paddingLeft="4dp"
40+
android:paddingEnd="12dp"
41+
android:paddingRight="12dp">
42+
43+
<ImageView
44+
android:id="@+id/iv_close"
45+
android:layout_width="48dp"
46+
android:layout_height="48dp"
47+
android:padding="12dp"
48+
android:gravity="center_horizontal"
49+
android:src="@drawable/ic_close_24" />
50+
51+
<TextView
52+
android:layout_width="match_parent"
53+
android:layout_height="wrap_content"
54+
android:layout_marginLeft="@dimen/paystack__view__margin"
55+
android:layout_marginTop="@dimen/paystack__view__margin"
56+
android:layout_marginRight="@dimen/paystack__view__margin"
57+
android:background="#292929"
58+
android:gravity="center"
59+
android:text="Please conclude challenge from your bank to authorize payment" />
60+
</LinearLayout>
4461

4562
<WebView
4663
android:id="@+id/webView"
4764
android:layout_width="match_parent"
4865
android:layout_height="0dp"
49-
android:layout_marginBottom="@dimen/paystack__view__margin"
5066
android:layout_marginLeft="@dimen/paystack__view__margin"
5167
android:layout_marginRight="@dimen/paystack__view__margin"
68+
android:layout_marginBottom="@dimen/paystack__view__margin"
5269
android:layout_weight="10"
53-
android:background="#292929"/>
70+
android:background="#292929" />
5471
</LinearLayout>
5572

5673
<Space
5774
android:layout_width="0dp"
5875
android:layout_height="match_parent"
59-
android:layout_weight="1"/>
76+
android:layout_weight="1" />
6077
</LinearLayout>
6178

6279
<Space
6380
android:layout_width="match_parent"
6481
android:layout_height="0dp"
65-
android:layout_weight="1"/>
82+
android:layout_weight="1" />
6683

6784

6885
</LinearLayout>

0 commit comments

Comments
 (0)