package net.ktnx.mobileledger.ui.activity;
-import android.os.AsyncTask;
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;
.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;
}
model.toggleSimulateSave();
}
- private class AsyncCrasher extends AsyncTask<Void, Void, Void> {
- @Override
- protected Void doInBackground(Void... voids) {
- throw new RuntimeException("Simulated crash");
- }
- }
-
}