Skip to content

Commit

Permalink
Merge pull request #471 from Reco1I/filters
Browse files Browse the repository at this point in the history
Introduce beatmap listing filters
  • Loading branch information
Rian8337 authored Dec 17, 2024
2 parents f01d848 + b1dfb26 commit 3c4d41a
Show file tree
Hide file tree
Showing 10 changed files with 485 additions and 47 deletions.
95 changes: 95 additions & 0 deletions res/layout/beatmap_downloader_filters.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/frg_background"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:id="@+id/frg_body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="#212133"
android:orientation="horizontal"
android:padding="8dp">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFF"
android:alpha="0.75"
android:padding="6dp"
android:text="Sort by" />

<Button
android:id="@+id/sort"
style="@style/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="4dp"
android:maxHeight="48dp"
android:drawableRight="@drawable/arrow_drop_down_24px"
android:text="Ranked status" />

</LinearLayout>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:orientation="horizontal">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.75"
android:textColor="#FFF"
android:padding="6dp"
android:text="Order" />

<Button
android:id="@+id/order"
style="@style/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxHeight="48dp"
android:text="Ascendent" />

</LinearLayout>

<LinearLayout
android:layout_width="wrap_content"
android:layout_marginLeft="8dp"
android:layout_height="wrap_content"
android:orientation="horizontal">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.75"
android:textColor="#FFF"
android:padding="6dp"
android:text="Status" />

<Button
android:id="@+id/status"
style="@style/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="4dp"
android:maxHeight="48dp"
android:drawableRight="@drawable/arrow_drop_down_24px"
android:text="Ranked" />

</LinearLayout>

</LinearLayout>

</RelativeLayout>
56 changes: 40 additions & 16 deletions res/layout/beatmap_downloader_fragment.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
Expand All @@ -10,6 +10,7 @@
android:orientation="vertical">

<RelativeLayout
android:id="@+id/bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#1E1E2E">
Expand All @@ -30,9 +31,10 @@
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginHorizontal="6dp"
android:layout_toLeftOf="@id/refresh"
android:layout_toRightOf="@id/indicator"
android:background="@drawable/rounded_rect"
android:layout_toRightOf="@id/close"
android:layout_toLeftOf="@id/indicator"
android:backgroundTint="#363653"
android:drawableRight="@drawable/search_24px"
android:drawableTint="#8C8CB4"
Expand All @@ -50,14 +52,15 @@
style="@style/button_borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:drawableRight="@drawable/arrow_drop_down_24px"
android:layout_marginHorizontal="12dp"
android:maxHeight="36dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="12dp"
android:layout_toLeftOf="@id/logo"
android:drawableLeft="@drawable/osudirect"
android:drawableRight="@drawable/arrow_drop_down_24px"
android:drawablePadding="8dp"
android:gravity="center"
android:maxHeight="36dp"
android:paddingVertical="16dp"
android:paddingLeft="16dp"
android:paddingRight="2dp"
Expand All @@ -69,9 +72,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="12dp"
android:layout_toLeftOf="@id/refresh"
android:layout_marginLeft="6dp"
android:layout_toRightOf="@id/close"
android:indeterminate="true"
android:padding="12dp"
app:indicatorColor="#FFF"
app:indicatorSize="20dp"
app:trackCornerRadius="2dp"
Expand All @@ -82,30 +86,50 @@
style="@style/button_borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/logo"
android:layout_marginRight="6dp"
android:layout_toLeftOf="@id/filters"
android:drawableLeft="@drawable/refresh_24px"
android:drawablePadding="8dp"
android:drawablePadding="0dp"
android:drawableTint="#FFF"
android:padding="16dp"
android:text="Retry"
android:paddingHorizontal="16dp"
android:paddingVertical="12dp"
android:textAllCaps="false"
android:textColor="#FFF"
android:visibility="gone"
tools:visibility="visible" />

<TextView
android:id="@+id/filters"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginVertical="4dp"
android:layout_marginRight="6dp"
android:layout_toLeftOf="@id/logo"
android:drawableLeft="@drawable/tune_24px"
android:drawablePadding="8dp"
android:drawableTint="#FFF"
android:gravity="center"
android:paddingHorizontal="16dp"
android:paddingVertical="12dp"
android:text="Filters"
android:textAllCaps="false"
android:textColor="#FFF" />

</RelativeLayout>


<androidx.recyclerview.widget.RecyclerView
android:id="@+id/beatmap_list"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_below="@id/bar"
android:layout_centerHorizontal="true"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="2"
tools:listitem="@layout/beatmap_downloader_set_item">

</androidx.recyclerview.widget.RecyclerView>


</LinearLayout>
</RelativeLayout>
29 changes: 29 additions & 0 deletions res/layout/dropdown_fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/frg_background"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:id="@+id/frg_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/rounded_rect"
android:backgroundTint="#FF28283D"
android:gravity="center"
android:orientation="vertical">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"
android:fadingEdge="vertical"
android:padding="8dp"
tools:itemCount="16"
tools:listitem="@layout/dialog_select_item" />

</LinearLayout>

</RelativeLayout>
Loading

0 comments on commit 3c4d41a

Please sign in to comment.