X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Factivity%2FNewTransactionActivity.java;h=89362d777b699780a508fe169a1b5045b2f5d9b2;hp=d506ac35ab994f65397c3317779bd2a8e481ff9a;hb=3836149c3d9253d6298adddcc6d091f65d98d349;hpb=45bfb602b93fc706a05dddf8f7074caef6ea02d0 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 d506ac35..89362d77 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 @@ -24,7 +24,7 @@ import android.view.MenuItem; import android.view.View; import androidx.appcompat.widget.Toolbar; -import androidx.lifecycle.ViewModelProviders; +import androidx.lifecycle.ViewModelProvider; import androidx.navigation.NavController; import androidx.navigation.Navigation; @@ -39,13 +39,6 @@ import java.util.Objects; import static net.ktnx.mobileledger.utils.Logger.debug; -/* - * TODO: nicer progress while transaction is submitted - * TODO: reports - * TODO: get rid of the custom session/cookie and auth code? - * (the last problem with the POST was the missing content-length header) - * */ - public class NewTransactionActivity extends ProfileThemedActivity implements TaskCallback, NewTransactionFragment.OnNewTransactionFragmentInteractionListener { private NavController navController; @@ -65,8 +58,7 @@ public class NewTransactionActivity extends ProfileThemedActivity implements Tas Objects.requireNonNull(getSupportActionBar()) .setDisplayHomeAsUpEnabled(true); - model = ViewModelProviders.of(this) - .get(NewTransactionModel.class); + model = new ViewModelProvider(this).get(NewTransactionModel.class); } @Override protected void initProfile() { @@ -94,12 +86,6 @@ public class NewTransactionActivity extends ProfileThemedActivity implements Tas } return super.onOptionsItemSelected(item); } - - @Override - protected void onStart() { - super.onStart(); - // FIXME if (tvDescription.getText().toString().isEmpty()) tvDescription.requestFocus(); - } public void onTransactionSave(LedgerTransaction tr) { navController.navigate(R.id.action_newTransactionFragment_to_newTransactionSavingFragment); try {