Fixed overlapping app bar, news fragment removed

This commit is contained in:
Deniz Düzgören
2019-06-15 09:26:11 +02:00
parent e93683263d
commit d3f6a7f2d8
10 changed files with 8 additions and 313 deletions
@@ -275,14 +275,12 @@ class Main : AppCompatActivity(R.layout.activity_main) {
toolbarTxt.text = getString(R.string.foodmenu)
}
R.id.openinfopanel -> {
// if (bottomSheetBehaviour.state == BottomSheetBehavior.STATE_COLLAPSED) {
// bottomSheetBehaviour.state = BottomSheetBehavior.STATE_EXPANDED
// } else if (bottomSheetBehaviour.state == BottomSheetBehavior.STATE_EXPANDED) {
// bottomSheetBehaviour.state = BottomSheetBehavior.STATE_COLLAPSED
// }
// fragmentLoading = false
fragment = NewsFragment()
toolbarTxt.text = getString(R.string.news)
if (bottomSheetBehaviour.state == BottomSheetBehavior.STATE_COLLAPSED) {
bottomSheetBehaviour.state = BottomSheetBehavior.STATE_EXPANDED
} else if (bottomSheetBehaviour.state == BottomSheetBehavior.STATE_EXPANDED) {
bottomSheetBehaviour.state = BottomSheetBehavior.STATE_COLLAPSED
}
fragmentLoading = false
}
R.id.settings -> {
fragment = SettingsFragment()
@@ -318,15 +316,6 @@ class Main : AppCompatActivity(R.layout.activity_main) {
}
} catch (e: NullPointerException) {}
}
R.id.openinfopanel -> {
try {
val nsvnewscard = findViewById<NestedScrollView>(R.id.nsvnewscard)
nsvnewscard.post {
nsvnewscard.smoothScrollTo(0, 0)
bottomSheetBehaviour.state = BottomSheetBehavior.STATE_COLLAPSED
}
} catch (e: NullPointerException) {}
}
R.id.settings -> {
try {
val nsv = findViewById<NestedScrollView>(R.id.nsvsettings)