Archived
Unfinished news fragment, will probably be deleted
This commit is contained in:
@@ -31,6 +31,7 @@ import androidx.core.content.ContextCompat
|
||||
import androidx.core.widget.NestedScrollView
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
@@ -128,9 +129,7 @@ class Main : AppCompatActivity(R.layout.activity_main) {
|
||||
bottomSheetCloser.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSlide(bottomSheet: View, slideOffset: Float) {
|
||||
}
|
||||
override fun onSlide(bottomSheet: View, slideOffset: Float) {}
|
||||
})
|
||||
|
||||
bottomSheetCloser.setOnClickListener {
|
||||
@@ -276,12 +275,14 @@ 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
|
||||
// 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)
|
||||
}
|
||||
R.id.settings -> {
|
||||
fragment = SettingsFragment()
|
||||
@@ -317,6 +318,15 @@ 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)
|
||||
|
||||
Reference in New Issue
Block a user