diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-05-03 10:56:25 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-05-03 10:56:25 +0300 |
commit | 2771420512a3788ef81ac61ceeb2e11aacc474d1 (patch) | |
tree | 0a1f6d0f0f4c5296e66a8a62ead15035e9e1363e | |
parent | b784be03e6f63e9089ee0ac07179bb7f15ffc2a3 (diff) |
Add offscreen limit and background colors for debugging purposes
3 files changed, 14 insertions, 29 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java index 7388b0bbe..113449c93 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java @@ -43,6 +43,7 @@ public class FilterDialogFragment extends BrandedDialogFragment { binding = DialogFilterBinding.inflate(requireActivity().getLayoutInflater()); binding.viewPager.setAdapter(new TabsPagerAdapter(getChildFragmentManager(), getLifecycle())); + binding.viewPager.setOffscreenPageLimit(tabTitles.length); new TabLayoutMediator(binding.tabLayout, binding.viewPager, (tab, position) -> tab.setText(tabTitles[position])).attach(); return dialogBuilder diff --git a/app/src/main/res/layout/dialog_filter.xml b/app/src/main/res/layout/dialog_filter.xml index 1de6f5bb0..d9b671890 100644 --- a/app/src/main/res/layout/dialog_filter.xml +++ b/app/src/main/res/layout/dialog_filter.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> @@ -7,10 +8,12 @@ <com.google.android.material.tabs.TabLayout android:id="@+id/tab_layout" android:layout_width="match_parent" - android:layout_height="wrap_content" /> + android:layout_height="wrap_content" + app:tabUnboundedRipple="true" /> <androidx.viewpager2.widget.ViewPager2 android:id="@+id/view_pager" android:layout_width="match_parent" - android:layout_height="wrap_content" /> + android:layout_height="400dp" + android:background="@color/primary" /> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/dialog_filter_labels.xml b/app/src/main/res/layout/dialog_filter_labels.xml index aab612217..477911315 100644 --- a/app/src/main/res/layout/dialog_filter_labels.xml +++ b/app/src/main/res/layout/dialog_filter_labels.xml @@ -1,31 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> -<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.recyclerview.widget.RecyclerView 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:id="@+id/labels" android:layout_width="match_parent" - android:layout_height="match_parent"> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - android:padding="?attr/dialogPreferredPadding"> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/spacer_1x" - android:labelFor="@id/overdue" - android:text="@string/filter_by_tag" - android:textAppearance="?attr/textAppearancePopupMenuHeader" /> - - <androidx.recyclerview.widget.RecyclerView - android:id="@+id/labels" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:choiceMode="multipleChoice" - app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" - tools:itemCount="4" - tools:listitem="@layout/item_filter_label" /> - </LinearLayout> -</ScrollView>
\ No newline at end of file + android:layout_height="300dp" + android:background="@color/mdtp_red" + android:choiceMode="multipleChoice" + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" + tools:itemCount="4" + tools:listitem="@layout/item_filter_label" />
\ No newline at end of file |