[Homework/UI] Make better gaining attention on FAB

This commit is contained in:
Kacper Ziubryniewicz 2019-09-29 12:44:20 +02:00
parent 54b56768c1
commit 8d86f9c7af
2 changed files with 10 additions and 4 deletions

View File

@ -755,7 +755,7 @@ class MainActivity : AppCompatActivity() {
drawer.setSelection(target.id, fireOnClick = false)
navView.toolbar.setTitle(target.title ?: target.name)
navView.bottomBar.fabEnable = false
navView.bottomBar.fabExtended = true
navView.bottomBar.fabExtended = false
navView.bottomBar.setFabOnClickListener(null)
Log.d("NavDebug", "Navigating from ${navTarget.fragmentClass?.java?.simpleName} to ${target.fragmentClass?.java?.simpleName}")
@ -868,10 +868,16 @@ class MainActivity : AppCompatActivity() {
}, 2000)
}
fun collapseFab() {
fun gainAttentionFAB() {
navView.bottomBar.fabExtended = false
b.navView.postDelayed({
navView.bottomBar.fabExtended = true
}, 1000)
b.navView.postDelayed({
navView.bottomBar.fabExtended = false
}, 2000)
}, 3000)
}
/* _____ _ _

View File

@ -101,6 +101,6 @@ class HomeworkFragment : Fragment() {
})
activity.gainAttention()
activity.collapseFab()
activity.gainAttentionFAB()
}
}