From 7755b258b49a61b6c1064a462a31b620e02071a9 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sat, 30 Nov 2019 12:54:01 +0200 Subject: [PATCH] NT: add simulation watermark when simulation is enabled --- .../ui/activity/NewTransactionActivity.java | 8 +++++-- .../res/layout/activity_new_transaction.xml | 22 ++++++++++++++++++- app/src/main/res/values-bg/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java index 660be197..1317c438 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java @@ -22,6 +22,7 @@ import android.os.Bundle; import android.util.TypedValue; import android.view.Menu; import android.view.MenuItem; +import android.view.View; import androidx.appcompat.widget.Toolbar; import androidx.lifecycle.ViewModelProviders; @@ -131,8 +132,11 @@ public class NewTransactionActivity extends ProfileThemedActivity implements Tas .setVisible(true); } - model.observeSimulateSave(this, state -> menu.findItem(R.id.action_simulate_save) - .setChecked(state)); + model.observeSimulateSave(this, state -> { + menu.findItem(R.id.action_simulate_save) + .setChecked(state); + findViewById(R.id.simulationLabel).setVisibility(state ? View.VISIBLE : View.GONE); + }); return true; } diff --git a/app/src/main/res/layout/activity_new_transaction.xml b/app/src/main/res/layout/activity_new_transaction.xml index 6913a770..bb5eb3ad 100644 --- a/app/src/main/res/layout/activity_new_transaction.xml +++ b/app/src/main/res/layout/activity_new_transaction.xml @@ -24,7 +24,8 @@ + android:layout_height="match_parent" + android:animateLayoutChanges="true"> + + \ No newline at end of file diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index ac1c330d..7b5fd600 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -116,5 +116,6 @@ Запазване… Симулиране на заявките за съхраняване Симул. съхр. + СИМУЛАЦИЯ diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2c663bd9..2f8f643c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -158,4 +158,5 @@ Saving… Simulate save requests Simul. save + SIMULATION -- 2.39.5