mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Remove: Layout's categories recycler
This commit is contained in:
parent
cb93e62544
commit
466af7faa5
@ -52,35 +52,6 @@ class ExploreFragment : MainNavFragmentX() {
|
||||
redrawPage(it)
|
||||
}
|
||||
viewModel.categories.observe(viewLifecycleOwner) {
|
||||
binding.categories.apply {
|
||||
removeAllViews()
|
||||
addView(Chip(requireContext(), null, R.attr.categoryChipStyle).apply {
|
||||
setText(R.string.all_applications)
|
||||
id = R.id.SHOW_ALL
|
||||
})
|
||||
it.sorted().forEach {
|
||||
addView(Chip(requireContext(), null, R.attr.categoryChipStyle).apply {
|
||||
text = it
|
||||
})
|
||||
}
|
||||
val selectedSection = viewModel.sections.value
|
||||
check(
|
||||
children.filterNotNull()
|
||||
.find { child ->
|
||||
child is Chip && selectedSection is Category && child.text == selectedSection.label
|
||||
}?.id ?: R.id.SHOW_ALL
|
||||
)
|
||||
}
|
||||
}
|
||||
binding.categories.setOnCheckedStateChangeListener { group, checkedIds ->
|
||||
group.findViewById<Chip>(checkedIds[0]).let {
|
||||
viewModel.setSection(
|
||||
if (it.text.equals(getString(R.string.all_applications)))
|
||||
Section.All
|
||||
else
|
||||
Section.Category(it.text.toString())
|
||||
)
|
||||
}
|
||||
}
|
||||
mainActivityX.menuSetup.observe(viewLifecycleOwner) {
|
||||
if (it != null) {
|
||||
|
@ -15,8 +15,7 @@
|
||||
~ You should have received a copy of the GNU Affero General Public License
|
||||
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
@ -26,33 +25,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:nestedScrollingEnabled="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="none">
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/categories"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:nestedScrollingEnabled="true"
|
||||
android:paddingHorizontal="@dimen/shape_margin_medium"
|
||||
app:selectionRequired="true"
|
||||
app:singleSelection="true" />
|
||||
</HorizontalScrollView>
|
||||
|
||||
<androidx.compose.ui.platform.ComposeView
|
||||
android:id="@+id/primaryComposeRecycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
android:layout_height="match_parent" />
|
||||
</com.google.android.material.circularreveal.CircularRevealFrameLayout>
|
||||
</layout>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user