Skip to content

Commit 97a2ead

Browse files
committed
added link to scanner in shopping cart
1 parent f025fc6 commit 97a2ead

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

build.gradle

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

2626
project.ext {
27-
sdkVersion='0.8.12'
27+
sdkVersion='0.8.13'
2828
versionCode=1
2929

3030
compileSdkVersion=28

ui/src/main/java/io/snabble/sdk/ui/cart/ShoppingCartView.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,17 @@ public void click() {
151151
}
152152
});
153153

154+
View scanProducts = findViewById(R.id.scan_products);
155+
scanProducts.setOnClickListener(new OnClickListener() {
156+
@Override
157+
public void onClick(View view) {
158+
SnabbleUICallback callback = SnabbleUI.getUiCallback();
159+
if (callback != null) {
160+
callback.showScannerWithCode(null);
161+
}
162+
}
163+
});
164+
154165
createItemTouchHelper();
155166

156167
SnabbleSdk sdkInstance = SnabbleUI.getSdkInstance();

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@
5454
android:layout_width="304dp"
5555
android:layout_height="wrap_content"
5656
android:gravity="center"
57+
android:layout_marginBottom="8dp"
5758
android:text="@string/Snabble.Shoppingcart.emptyState.description" />
59+
60+
<TextView
61+
android:id="@+id/scan_products"
62+
android:layout_width="wrap_content"
63+
android:layout_height="wrap_content"
64+
android:gravity="center"
65+
android:textColor="@color/snabble_textColorAction"
66+
android:textSize="15sp"
67+
android:padding="16dp"
68+
android:background="?attr/selectableItemBackground"
69+
android:text="@string/Snabble.Shoppingcart.emptyState.buttonTitle" />
5870
</LinearLayout>
5971
</FrameLayout>

0 commit comments

Comments
 (0)