Skip to content

Commit

Permalink
[Catalog] Small fixes
Browse files Browse the repository at this point in the history
Resolves #2751

GIT_ORIGIN_REV_ID=fbae7afaa081033f02e3ce1fbd82e52e28274c4c
PiperOrigin-RevId: 459277358
  • Loading branch information
pubiqq authored and hunterstich committed Jul 6, 2022
1 parent 0c56a45 commit 51c59fa
Show file tree
Hide file tree
Showing 9 changed files with 359 additions and 294 deletions.
141 changes: 79 additions & 62 deletions catalog/java/io/material/catalog/checkbox/res/layout/cat_checkbox.xml
Expand Up @@ -16,110 +16,127 @@
limitations under the License.
-->

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:id="@+id/main_viewGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/cat_checkbox_padding"
android:orientation="vertical">
<GridLayout
android:orientation="vertical"
android:padding="@dimen/cat_checkbox_padding">

<GridLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:columnCount="2"
android:useDefaultMargins="true">
<TextView

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_columnSpan="2"
android:text="@string/cat_checkbox_intro" />
<CheckBox

<CheckBox
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="true"
android:enabled="true"
android:text="@string/cat_checkbox_enabled"/>
<CheckBox
android:text="@string/cat_checkbox_enabled" />

<CheckBox
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="false"
android:enabled="true"
android:text="@string/cat_checkbox_enabled"/>
<TextView
android:text="@string/cat_checkbox_enabled" />

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_columnSpan="2"
android:text="@string/cat_checkbox_disabled_guide" />
<CheckBox

<CheckBox
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="true"
android:enabled="false"
android:text="@string/cat_checkbox_disabled"/>
<CheckBox
android:text="@string/cat_checkbox_disabled" />

<CheckBox
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="false"
android:enabled="false"
android:text="@string/cat_checkbox_disabled"/>
</GridLayout>
android:text="@string/cat_checkbox_disabled" />
</GridLayout>

<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/cat_checkbox_line_separator_margin"
android:layout_marginBottom="@dimen/cat_checkbox_line_separator_margin"/>
<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/cat_checkbox_line_separator_margin"
android:layout_marginBottom="@dimen/cat_checkbox_line_separator_margin" />

<CheckBox
<CheckBox
android:id="@+id/checkbox_toggle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="false"
android:enabled="true"
android:text="@string/cat_checkbox_enablable_description"/>
<LinearLayout
android:id="@+id/checkbox_toggle_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/cat_checkbox_indent"
android:orientation="vertical">
android:text="@string/cat_checkbox_enablable_description" />

<LinearLayout
android:id="@+id/checkbox_toggle_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/cat_checkbox_indent"
android:orientation="vertical">

<CheckBox
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="true"
android:enabled="false"
android:text="@string/cat_checkbox_toggle" />

<CheckBox
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="false"
android:enabled="false"
android:text="@string/cat_checkbox_toggle" />
</LinearLayout>

<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/cat_checkbox_line_separator_margin"
android:layout_marginBottom="@dimen/cat_checkbox_line_separator_margin" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/cat_checkbox_no_text" />

<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="true"
android:enabled="false"
android:text="@string/cat_checkbox_toggle"/>
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/cat_checkbox_line_separator_margin"
android:layout_marginBottom="@dimen/cat_checkbox_line_separator_margin" />

<CheckBox
android:id="@+id/checkbox_toggle_error"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checked="false"
android:enabled="false"
android:text="@string/cat_checkbox_toggle"/>
android:text="@string/cat_checkbox_toggle_error" />
</LinearLayout>

<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/cat_checkbox_line_separator_margin"
android:layout_marginBottom="@dimen/cat_checkbox_line_separator_margin"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/cat_checkbox_no_text"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/cat_checkbox_line_separator_margin"
android:layout_marginBottom="@dimen/cat_checkbox_line_separator_margin"/>

<CheckBox
android:id="@+id/checkbox_toggle_error"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/cat_checkbox_toggle_error"/>
</LinearLayout>
</ScrollView>
Expand Up @@ -22,18 +22,13 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="192dp"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">

<com.google.android.material.appbar.CollapsingToolbarLayout
style="?attr/catalogToolbarStyle"
style="?attr/collapsingToolbarLayoutLargeStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:collapsedTitleTextAppearance="?attr/textAppearanceHeadline6"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleGravity="bottom"
app:expandedTitleMarginBottom="56dp"
app:expandedTitleMarginStart="16dp"
app:expandedTitleTextAppearance="?attr/textAppearanceHeadline5"
android:layout_height="?attr/collapsingToolbarLayoutLargeSize"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">

<androidx.appcompat.widget.Toolbar
Expand Down
Expand Up @@ -22,13 +22,13 @@
android:gravity="center_horizontal"
android:orientation="vertical">
<FrameLayout
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ScrollView
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"/>
</FrameLayout>

Expand Down
Expand Up @@ -19,7 +19,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_gravity="center_horizontal"
android:padding="8dp"
android:clipToPadding="false"
android:columnCount="2"
Expand Down

0 comments on commit 51c59fa

Please sign in to comment.