mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
Merge pull request #3907 from Bnyro/master
Show currently applied playlist sort order
This commit is contained in:
commit
cc430d9507
@ -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" />
|
||||||
|
|
||||||
<ImageView
|
<LinearLayout
|
||||||
android:id="@+id/sortMenu"
|
android:id="@+id/sortContainer"
|
||||||
android:layout_width="20dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="20dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:background="?selectableItemBackgroundBorderless"
|
android:padding="5dp"
|
||||||
android:src="@drawable/ic_sort"
|
android:background="@drawable/rounded_ripple"
|
||||||
android:visibility="gone" />
|
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
|
<ImageView
|
||||||
android:id="@+id/optionsMenu"
|
android:id="@+id/optionsMenu"
|
||||||
|
Loading…
Reference in New Issue
Block a user