Skip to content

Commit

Permalink
[BottomAppBar] Updating catalog to remove M2 options
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 465353345
  • Loading branch information
imhappi authored and drchen committed Aug 4, 2022
1 parent 2b1af84 commit 8bec167
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 155 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,70 +141,6 @@ private void setUpDemoControls(@NonNull View view) {
showFabButton.setOnClickListener(v -> fab.show());
hideFabButton.setOnClickListener(v -> fab.hide());

// Set up FAB alignment mode toggle buttons.
MaterialButton centerButton = view.findViewById(R.id.fab_position_button_center);
MaterialButton endButton = view.findViewById(R.id.fab_position_button_end);

if (bar.getFabAlignmentMode() == BottomAppBar.FAB_ALIGNMENT_MODE_CENTER) {
centerButton.setChecked(true);
} else {
endButton.setChecked(true);
}

centerButton.setOnClickListener(
v ->
bar.setFabAlignmentModeAndReplaceMenu(
BottomAppBar.FAB_ALIGNMENT_MODE_CENTER, R.menu.demo_primary));
endButton.setOnClickListener(
v ->
bar.setFabAlignmentModeAndReplaceMenu(
BottomAppBar.FAB_ALIGNMENT_MODE_END, R.menu.demo_primary_alternate));

// Set up FAB animation mode toggle buttons.
MaterialButton slideButton = view.findViewById(R.id.fab_animation_mode_button_slide);
MaterialButton scaleButton = view.findViewById(R.id.fab_animation_mode_button_scale);

if (bar.getFabAnimationMode() == BottomAppBar.FAB_ANIMATION_MODE_SCALE) {
scaleButton.setChecked(true);
} else {
slideButton.setChecked(true);
}

scaleButton.setOnClickListener(
v -> bar.setFabAnimationMode(BottomAppBar.FAB_ANIMATION_MODE_SCALE));
slideButton.setOnClickListener(
v -> bar.setFabAnimationMode(BottomAppBar.FAB_ANIMATION_MODE_SLIDE));

// Set up FAB anchor mode toggle buttons.
MaterialButton embedButton = view.findViewById(R.id.fab_anchor_mode_button_embed);
MaterialButton cradleButton = view.findViewById(R.id.fab_anchor_mode_button_cradle);

if (bar.getFabAnchorMode() == BottomAppBar.FAB_ANCHOR_MODE_EMBED) {
embedButton.setChecked(true);
} else {
cradleButton.setChecked(true);
}

embedButton.setOnClickListener(
v -> bar.setFabAnchorMode(BottomAppBar.FAB_ANCHOR_MODE_EMBED));
cradleButton.setOnClickListener(
v -> bar.setFabAnchorMode(BottomAppBar.FAB_ANCHOR_MODE_CRADLE));

// Set up menu alignment toggle buttons.
MaterialButton menuAlignmentAutoButton = view.findViewById(R.id.menu_alignment_auto);
MaterialButton menuAlignmentStartButton = view.findViewById(R.id.menu_alignment_start);

if (bar.getMenuAlignmentMode() == BottomAppBar.MENU_ALIGNMENT_MODE_AUTO) {
menuAlignmentAutoButton.setChecked(true);
} else {
menuAlignmentStartButton.setChecked(true);
}

menuAlignmentAutoButton.setOnClickListener(
v -> bar.setMenuAlignmentMode(BottomAppBar.MENU_ALIGNMENT_MODE_AUTO));
menuAlignmentStartButton.setOnClickListener(
v -> bar.setMenuAlignmentMode(BottomAppBar.MENU_ALIGNMENT_MODE_START));

// Set up hide on scroll switch.
MaterialSwitch barScrollSwitch = view.findViewById(R.id.bar_scroll_switch);
barScrollSwitch.setChecked(bar.getHideOnScroll());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,51 +40,6 @@
android:gravity="center_horizontal"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cat_bottomappbar_fab_alignment_mode"
android:textAppearance="?attr/textAppearanceBody1" />
<com.google.android.material.button.MaterialButtonToggleGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="@+id/fab_position_button_center"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cat_bottomappbar_center" />
<Button
android:id="@+id/fab_position_button_end"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cat_bottomappbar_end" />
</com.google.android.material.button.MaterialButtonToggleGroup>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/cat_bottomappbar_fab_animation_mode"
android:textAppearance="?attr/textAppearanceBody1" />
<com.google.android.material.button.MaterialButtonToggleGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="@+id/fab_animation_mode_button_scale"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cat_bottomappbar_fab_anim_scale" />
<Button
android:id="@+id/fab_animation_mode_button_slide"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cat_bottomappbar_fab_anim_slide" />
</com.google.android.material.button.MaterialButtonToggleGroup>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -108,52 +63,6 @@
android:text="@string/cat_bottomappbar_fab_hide" />
</com.google.android.material.button.MaterialButtonToggleGroup>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/cat_bottomappbar_fab_anchor_mode"
android:textAppearance="?attr/textAppearanceBody1" />
<com.google.android.material.button.MaterialButtonToggleGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="@+id/fab_anchor_mode_button_embed"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cat_bottomappbar_button_embed" />
<Button
android:id="@+id/fab_anchor_mode_button_cradle"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cat_bottomappbar_button_cradle" />
</com.google.android.material.button.MaterialButtonToggleGroup>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/cat_bottomappbar_menu_alignment"
android:textAppearance="?attr/textAppearanceBody1" />
<com.google.android.material.button.MaterialButtonToggleGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="@+id/menu_alignment_auto"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cat_bottomappbar_button_menu_alignment_auto" />
<Button
android:id="@+id/menu_alignment_start"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cat_bottomappbar_button_menu_alignment_start" />
</com.google.android.material.button.MaterialButtonToggleGroup>

<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/bar_scroll_switch"
android:layout_width="wrap_content"
Expand Down

0 comments on commit 8bec167

Please sign in to comment.