mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20: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)
|
||||
field = value
|
||||
}
|
||||
private val sortOptions by lazy { resources.getStringArray(R.array.playlistSortOptions) }
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@ -215,13 +216,13 @@ class PlaylistFragment : Fragment() {
|
||||
keepQueue = true,
|
||||
)
|
||||
}
|
||||
binding.sortMenu.isGone = false
|
||||
binding.sortMenu.setOnClickListener {
|
||||
val sortOptions = resources.getStringArray(R.array.playlistSortOptions)
|
||||
|
||||
binding.sortContainer.isGone = false
|
||||
binding.sortTV.text = sortOptions[selectedSortOrder]
|
||||
binding.sortContainer.setOnClickListener {
|
||||
BaseBottomSheet().apply {
|
||||
setSimpleItems(sortOptions.toList()) { index ->
|
||||
selectedSortOrder = index
|
||||
binding.sortTV.text = sortOptions[index]
|
||||
showPlaylistVideos(response)
|
||||
}
|
||||
}.show(childFragmentManager)
|
||||
|
@ -55,15 +55,31 @@
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sortMenu"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
<LinearLayout
|
||||
android:id="@+id/sortContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/ic_sort"
|
||||
android:visibility="gone" />
|
||||
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
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_sort" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/optionsMenu"
|
||||
|
Loading…
Reference in New Issue
Block a user