mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 06:40:30 +05:30
Show currently applied playlist sort order
This commit is contained in:
parent
3396488ade
commit
a1b24d455a
@ -67,6 +67,7 @@ class PlaylistFragment : Fragment() {
|
|||||||
PreferenceHelper.putInt(PreferenceKeys.PLAYLIST_SORT_ORDER, value)
|
PreferenceHelper.putInt(PreferenceKeys.PLAYLIST_SORT_ORDER, value)
|
||||||
field = value
|
field = value
|
||||||
}
|
}
|
||||||
|
private val sortOptions by lazy { resources.getStringArray(R.array.playlistSortOptions) }
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
@ -215,13 +216,13 @@ class PlaylistFragment : Fragment() {
|
|||||||
keepQueue = true,
|
keepQueue = true,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
binding.sortMenu.isGone = false
|
binding.sortContainer.isGone = false
|
||||||
binding.sortMenu.setOnClickListener {
|
binding.sortTV.text = sortOptions[selectedSortOrder]
|
||||||
val sortOptions = resources.getStringArray(R.array.playlistSortOptions)
|
binding.sortContainer.setOnClickListener {
|
||||||
|
|
||||||
BaseBottomSheet().apply {
|
BaseBottomSheet().apply {
|
||||||
setSimpleItems(sortOptions.toList()) { index ->
|
setSimpleItems(sortOptions.toList()) { index ->
|
||||||
selectedSortOrder = index
|
selectedSortOrder = index
|
||||||
|
binding.sortTV.text = sortOptions[index]
|
||||||
showPlaylistVideos(response)
|
showPlaylistVideos(response)
|
||||||
}
|
}
|
||||||
}.show(childFragmentManager)
|
}.show(childFragmentManager)
|
||||||
|
@ -55,15 +55,31 @@
|
|||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/sortContainer"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:background="@drawable/rounded_ripple"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/sortTV"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
tools:text="@string/most_recent" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/sortMenu"
|
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginEnd="10dp"
|
android:src="@drawable/ic_sort" />
|
||||||
android:background="?selectableItemBackgroundBorderless"
|
|
||||||
android:src="@drawable/ic_sort"
|
</LinearLayout>
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/optionsMenu"
|
android:id="@+id/optionsMenu"
|
||||||
|
Loading…
Reference in New Issue
Block a user