Flipped order of options in filter sheet

Unread/ unread progress no longer hide when one or the other selected
This commit is contained in:
Jay 2020-05-07 01:52:43 -04:00
parent 467abf8403
commit 7022cce4c2
2 changed files with 13 additions and 30 deletions

View File

@ -114,8 +114,8 @@ class FilterBottomSheet @JvmOverloads constructor(context: Context, attrs: Attri
if (context.resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) {
second_layout.removeView(view_options)
second_layout.removeView(reorder_filters)
first_layout.addView(view_options)
first_layout.addView(reorder_filters)
first_layout.addView(view_options)
second_layout.gone()
}
@ -412,24 +412,6 @@ class FilterBottomSheet @JvmOverloads constructor(context: Context, attrs: Attri
}?.set(index + 1)
onGroupClicked(ACTION_FILTER)
}
if (view == unread) {
if (index >= 0) {
filter_layout.removeView(unreadProgress)
filterItems.remove(unreadProgress)
} else {
filter_layout.addView(unreadProgress, indexOf(unreadProgress) + addForClear())
filterItems.add(indexOf(unreadProgress), unreadProgress)
}
} else if (view == unreadProgress) {
if (index >= 0) {
filter_layout.removeView(unread)
filterItems.remove(unread)
} else {
filter_layout.addView(unread, indexOf(unread) + addForClear())
filterItems.add(indexOf(unread), unread)
}
}
if (tracked?.isActivated == true && trackers != null && trackers?.parent == null) {
filter_layout.addView(trackers, filterItems.indexOf(tracked!!) + 1)
filterItems.add(filterItems.indexOf(tracked!!) + 1, trackers!!)

View File

@ -93,30 +93,31 @@
android:id="@+id/second_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="@+id/view_options"
style="@style/Theme.Widget.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/display_options"
android:textColor="?android:attr/textColorPrimary"
app:icon="@drawable/ic_tune_white_24dp"
app:iconTint="?android:attr/textColorPrimary" />
<com.google.android.material.button.MaterialButton
android:id="@+id/reorder_filters"
style="@style/Theme.Widget.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:text="@string/reorder_filters"
android:textColor="?android:attr/textColorPrimary"
app:icon="@drawable/ic_swap_vert_24dp"
app:iconTint="?android:attr/textColorPrimary" />
<com.google.android.material.button.MaterialButton
android:id="@+id/view_options"
style="@style/Theme.Widget.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/display_options"
android:textColor="?android:attr/textColorPrimary"
app:icon="@drawable/ic_tune_white_24dp"
app:iconTint="?android:attr/textColorPrimary" />
</LinearLayout>
</LinearLayout>