Fixed minor bugs and improved Chip UI

This commit is contained in:
Bnyro 2022-10-29 12:16:48 +02:00
parent 18eebe663b
commit 8119462cb7
2 changed files with 8 additions and 3 deletions

View File

@ -216,7 +216,7 @@ class ChannelFragment : BaseFragment() {
chip.visibility = View.VISIBLE
chip.setOnClickListener {
binding.tabChips.children.forEach {
if (it != chip) it.isSelected = false
if (it != chip) (it as Chip).isChecked = false
}
scope.launch {
val response = try {
@ -243,7 +243,11 @@ class ChannelFragment : BaseFragment() {
e.printStackTrace()
null
}
newContent?.content?.let { adapter.updateItems(it) }
runOnUiThread {
newContent?.content?.let {
adapter.updateItems(it)
}
}
}
}
}

View File

@ -116,19 +116,20 @@
android:padding="10dp" />
<HorizontalScrollView
android:id="@+id/tab_chips"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="10dp"
android:scrollbars="none">
<com.google.android.material.chip.ChipGroup
android:id="@+id/tab_chips"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.google.android.material.chip.Chip
android:id="@+id/videos"
style="@style/channelChip"
android:checked="true"
android:text="@string/videos"
android:visibility="visible" />