mirror of
https://github.com/recloudstream/cloudstream.git
synced 2026-06-19 20:05:41 +00:00
Compare commits
1 commit
master
...
navrailtes
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
693f69f25f |
3 changed files with 36 additions and 3 deletions
|
|
@ -1709,6 +1709,35 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val rail = binding?.navRailView
|
||||||
|
if (rail != null && isLayout(TV)) {
|
||||||
|
val focus = mutableSetOf<Int>()
|
||||||
|
for (id in arrayOf(
|
||||||
|
R.id.navigation_home,
|
||||||
|
R.id.navigation_library,
|
||||||
|
R.id.navigation_search,
|
||||||
|
R.id.navigation_downloads,
|
||||||
|
R.id.navigation_settings
|
||||||
|
)) {
|
||||||
|
rail.findViewById<View?>(id)?.onFocusChangeListener =
|
||||||
|
View.OnFocusChangeListener { v, hasFocus ->
|
||||||
|
if (hasFocus) {
|
||||||
|
focus += id
|
||||||
|
binding?.navRailView?.labelVisibilityMode = NavigationRailView.LABEL_VISIBILITY_LABELED
|
||||||
|
binding?.navRailView?.expand()
|
||||||
|
} else {
|
||||||
|
focus -= id
|
||||||
|
v.post {
|
||||||
|
if(focus.isEmpty()) {
|
||||||
|
binding?.navRailView?.labelVisibilityMode = NavigationRailView.LABEL_VISIBILITY_UNLABELED
|
||||||
|
binding?.navRailView?.collapse()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Navigation button long click functionality to scroll to top
|
// Navigation button long click functionality to scroll to top
|
||||||
for (view in listOf(binding?.navView, binding?.navRailView)) {
|
for (view in listOf(binding?.navView, binding?.navRailView)) {
|
||||||
view?.findViewById<View?>(R.id.navigation_home)?.setOnLongClickListener {
|
view?.findViewById<View?>(R.id.navigation_home)?.setOnLongClickListener {
|
||||||
|
|
|
||||||
|
|
@ -25,14 +25,18 @@
|
||||||
|
|
||||||
<com.google.android.material.navigationrail.NavigationRailView
|
<com.google.android.material.navigationrail.NavigationRailView
|
||||||
android:id="@+id/nav_rail_view"
|
android:id="@+id/nav_rail_view"
|
||||||
android:layout_width="62dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:minWidth="62dp"
|
||||||
|
android:maxWidth="62dp"
|
||||||
|
app:expanded="false"
|
||||||
|
app:expandedMaxWidth="180dp"
|
||||||
app:itemIconTint="@color/item_select_color"
|
app:itemIconTint="@color/item_select_color"
|
||||||
app:itemTextColor="@color/item_select_color"
|
app:itemTextColor="@color/item_select_color"
|
||||||
android:background="?attr/primaryGrayBackground"
|
android:background="?attr/primaryGrayBackground"
|
||||||
android:descendantFocusability="afterDescendants"
|
android:descendantFocusability="afterDescendants"
|
||||||
app:headerLayout="@layout/rail_header"
|
app:headerLayout="@layout/rail_header"
|
||||||
app:labelVisibilityMode="unlabeled"
|
app:labelVisibilityMode="labeled"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:menu="@menu/bottom_nav_menu"
|
app:menu="@menu/bottom_nav_menu"
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ kotlinGradlePluginVersion = "2.1.10"
|
||||||
kotlinxCoroutinesCore = "1.10.1"
|
kotlinxCoroutinesCore = "1.10.1"
|
||||||
lifecycleLivedataKtx = "2.8.7"
|
lifecycleLivedataKtx = "2.8.7"
|
||||||
lifecycleViewmodelKtx = "2.8.7"
|
lifecycleViewmodelKtx = "2.8.7"
|
||||||
material = "1.12.0"
|
material = "1.14.0-alpha04"
|
||||||
media3 = "1.6.1"
|
media3 = "1.6.1"
|
||||||
navigationKtx = "2.8.9"
|
navigationKtx = "2.8.9"
|
||||||
newpipeextractor = "v0.24.6"
|
newpipeextractor = "v0.24.6"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue