Skip to content

Commit

Permalink
[Catalog] Fix issue with top app bar not lifting in catalog demo frag…
Browse files Browse the repository at this point in the history
…ments

PiperOrigin-RevId: 582013479
  • Loading branch information
imhappi authored and dsn5ft committed Nov 13, 2023
1 parent a283959 commit 22aadb7
Show file tree
Hide file tree
Showing 22 changed files with 160 additions and 330 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ public View onCreateView(
LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, @Nullable Bundle bundle) {
View view = super.onCreateView(layoutInflater, viewGroup, bundle);
CoordinatorLayout coordinatorLayout = view.findViewById(R.id.cat_demo_fragment_container);

// For unknown reasons, setting this in the xml is cleared out but setting it here takes effect.
View container = coordinatorLayout.findViewById(R.id.cat_bottom_navs_animated_container);
CoordinatorLayout.LayoutParams lp =
(LayoutParams) coordinatorLayout.getChildAt(0).getLayoutParams();
(LayoutParams) container.getLayoutParams();
lp.setBehavior(null);
lp.gravity = Gravity.BOTTOM;

ViewCompat.setOnApplyWindowInsetsListener(coordinatorLayout, (v, insets) -> insets);
return view;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/cat_bottom_navs_animated_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
limitations under the License.
-->

<ScrollView
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
Expand Down Expand Up @@ -147,4 +147,4 @@
android:layout_height="@dimen/mtrl_card_spacing"/>

</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
limitations under the License.
-->

<ScrollView
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
Expand Down Expand Up @@ -357,4 +357,4 @@

</com.google.android.material.card.MaterialCardView>
</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,17 @@
limitations under the License.
-->

<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical">

<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical">

<!-- Chip styles. -->
<FrameLayout
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_gravity="center_horizontal"/>
</ScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<!-- Chip styles. -->
<FrameLayout
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_gravity="center_horizontal"/>
</androidx.core.widget.NestedScrollView>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
limitations under the License.
-->

<ScrollView
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down Expand Up @@ -89,4 +89,4 @@
android:padding="8dp"
android:text="@string/cat_color_utility_note" />
</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
limitations under the License.
-->

<ScrollView
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down Expand Up @@ -283,4 +283,4 @@

</LinearLayout>
</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<ScrollView
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down Expand Up @@ -48,4 +48,4 @@

</LinearLayout>

</ScrollView>
</androidx.core.widget.NestedScrollView>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<ScrollView
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -27,4 +27,4 @@
android:padding="@dimen/cat_dialog_demo_padding"
android:orientation="vertical">
</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>
Loading

0 comments on commit 22aadb7

Please sign in to comment.