Import updated Android Setupdesign Library 655973050 Copied from google3/third_party/java_src/android_libs/setupdesign Test: mm Included changes: - 655973050 [SetupDesign] Fix the issue that the header is not shown ... Bug: 346720623 PiperOrigin-RevId: 655973050 Change-Id: Ie31f4974897300d263d5a96d6f8f3705f1f09f40
diff --git a/main/res/values-v34/layouts.xml b/main/res/values-v34/layouts.xml index e95ab86..5d5d158 100644 --- a/main/res/values-v34/layouts.xml +++ b/main/res/values-v34/layouts.xml
@@ -19,5 +19,6 @@ <!-- Layout for supporting force two pane even if it is portrait mode. --> <item name="sud_glif_preference_template_two_pane" type="layout">@layout/sud_glif_preference_template_compact</item> + <item name="sud_glif_preference_recycler_view_compat_two_pane" type="layout">@layout/sud_glif_preference_recycler_view</item> </resources>
diff --git a/main/res/values-w840dp-v34/layouts.xml b/main/res/values-w840dp-v34/layouts.xml index 2d08c48..d5583fd 100644 --- a/main/res/values-w840dp-v34/layouts.xml +++ b/main/res/values-w840dp-v34/layouts.xml
@@ -22,5 +22,6 @@ <item name="sud_glif_list_template_two_pane" type="layout">@layout/sud_glif_list_template_card_two_pane</item> <item name="sud_glif_recycler_template_two_pane" type="layout">@layout/sud_glif_recycler_template_card_two_pane</item> <item name="sud_glif_preference_template_two_pane" type="layout">@layout/sud_glif_preference_template_card_two_pane</item> + <item name="sud_glif_preference_recycler_view_compat_two_pane" type="layout">@layout/sud_glif_preference_recycler_view_two_pane</item> </resources>
diff --git a/main/src/com/google/android/setupdesign/GlifPreferenceLayout.java b/main/src/com/google/android/setupdesign/GlifPreferenceLayout.java index 29decfe..433ca60 100644 --- a/main/src/com/google/android/setupdesign/GlifPreferenceLayout.java +++ b/main/src/com/google/android/setupdesign/GlifPreferenceLayout.java
@@ -33,7 +33,7 @@ * * <p>Example: * - * <pre>{@code + * <pre * <style android:name="MyActivityTheme"> * <item android:name="preferenceTheme">@style/MyPreferenceTheme</item> * </style> @@ -45,20 +45,20 @@ * <style android:name="MyPreferenceFragmentStyle"> * <item android:name="android:layout">@layout/my_preference_layout</item> * </style> - * }</pre> + * </pre> * * where {@code my_preference_layout} is a layout that contains {@link * com.google.android.setupdesign.GlifPreferenceLayout}. * * <p>Example: * - * <pre>{@code + * <pre> * <com.google.android.setupdesign.GlifPreferenceLayout * xmlns:android="http://schemas.android.com/apk/res/android" * android:id="@id/list_container" * android:layout_width="match_parent" * android:layout_height="match_parent" /> - * }</pre> + * </pre> * * <p>Fragments using this layout <em>must</em> delegate {@code onCreateRecyclerView} to the * implementation in this class: {@link #onCreateRecyclerView(android.view.LayoutInflater, @@ -117,7 +117,9 @@ final LayoutInflater inflater = LayoutInflater.from(getContext()); int recyclerViewLayoutId = R.layout.sud_glif_preference_recycler_view; if (ForceTwoPaneHelper.isForceTwoPaneEnable(getContext())) { - recyclerViewLayoutId = R.layout.sud_glif_preference_recycler_view_two_pane; + // Use the compat two pane layout for the recycler view if the two pane is enabled. Since the + // sud_glif_preference_recycler_view layout is not compatible with original layout. + recyclerViewLayoutId = R.layout.sud_glif_preference_recycler_view_compat_two_pane; } RecyclerView recyclerView = (RecyclerView) inflater.inflate(recyclerViewLayoutId, this, false); recyclerMixin = new RecyclerMixin(this, recyclerView);