Skip to content

Commit 35e579f

Browse files
committed
Increased duration of all snackbar messages
1 parent c7cd9d8 commit 35e579f

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
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.9.0-beta2'
27+
sdkVersion='0.9.0-beta3'
2828
versionCode=1
2929

3030
compileSdkVersion=28

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public void onSwiped(final RecyclerView.ViewHolder viewHolder, int direction) {
220220
recyclerView.getAdapter().notifyItemRemoved(pos);
221221

222222
snackbar = UIUtils.snackbar(coordinatorLayout,
223-
R.string.Snabble_Shoppingcart_articleRemoved, 5000);
223+
R.string.Snabble_Shoppingcart_articleRemoved, UIUtils.SNACKBAR_LENGTH_VERY_LONG);
224224
snackbar.setAction(R.string.Snabble_undo, new OnClickListener() {
225225
@Override
226226
public void onClick(View v) {
@@ -247,7 +247,7 @@ public void onStateChanged(Checkout.State state) {
247247
}
248248
progressDialog.dismiss();
249249
} else if (state == Checkout.State.CONNECTION_ERROR) {
250-
UIUtils.snackbar(coordinatorLayout, R.string.Snabble_Payment_errorStarting, Snackbar.LENGTH_SHORT)
250+
UIUtils.snackbar(coordinatorLayout, R.string.Snabble_Payment_errorStarting, UIUtils.SNACKBAR_LENGTH_VERY_LONG)
251251
.show();
252252
progressDialog.dismiss();
253253
} else if (state != Checkout.State.VERIFYING_PAYMENT_METHOD) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void run() {
110110
displayView(new CheckoutAbortedView(getContext()));
111111
break;
112112
case CONNECTION_ERROR:
113-
UIUtils.snackbar(coordinatorLayout, R.string.Snabble_Payment_errorStarting, Snackbar.LENGTH_SHORT)
113+
UIUtils.snackbar(coordinatorLayout, R.string.Snabble_Payment_errorStarting, UIUtils.SNACKBAR_LENGTH_VERY_LONG)
114114
.show();
115115
break;
116116
case NONE:

ui/src/main/java/io/snabble/sdk/ui/scanner/SelfScanningView.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public void lookupAndShowProduct(final ScannableCode scannedCode) {
166166
Telemetry.event(Telemetry.Event.ScannedUnknownCode, scannedCode.getCode());
167167
UIUtils.snackbar(SelfScanningView.this,
168168
R.string.Snabble_Scanner_unknownBarcode,
169-
Snackbar.LENGTH_LONG)
169+
UIUtils.SNACKBAR_LENGTH_VERY_LONG)
170170
.show();
171171
return;
172172
}
@@ -241,7 +241,7 @@ private void handleProductAvailable(Product product, boolean wasOnlineProduct, S
241241
if (product.getType() == Product.Type.PreWeighed && !scannedCode.hasEmbeddedData()) {
242242
UIUtils.snackbar(SelfScanningView.this,
243243
R.string.Snabble_Scanner_scannedShelfCode,
244-
Snackbar.LENGTH_LONG)
244+
UIUtils.SNACKBAR_LENGTH_VERY_LONG)
245245
.show();
246246

247247
progressDialog.dismiss();
@@ -267,7 +267,7 @@ private void handleProductNotFound(ScannableCode scannedCode) {
267267
Telemetry.event(Telemetry.Event.ScannedUnknownCode, scannedCode.getCode());
268268
UIUtils.snackbar(SelfScanningView.this,
269269
R.string.Snabble_Scanner_unknownBarcode,
270-
Snackbar.LENGTH_LONG)
270+
UIUtils.SNACKBAR_LENGTH_VERY_LONG)
271271
.show();
272272
}
273273

@@ -278,7 +278,7 @@ private void handleProductError() {
278278

279279
UIUtils.snackbar(SelfScanningView.this,
280280
R.string.Snabble_Scanner_networkError,
281-
Snackbar.LENGTH_LONG)
281+
UIUtils.SNACKBAR_LENGTH_VERY_LONG)
282282
.show();
283283
}
284284

@@ -550,7 +550,7 @@ public void onStateChanged(Checkout.State state) {
550550

551551
UIUtils.snackbar(SelfScanningView.this,
552552
R.string.Snabble_Payment_errorStarting,
553-
Snackbar.LENGTH_LONG)
553+
UIUtils.SNACKBAR_LENGTH_VERY_LONG)
554554
.show();
555555
break;
556556
default:

ui/src/main/java/io/snabble/sdk/ui/utils/UIUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import android.widget.TextView;
1515

1616
public class UIUtils {
17+
public static final int SNACKBAR_LENGTH_VERY_LONG = 5000;
18+
1719
public static Snackbar snackbar(View view, @StringRes int stringResId, int duration) {
1820
Snackbar snackbar = Snackbar.make(view, stringResId, duration);
1921
fixTextColor(snackbar);

0 commit comments

Comments
 (0)