diff options
author | Torsten Grote <t@grobox.de> | 2020-02-21 13:52:10 -0300 |
---|---|---|
committer | Torsten Grote <t@grobox.de> | 2020-02-21 13:52:10 -0300 |
commit | 9b07cda04a02f5e8f685feb505db251006fd45fd (patch) | |
tree | b8a4e2d5dda19ee6a5dd3b9af7519f24ebf635e7 /app/src/main/java | |
parent | 5522993ea436e1fb0eaec98b412fc97203bfd899 (diff) | |
download | wallet-android-9b07cda04a02f5e8f685feb505db251006fd45fd.tar.gz wallet-android-9b07cda04a02f5e8f685feb505db251006fd45fd.tar.bz2 wallet-android-9b07cda04a02f5e8f685feb505db251006fd45fd.zip |
Fix nav drawer item selection and other minor issues
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/net/taler/wallet/MainActivity.kt | 21 | ||||
-rw-r--r-- | app/src/main/java/net/taler/wallet/WalletViewModel.kt | 6 |
2 files changed, 9 insertions, 18 deletions
diff --git a/app/src/main/java/net/taler/wallet/MainActivity.kt b/app/src/main/java/net/taler/wallet/MainActivity.kt index b2e716e..299fbfe 100644 --- a/app/src/main/java/net/taler/wallet/MainActivity.kt +++ b/app/src/main/java/net/taler/wallet/MainActivity.kt @@ -22,7 +22,6 @@ import android.content.Intent import android.content.IntentFilter import android.os.Bundle import android.util.Log -import android.view.Menu import android.view.MenuItem import android.view.View.INVISIBLE import android.view.View.VISIBLE @@ -71,7 +70,9 @@ class MainActivity : AppCompatActivity(), OnNavigationItemSelectedListener, nav_view.menu.getItem(0).isChecked = true } - val appBarConfiguration = AppBarConfiguration(nav.graph, drawer_layout) + val appBarConfiguration = AppBarConfiguration( + setOf(R.id.showBalance, R.id.settings, R.id.walletHistory), drawer_layout + ) toolbar.setupWithNavController(nav, appBarConfiguration) model.init() @@ -140,22 +141,6 @@ class MainActivity : AppCompatActivity(), OnNavigationItemSelectedListener, } } - override fun onCreateOptionsMenu(menu: Menu): Boolean { - // Inflate the menu; this adds items to the action bar if it is present. - //menuInflater.inflate(R.menu.main, menu) - return false - } - - override fun onOptionsItemSelected(item: MenuItem): Boolean { - // Handle action bar item clicks here. The action bar will - // automatically handle clicks on the Home/Up button, so long - // as you specify a parent activity in AndroidManifest.xml. - return when (item.itemId) { - R.id.action_settings -> true - else -> super.onOptionsItemSelected(item) - } - } - override fun onNavigationItemSelected(item: MenuItem): Boolean { // Handle navigation view item clicks here. when (item.itemId) { diff --git a/app/src/main/java/net/taler/wallet/WalletViewModel.kt b/app/src/main/java/net/taler/wallet/WalletViewModel.kt index b30ed7e..2942805 100644 --- a/app/src/main/java/net/taler/wallet/WalletViewModel.kt +++ b/app/src/main/java/net/taler/wallet/WalletViewModel.kt @@ -259,9 +259,12 @@ class WalletViewModel(val app: Application) : AndroidViewModel(app) { walletBackendApi.sendRequest("getWithdrawDetailsForUri", args) { isError, result -> if (isError) { + Log.e(TAG, "Error getWithdrawDetailsForUri ${result.toString(4)}") return@sendRequest } if (myWithdrawRequestId != this.currentWithdrawRequestId) { + val mismatch = "$myWithdrawRequestId != ${this.currentWithdrawRequestId}" + Log.w(TAG, "Got withdraw result for different request id $mismatch") return@sendRequest } Log.v(TAG, "got getWithdrawDetailsForUri result") @@ -288,9 +291,12 @@ class WalletViewModel(val app: Application) : AndroidViewModel(app) { walletBackendApi.sendRequest("getWithdrawDetailsForUri", args) { isError, result -> if (isError) { + Log.e(TAG, "Error getWithdrawDetailsForUri ${result.toString(4)}") return@sendRequest } if (myWithdrawRequestId != this.currentWithdrawRequestId) { + val mismatch = "$myWithdrawRequestId != ${this.currentWithdrawRequestId}" + Log.w(TAG, "Got withdraw result for different request id $mismatch") return@sendRequest } Log.v(TAG, "got getWithdrawDetailsForUri result (with exchange details)") |