Skip to content

Commit

Permalink
Adds a close button to 3DS window (#147)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
michael-paystack authored Jan 18, 2023
1 parent a0ba7a0 commit 2e67f6c
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 26 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.jacocoVersion = '0.8.5'
ext.jacocoVersion = '0.8.7'
ext.versions = [
'kotlin' : '1.4.30',
'kotlin' : '1.7.22',
'coroutines' : '1.4.2',
'robolectric' : '4.4',
'mockito' : '3.8.0',
Expand All @@ -16,7 +16,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.android.tools.build:gradle:7.4.0'
classpath 'org.robolectric:robolectric-gradle-plugin:1.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
// NOTE: Do not place your application dependencies here; they belong
Expand Down Expand Up @@ -63,8 +63,8 @@ ext {
compileSdkVersion = 29
minSdkVersion = 16
targetSdkVersion = 29
versionCode = 18
versionCode = 19

buildToolsVersion = "29.0.2"
versionName = "3.1.2"
versionName = "3.2.0-alpha02"
}
1 change: 0 additions & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
applicationId "co.paystack.example"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class MainActivity extends AppCompatActivity {
// Step 5. Copy the url generated by heroku (format https://some-url.herokuapp.com) into the space below
String backend_url = "https://infinite-peak-60063.herokuapp.com";
// Set this to a public key that matches the secret key you supplied while creating the heroku instance
String paystack_public_key = "pk_live_2bf31d4aea08ab31f5d0cfd645c7e4f67025d259";
String paystack_public_key = "pk_test_9eb0263ed776c4c892e0281348aee4136cd0dd52";

EditText mEditCardNum;
EditText mEditCVC;
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ android.useAndroidX=true
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx2560m
GROUP=co.paystack.android
VERSION_NAME=3.1.2
VERSION_NAME=3.2.0-alpha02
POM_DESCRIPTION=Android SDK for Paystack
POM_URL=https://github.com/PaystackHQ/paystack-android
POM_SCM_URL=https://github.com/PaystackHQ/paystack-android
Expand Down
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jun 03 13:36:41 WAT 2020
#Wed Jan 18 10:19:42 WAT 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
zipStoreBase=GRADLE_USER_HOME
3 changes: 3 additions & 0 deletions paystack/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionName rootProject.ext.versionName
consumerProguardFiles 'proguard-rules.pro'

buildConfigField 'int', 'VERSION_CODE', "${rootProject.ext.versionCode}"
buildConfigField 'String', 'VERSION_NAME', "\"${rootProject.ext.versionName}\""
}
buildTypes {
debug {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;

import co.paystack.android.R;
import co.paystack.android.api.di.ApiModule;
Expand Down Expand Up @@ -42,6 +44,8 @@ public void handleResponse() {
protected void setup() {
setContentView(R.layout.co_paystack_android____activity_auth);

findViewById(R.id.iv_close).setOnClickListener(v -> finish());

webView = findViewById(R.id.webView);
webView.setKeepScreenOn(true);

Expand Down
5 changes: 5 additions & 0 deletions paystack/src/main/res/drawable/ic_close_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<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"/>
</vector>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"
Expand All @@ -11,7 +10,7 @@
<Space
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
android:layout_weight="1" />

<LinearLayout
android:layout_width="match_parent"
Expand All @@ -22,7 +21,7 @@
<Space
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"/>
android:layout_weight="1" />

<LinearLayout
android:layout_width="0dp"
Expand All @@ -31,38 +30,56 @@
android:background="#292929"
android:orientation="vertical">

<TextView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/paystack__view__margin"
android:layout_marginRight="@dimen/paystack__view__margin"
android:layout_marginTop="@dimen/paystack__view__margin"
android:layout_weight="1"
android:background="#292929"
android:gravity="center"
android:text="Please conclude challenge from your bank to authorize payment"/>
android:orientation="horizontal"
android:paddingStart="4dp"
android:paddingLeft="4dp"
android:paddingEnd="12dp"
android:paddingRight="12dp">

<ImageView
android:id="@+id/iv_close"
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="12dp"
android:gravity="center_horizontal"
android:src="@drawable/ic_close_24" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/paystack__view__margin"
android:layout_marginTop="@dimen/paystack__view__margin"
android:layout_marginRight="@dimen/paystack__view__margin"
android:background="#292929"
android:gravity="center"
android:text="Please conclude challenge from your bank to authorize payment" />
</LinearLayout>

<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/paystack__view__margin"
android:layout_marginLeft="@dimen/paystack__view__margin"
android:layout_marginRight="@dimen/paystack__view__margin"
android:layout_marginBottom="@dimen/paystack__view__margin"
android:layout_weight="10"
android:background="#292929"/>
android:background="#292929" />
</LinearLayout>

<Space
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"/>
android:layout_weight="1" />
</LinearLayout>

<Space
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
android:layout_weight="1" />


</LinearLayout>

0 comments on commit 2e67f6c

Please sign in to comment.