mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
[Catalog] Update catalog preferences menu to a nested scroll view.
This change allows all preference options to be accessible in landscape mode. PiperOrigin-RevId: 423915710
This commit is contained in:
parent
96fa85e216
commit
9a5ec35aaf
@ -68,11 +68,11 @@ public class CatalogPreferencesDialogFragment extends BottomSheetDialogFragment
|
||||
@NonNull LayoutInflater layoutInflater,
|
||||
@Nullable ViewGroup viewGroup,
|
||||
@Nullable Bundle bundle) {
|
||||
LinearLayout container =
|
||||
(LinearLayout) layoutInflater.inflate(
|
||||
R.layout.mtrl_preferences_dialog, viewGroup, false);
|
||||
View container = layoutInflater.inflate(R.layout.mtrl_preferences_dialog, viewGroup, false);
|
||||
LinearLayout preferencesLayout = container.findViewById(R.id.preferences_layout);
|
||||
for (CatalogPreference catalogPreference : preferences.getPreferences()) {
|
||||
container.addView(createPreferenceView(layoutInflater, container, catalogPreference));
|
||||
preferencesLayout.addView(
|
||||
createPreferenceView(layoutInflater, preferencesLayout, catalogPreference));
|
||||
}
|
||||
return container;
|
||||
}
|
||||
|
||||
@ -13,20 +13,25 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp">
|
||||
|
||||
<TextView
|
||||
android:paddingRight="16dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="always">
|
||||
<LinearLayout
|
||||
android:id="@+id/preferences_layout"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/preferences_screen_title"
|
||||
android:textAppearance="?attr/textAppearanceHeadline3"/>
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/preferences_screen_title"
|
||||
android:textAppearance="?attr/textAppearanceHeadline3"/>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user