Skip to content

Commit f132383

Browse files
committed
feat: small expressive design improvements in playlist fragment
1 parent 3202aca commit f132383

2 files changed

Lines changed: 53 additions & 54 deletions

File tree

app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,21 +247,21 @@ class PlaylistFragment : DynamicLayoutManagerFragment(R.layout.fragment_playlist
247247
}
248248

249249
if (playlistFeed.isEmpty()) {
250-
binding.sortContainer.isGone = true
250+
binding.sortBTN.isGone = true
251251
} else {
252-
binding.sortContainer.isVisible = true
253-
binding.sortContainer.setOnClickListener {
252+
binding.sortBTN.isVisible = true
253+
binding.sortBTN.setOnClickListener {
254254
BaseBottomSheet().apply {
255255
setSimpleItems(sortOptions.toList()) { index ->
256256
selectedSortOrder = index
257-
binding.sortTV.text = sortOptions[index]
257+
binding.sortBTN.text = sortOptions[index]
258258
showPlaylistVideos(response)
259259
}
260260
}.show(childFragmentManager)
261261
}
262262
}
263263

264-
binding.sortTV.text = sortOptions[selectedSortOrder]
264+
binding.sortBTN.text = sortOptions[selectedSortOrder]
265265

266266
}
267267

app/src/main/res/layout/fragment_playlist.xml

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -85,62 +85,62 @@
8585
android:layout_marginTop="8dp"
8686
android:orientation="horizontal">
8787

88-
<com.github.libretube.ui.views.ExpandableTextView
89-
android:id="@+id/playlist_name"
88+
<LinearLayout
9089
android:layout_width="0dp"
91-
android:layout_height="wrap_content"
92-
android:layout_marginStart="10dp"
9390
android:layout_weight="1"
94-
android:paddingHorizontal="5dp"
95-
android:paddingVertical="2dp"
96-
android:textSize="20sp"
97-
android:textStyle="bold" />
91+
android:layout_height="wrap_content"
92+
android:orientation="vertical"
93+
android:layout_marginHorizontal="10dp">
9894

99-
<LinearLayout
100-
android:id="@+id/sortContainer"
95+
<com.github.libretube.ui.views.ExpandableTextView
96+
android:id="@+id/playlist_name"
97+
android:layout_width="match_parent"
98+
android:layout_height="wrap_content"
99+
android:paddingHorizontal="5dp"
100+
android:paddingVertical="2dp"
101+
android:textSize="20sp"
102+
android:textStyle="bold" />
103+
104+
<TextView
105+
android:id="@+id/playlistInfo"
106+
android:layout_width="match_parent"
107+
android:layout_height="wrap_content"
108+
android:paddingHorizontal="5dp"
109+
android:textStyle="bold" />
110+
111+
</LinearLayout>
112+
113+
<com.google.android.material.button.MaterialButtonGroup
114+
style="@style/Widget.Material3.MaterialSplitButton"
101115
android:layout_width="wrap_content"
102116
android:layout_height="wrap_content"
103-
android:layout_gravity="center"
104-
android:layout_marginEnd="8dp"
105-
android:background="@drawable/rounded_ripple"
106-
android:padding="5dp"
107-
android:visibility="gone"
108-
tools:visibility="visible">
117+
android:paddingTop="0dp"
118+
android:paddingBottom="0dp"
119+
android:gravity="center">
109120

110-
<TextView
111-
android:id="@+id/sortTV"
121+
<com.google.android.material.button.MaterialButton
122+
style="?materialButtonTonalStyle"
123+
android:id="@+id/sortBTN"
124+
android:layout_width="wrap_content"
125+
android:layout_height="wrap_content"
126+
app:icon="@drawable/ic_sort"
127+
app:iconGravity="textEnd"
128+
android:visibility="gone"
129+
tools:text="@string/most_recent"
130+
tools:visibility="visible" />
131+
132+
<com.google.android.material.button.MaterialButton
133+
style="?materialIconButtonFilledTonalStyle"
134+
android:id="@+id/optionsMenu"
112135
android:layout_width="wrap_content"
113136
android:layout_height="wrap_content"
114-
android:layout_marginEnd="5dp"
115-
tools:text="@string/most_recent" />
116-
117-
<ImageView
118-
android:layout_width="20dp"
119-
android:layout_height="20dp"
120137
android:layout_gravity="center"
121-
android:src="@drawable/ic_sort" />
138+
app:icon="@drawable/ic_three_dots" />
122139

123-
</LinearLayout>
124-
125-
<ImageView
126-
android:id="@+id/optionsMenu"
127-
android:layout_width="20dp"
128-
android:layout_height="20dp"
129-
android:layout_gravity="center"
130-
android:layout_marginEnd="20dp"
131-
android:background="?selectableItemBackgroundBorderless"
132-
android:src="@drawable/ic_three_dots" />
140+
</com.google.android.material.button.MaterialButtonGroup>
133141

134142
</LinearLayout>
135143

136-
<TextView
137-
android:id="@+id/playlistInfo"
138-
android:layout_width="match_parent"
139-
android:layout_height="wrap_content"
140-
android:paddingHorizontal="15dp"
141-
android:paddingBottom="5dp"
142-
android:textStyle="bold" />
143-
144144
<com.github.libretube.ui.views.ExpandableTextView
145145
android:id="@+id/playlistDescription"
146146
android:layout_width="match_parent"
@@ -150,18 +150,18 @@
150150
android:paddingTop="5dp"
151151
android:paddingBottom="10dp" />
152152

153-
<LinearLayout
153+
<com.google.android.material.button.MaterialButtonGroup
154154
android:layout_width="match_parent"
155155
android:layout_height="wrap_content"
156-
android:layout_marginVertical="10dp"
157-
android:orientation="horizontal">
156+
android:layout_margin="10dp"
157+
android:orientation="horizontal"
158+
app:buttonSizeChange="@null">
158159

159160
<com.google.android.material.button.MaterialButton
160161
android:id="@+id/play_all"
161162
style="@style/Widget.Material3.Button.OutlinedButton"
162163
android:layout_width="0dp"
163164
android:layout_height="wrap_content"
164-
android:layout_marginHorizontal="10dp"
165165
android:layout_weight="1"
166166
android:maxLines="1"
167167
android:text="@string/play_all"
@@ -172,13 +172,12 @@
172172
style="@style/Widget.Material3.Button"
173173
android:layout_width="0dp"
174174
android:layout_height="wrap_content"
175-
android:layout_marginHorizontal="10dp"
176175
android:layout_weight="1"
177176
android:maxLines="1"
178177
android:text="@string/bookmark"
179178
app:icon="@drawable/ic_bookmark_outlined" />
180179

181-
</LinearLayout>
180+
</com.google.android.material.button.MaterialButtonGroup>
182181

183182
<LinearLayout
184183
android:id="@+id/nothing_here"

0 commit comments

Comments
 (0)