animate lock and eye icons in action bar (top)
Auto Tag on Version Change / check-version (push) Successful in 3s
Auto Tag on Version Change / check-version (push) Successful in 3s
This commit is contained in:
@@ -427,14 +427,24 @@ fun applyNavLabelVisibility() {
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
if (item.itemId == R.id.action_lock) {
|
||||
lock()
|
||||
val avd = getDrawable(R.drawable.avd_lock) as? android.graphics.drawable.AnimatedVectorDrawable
|
||||
if (avd != null) {
|
||||
item.icon = avd
|
||||
avd.start()
|
||||
Handler(Looper.getMainLooper()).postDelayed({ lock() }, 200)
|
||||
} else {
|
||||
lock()
|
||||
}
|
||||
return true
|
||||
}
|
||||
if (item.itemId == R.id.action_hide_amounts) {
|
||||
val newHidden = !(viewModel.hideAmounts.value ?: false)
|
||||
viewModel.hideAmounts.value = newHidden
|
||||
getSharedPreferences("prefs", MODE_PRIVATE).edit().putBoolean("hide_amounts", newHidden).apply()
|
||||
invalidateOptionsMenu()
|
||||
val avd = getDrawable(if (newHidden) R.drawable.avd_hide_amounts else R.drawable.avd_show_amounts)
|
||||
as? android.graphics.drawable.AnimatedVectorDrawable
|
||||
item.icon = avd
|
||||
avd?.start()
|
||||
return true
|
||||
}
|
||||
return super.onOptionsItemSelected(item)
|
||||
|
||||
Reference in New Issue
Block a user