Skip to content

Commit 09529a4

Browse files
committed
use fab instead of add button for consistency
1 parent dee5a8e commit 09529a4

File tree

5 files changed

+26
-16
lines changed

5 files changed

+26
-16
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [0.12.0-beta5]
5+
6+
### Changes
7+
- Show network error on receipts list if receipt list could not be fetched
8+
- Use FloatingActionButton for payment list view
9+
- Unified ic_chevron and ic_chevron_right
10+
11+
### New string keys
12+
- Snabble.networkError
13+
414
## [0.12.0-beta4]
515

616
### Changes

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ allprojects {
2323
}
2424

2525
project.ext {
26-
sdkVersion='0.12.0-beta4'
26+
sdkVersion='0.12.0-beta5'
2727
versionCode=1
2828

2929
compileSdkVersion=28

ui/src/main/java/io/snabble/sdk/ui/receipts/ReceiptListView.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.snabble.sdk.ui.receipts;
22

33
import android.app.Activity;
4-
import android.app.Application;
54
import android.app.ProgressDialog;
65
import android.content.Context;
76
import android.content.DialogInterface;
@@ -13,17 +12,14 @@
1312
import android.view.LayoutInflater;
1413
import android.view.View;
1514
import android.view.ViewGroup;
16-
import android.widget.FrameLayout;
1715
import android.widget.TextView;
1816

1917
import java.io.File;
2018
import java.text.DateFormat;
21-
import java.util.ArrayList;
22-
import java.util.Date;
23-
import java.util.List;
2419

2520
import androidx.annotation.NonNull;
2621
import androidx.annotation.Nullable;
22+
import androidx.coordinatorlayout.widget.CoordinatorLayout;
2723
import androidx.core.content.FileProvider;
2824
import androidx.recyclerview.widget.DividerItemDecoration;
2925
import androidx.recyclerview.widget.LinearLayoutManager;
@@ -34,9 +30,8 @@
3430
import io.snabble.sdk.Snabble;
3531
import io.snabble.sdk.ui.R;
3632
import io.snabble.sdk.ui.utils.UIUtils;
37-
import io.snabble.sdk.utils.SimpleActivityLifecycleCallbacks;
3833

39-
public class ReceiptListView extends FrameLayout {
34+
public class ReceiptListView extends CoordinatorLayout {
4035
private ReceiptInfo[] receiptInfos;
4136
private RecyclerView recyclerView;
4237
private View emptyState;
@@ -99,10 +94,12 @@ public void success(ReceiptInfo[] newReceiptInfos) {
9994
public void failure() {
10095
swipeRefreshLayout.setRefreshing(false);
10196

102-
if (receiptInfos == null || receiptInfos.length == 0) {
97+
if (receiptInfos != null && receiptInfos.length == 0) {
10398
emptyState.setVisibility(View.VISIBLE);
10499
} else {
105100
emptyState.setVisibility(View.GONE);
101+
102+
UIUtils.snackbar(ReceiptListView.this, R.string.Snabble_networkError, UIUtils.SNACKBAR_LENGTH_VERY_LONG).show();
106103
}
107104
}
108105
});

ui/src/main/res/layout/view_receipt_list.xml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212

1313
</androidx.recyclerview.widget.RecyclerView>
1414

15-
<TextView android:layout_width="wrap_content"
16-
android:layout_height="wrap_content"
17-
android:layout_gravity="center"
18-
android:textSize="17sp"
19-
android:id="@+id/empty_state"
20-
android:visibility="gone"
21-
android:text="@string/Snabble.Receipt.noReceipt"/>
15+
2216
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
17+
18+
<TextView android:layout_width="wrap_content"
19+
android:layout_height="wrap_content"
20+
android:layout_gravity="center"
21+
android:textSize="17sp"
22+
android:id="@+id/empty_state"
23+
android:visibility="gone"
24+
android:text="@string/Snabble.Receipt.noReceipt"/>
2325
</merge>

ui/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
<string name="Snabble.Checkout.done">Finished!</string>
8383
<string name="Snabble.Checkout.payAtCashRegister">Pay at cash register</string>
8484
<string name="Snabble.Checkout.error">An error has occurred</string>
85+
<string name="Snabble.networkError">Connection error</string>
8586

8687
<!-- SECTION: Android -->
8788
<string name="Snabble.askForPermission">Ask for permission</string>

0 commit comments

Comments
 (0)