From 19cfd3674f2c4c07b1fed8d0c906418c07524c6f Mon Sep 17 00:00:00 2001 From: Steve Grosbois Date: Wed, 5 Feb 2020 11:42:47 +0100 Subject: [PATCH] Added a themeable attribute to change the close button color --- README.md | 12 +++++++++ android-sdk/build.gradle | 2 +- .../src/main/res/layout/activity_payment.xml | 12 ++++----- .../src/main/res/layout/activity_wallet.xml | 26 +++++++++---------- android-sdk/src/main/res/values/attrs.xml | 4 +++ android-sdk/src/main/res/values/colors.xml | 4 +++ android-sdk/src/main/res/values/styles.xml | 7 +++-- build.gradle | 4 +-- 8 files changed, 47 insertions(+), 24 deletions(-) create mode 100644 android-sdk/src/main/res/values/attrs.xml create mode 100644 android-sdk/src/main/res/values/colors.xml diff --git a/README.md b/README.md index 175b272..980a974 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,18 @@ walletController.manageWebWallet(uri) Ces deux méthodes requièrent l'uri de la page vers laquelle nous devons être redirigés. La récupération du paramètre `uri` se fera selon vos choix d'implementation. Pour plus d'informations, veuillez vous référer à la documentation Payline en cliquant [ici](https://support.payline.com/hc/fr/articles/360000844007-PW-Int%C3%A9gration-Widget) +### Personnalisation + +Vous pouvez personnaliser certains attributs de la page de paiement et de la page de gestion du portefeuille en surchargeant le theme du SDK. + +```xml + + +``` + +- `closeButtonColor` : Couleur de la croix permettant de fermer la page. # Payline Documentation diff --git a/android-sdk/build.gradle b/android-sdk/build.gradle index 38deb61..9273e99 100644 --- a/android-sdk/build.gradle +++ b/android-sdk/build.gradle @@ -46,7 +46,7 @@ android { dependencies { implementation 'androidx.appcompat:appcompat:1.1.0' - implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0' + implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' implementation 'com.google.android.material:material:1.0.0' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" diff --git a/android-sdk/src/main/res/layout/activity_payment.xml b/android-sdk/src/main/res/layout/activity_payment.xml index 6516823..fd86ff8 100644 --- a/android-sdk/src/main/res/layout/activity_payment.xml +++ b/android-sdk/src/main/res/layout/activity_payment.xml @@ -2,32 +2,32 @@ + android:layout_height="match_parent" /> + android:src="@drawable/ic_cross" + android:tint="?closeButtonColor" /> + tools:visibility="visible" /> diff --git a/android-sdk/src/main/res/layout/activity_wallet.xml b/android-sdk/src/main/res/layout/activity_wallet.xml index 164a3b9..56d14e6 100644 --- a/android-sdk/src/main/res/layout/activity_wallet.xml +++ b/android-sdk/src/main/res/layout/activity_wallet.xml @@ -2,30 +2,30 @@ + android:layout_height="match_parent"> + android:layout_height="match_parent" /> + android:src="@drawable/ic_cross" + android:tint="?closeButtonColor" /> + android:id="@+id/progressBar" + style="@style/Widget.AppCompat.ProgressBar" + android:layout_width="@dimen/progress_dialog_size" + android:layout_height="@dimen/progress_dialog_size" + android:layout_gravity="center" + android:layout_margin="@dimen/standard_margin" + android:indeterminate="true" + android:visibility="gone" /> diff --git a/android-sdk/src/main/res/values/attrs.xml b/android-sdk/src/main/res/values/attrs.xml new file mode 100644 index 0000000..ce80c40 --- /dev/null +++ b/android-sdk/src/main/res/values/attrs.xml @@ -0,0 +1,4 @@ + + + + diff --git a/android-sdk/src/main/res/values/colors.xml b/android-sdk/src/main/res/values/colors.xml new file mode 100644 index 0000000..6796aa7 --- /dev/null +++ b/android-sdk/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #000000 + diff --git a/android-sdk/src/main/res/values/styles.xml b/android-sdk/src/main/res/values/styles.xml index 4d7cebc..ea25f2b 100644 --- a/android-sdk/src/main/res/values/styles.xml +++ b/android-sdk/src/main/res/values/styles.xml @@ -3,9 +3,12 @@ - \ No newline at end of file +