import net.ktnx.mobileledger.ui.transaction_list.TransactionListFragment;
import net.ktnx.mobileledger.ui.transaction_list.TransactionListViewModel;
import net.ktnx.mobileledger.utils.Colors;
+import net.ktnx.mobileledger.utils.GetOptCallback;
import net.ktnx.mobileledger.utils.LockHolder;
import net.ktnx.mobileledger.utils.MLDB;
super.onDestroy();
}
@Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- debug("flow", "MainActivity.onCreate()");
+ protected void setupProfileColors() {
int profileColor = Data.retrieveCurrentThemeIdFromDb();
Colors.setupTheme(this, profileColor);
Colors.profileThemeId = profileColor;
+ }
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ debug("flow", "MainActivity.onCreate()");
setContentView(R.layout.activity_main);
fab = findViewById(R.id.btn_add_transaction);
scheduleDataRetrievalIfStale(newValue);
}
private void profileThemeChanged() {
- setupProfileColors();
-
Bundle bundle = new Bundle();
onSaveInstanceState(bundle);
// restart activity to reflect theme change
startActivity(intent, args);
}
private void setupProfile() {
- String profileUUID = MLDB.getOption(MLDB.OPT_PROFILE_UUID, null);
- MobileLedgerProfile startupProfile;
+ MLDB.getOption(MLDB.OPT_PROFILE_UUID, null, new GetOptCallback(){
+ @Override
+ protected void onResult(String profileUUID) {
+ MobileLedgerProfile startupProfile;
- startupProfile = Data.getProfile(profileUUID);
- Data.setCurrentProfile(startupProfile);
+ startupProfile = Data.getProfile(profileUUID);
+ Data.setCurrentProfile(startupProfile);
+ }
+ });
}
public void fabNewTransactionClicked(View view) {
Intent intent = new Intent(this, NewTransactionActivity.class);