Skip to content

Commit 6781e40

Browse files
committed
restore payment credentials list empty state
1 parent f2c63fa commit 6781e40

File tree

4 files changed

+8
-24
lines changed

4 files changed

+8
-24
lines changed

CHANGELOG.md

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

4+
## [0.12.0-beta7]
5+
6+
### Fixed
7+
- Restored payment credentials list empty state
8+
49
## [0.12.0-beta6]
510

611
### Fixed

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-beta6'
26+
sdkVersion='0.12.0-beta7'
2727
versionCode=1
2828

2929
compileSdkVersion=28

ui/src/main/java/io/snabble/sdk/ui/payment/PaymentCredentialsListView.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,7 @@ public int getItemViewType(int position) {
162162
public void onBindViewHolder(final RecyclerView.ViewHolder holder, final int position) {
163163
int type = getItemViewType(position);
164164

165-
if(type == TYPE_EMPTYSTATE) {
166-
EmptyStateViewHolder vh = (EmptyStateViewHolder)holder;
167-
vh.add.setOnClickListener(new OneShotClickListener() {
168-
@Override
169-
public void click() {
170-
SnabbleUICallback callback = SnabbleUI.getUiCallback();
171-
if (callback != null) {
172-
callback.showSEPACardInput();
173-
}
174-
}
175-
});
176-
} else if(type == TYPE_ENTRY){
165+
if(type == TYPE_ENTRY){
177166
EntryViewHolder vh = (EntryViewHolder)holder;
178167
final Entry e = entries.get(position);
179168

@@ -200,7 +189,7 @@ public void onClick(DialogInterface dialog, int which) {
200189

201190
@Override
202191
public int getItemCount() {
203-
return entries.size();
192+
return Math.max(1, entries.size());
204193
}
205194
}
206195

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,5 @@
2323
android:padding="16dp"
2424
android:gravity="center"
2525
android:text="@string/Snabble.Payment.emptyState.message" />
26-
27-
<Button
28-
style="@style/SnabbleButton"
29-
android:id="@+id/add"
30-
android:layout_width="wrap_content"
31-
android:layout_height="wrap_content"
32-
android:layout_gravity="center_horizontal"
33-
android:padding="16dp"
34-
android:gravity="center"
35-
android:text="@string/Snabble.Payment.emptyState.add" />
3626
</LinearLayout>
3727
</FrameLayout>

0 commit comments

Comments
 (0)