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

Added a themeable attribute to change the close button color #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!-- Override Payline Theme -->
<style name="AppTheme.PaylineSDK">
<item name="closeButtonColor">@color/my_button_color</item>
</style>
```

- `closeButtonColor` : Couleur de la croix permettant de fermer la page.

# Payline Documentation

Expand Down
2 changes: 1 addition & 1 deletion android-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions android-sdk/src/main/res/layout/activity_payment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<FrameLayout
android:id="@+id/frameLayout_fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />

<ImageView
android:id="@+id/b_cancel_payment_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_cross"
android:layout_gravity="end"
android:layout_margin="16dp"
android:id="@+id/b_cancel_payment_activity"/>
android:src="@drawable/ic_cross"
android:tint="?closeButtonColor" />

<androidx.core.widget.ContentLoadingProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="@dimen/progress_dialog_size"
android:layout_height="@dimen/progress_dialog_size"
android:layout_margin="@dimen/standard_margin"
android:layout_gravity="center"
android:layout_margin="@dimen/standard_margin"
android:indeterminate="true"
android:visibility="gone"
tools:visibility="visible"/>
tools:visibility="visible" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
26 changes: 13 additions & 13 deletions android-sdk/src/main/res/layout/activity_wallet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
android:layout_height="match_parent">

<FrameLayout
android:id="@+id/frameLayout_fragmentContainer_wallet"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="match_parent" />

<ImageView
android:id="@+id/b_cancel_wallet_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_cross"
android:layout_gravity="end"
android:layout_margin="16dp"
android:id="@+id/b_cancel_wallet_activity"/>
android:src="@drawable/ic_cross"
android:tint="?closeButtonColor" />

<androidx.core.widget.ContentLoadingProgressBar
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_margin="@dimen/standard_margin"
android:layout_gravity="center"
android:indeterminate="true"
android:visibility="gone" />
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" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
4 changes: 4 additions & 0 deletions android-sdk/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="closeButtonColor" format="reference"/>
</resources>
4 changes: 4 additions & 0 deletions android-sdk/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#000000</color>
</resources>
7 changes: 5 additions & 2 deletions android-sdk/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@

<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar"/>

<style name="AppTheme.PaylineSDK">
<style name="AppTheme.BasePaylineSDK">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="closeButtonColor">@color/black</item>
</style>

</resources>
<style name="AppTheme.PaylineSDK" parent="AppTheme.BasePaylineSDK" />

</resources>
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.60'
ext.kotlin_version = '1.3.61'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.android.tools.build:gradle:3.5.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:0.9.17"
}
Expand Down