Skip to content

Commit 90c0788

Browse files
committed
improve sepa mandate dialog & fixed mandate dialog not showing when keyguard is not configured
1 parent 6cca789 commit 90c0788

File tree

3 files changed

+43
-34
lines changed

3 files changed

+43
-34
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ All notable changes to this project will be documented in this file.
33

44
## [0.13.12]
55

6+
### Changed
7+
- Improved SEPA mandate info dialog
8+
69
### Fixed
710
- Now correctly escaping line feeds in product queries
11+
- Fixed SEPA mandate dialog not showing when credentials were not encrypted using a keyguard
812

913
## [0.13.11]
1014

ui/src/main/java/io/snabble/sdk/ui/checkout/PaymentMethodView.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,13 @@ public void onBindViewHolder(final PaymentMethodView.ViewHolder holder, final in
309309
holder.card.setOnClickListener(new OnClickListener() {
310310
@Override
311311
public void onClick(View v) {
312-
if(Snabble.getInstance().getUserPreferences().isRequiringKeyguardAuthenticationForPayment()
313-
&& e.paymentMethod.isRequiringCredentials()) {
314-
showSEPALegalInfoIfNeeded(e.paymentMethod, new OnClickListener() {
315-
@Override
316-
public void onClick(View v) {
317-
final SnabbleUICallback callback = SnabbleUI.getUiCallback();
318-
if (callback != null) {
312+
showSEPALegalInfoIfNeeded(e.paymentMethod, new OnClickListener() {
313+
@Override
314+
public void onClick(View v) {
315+
final SnabbleUICallback callback = SnabbleUI.getUiCallback();
316+
if (callback != null) {
317+
if(Snabble.getInstance().getUserPreferences().isRequiringKeyguardAuthenticationForPayment()
318+
&& e.paymentMethod.isRequiringCredentials()) {
319319
callback.requestKeyguard(new KeyguardHandler() {
320320
@Override
321321
public void onKeyguardResult(int resultCode) {
@@ -327,13 +327,13 @@ public void onKeyguardResult(int resultCode) {
327327
}
328328
}
329329
});
330+
} else {
331+
checkout.pay(e.paymentMethod, e.paymentCredentials);
332+
Telemetry.event(Telemetry.Event.SelectedPaymentMethod, e.paymentMethod);
330333
}
331334
}
332-
});
333-
} else {
334-
checkout.pay(e.paymentMethod, e.paymentCredentials);
335-
Telemetry.event(Telemetry.Event.SelectedPaymentMethod, e.paymentMethod);
336-
}
335+
}
336+
});
337337
}
338338
});
339339
}
Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
2+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
4-
android:layout_gravity="bottom"
54
android:layout_width="match_parent"
6-
android:layout_height="match_parent">
5+
android:layout_height="wrap_content"
6+
android:paddingLeft="24dp"
7+
android:paddingRight="24dp"
8+
android:paddingBottom="20dp">
79
<LinearLayout
810
android:orientation="vertical"
911
android:layout_width="match_parent"
1012
android:layout_height="wrap_content"
11-
android:gravity="center"
12-
android:paddingLeft="24dp"
13-
android:paddingRight="24dp"
14-
android:paddingBottom="20dp">
13+
android:paddingBottom="72dp"
14+
android:gravity="center" >
1515
<ImageView
1616
android:layout_width="wrap_content"
1717
android:layout_height="wrap_content"
@@ -29,20 +29,25 @@
2929
android:textStyle="bold"
3030
android:text="@string/Snabble.Payment.SEPA.legalInfo.title"/>
3131

32-
<TextView
33-
android:id="@+id/message"
34-
android:layout_width="wrap_content"
35-
android:layout_height="wrap_content"
36-
android:gravity="center"
37-
android:layout_marginTop="8dp"
38-
android:textSize="13sp"
39-
tools:text="Ich ermächtige Lebensmittelmärkte snabble GmbH, einmalig eine Zahlung von meinem Konto mittels Lastschrift einzuziehen."/>
40-
41-
<Button style="@style/SnabbleButton"
32+
<ScrollView
4233
android:layout_width="match_parent"
43-
android:layout_height="wrap_content"
44-
android:layout_marginTop="24dp"
45-
android:id="@+id/button"
46-
android:text="@string/Snabble.Payment.SEPA.legalInfo.agree" />
34+
android:layout_height="match_parent"
35+
android:layout_marginTop="8dp">
36+
<TextView
37+
android:id="@+id/message"
38+
android:layout_width="wrap_content"
39+
android:layout_height="wrap_content"
40+
android:gravity="center"
41+
android:textSize="13sp"
42+
tools:text="Ich ermächtige Lebensmittelmärkte snabble GmbH, einmalig eine Zahlung von meinem Konto mittels Lastschrift einzuziehen."/>
43+
</ScrollView>
4744
</LinearLayout>
48-
</ScrollView>
45+
46+
<Button style="@style/SnabbleButton"
47+
android:layout_width="match_parent"
48+
android:layout_height="wrap_content"
49+
android:layout_marginTop="24dp"
50+
android:layout_gravity="bottom"
51+
android:id="@+id/button"
52+
android:text="@string/Snabble.Payment.SEPA.legalInfo.agree" />
53+
</FrameLayout>

0 commit comments

Comments
 (0)