Created
February 3, 2021 07:30
-
-
Save dzolnai/ec844e575787f36e799bc70765e87606 to your computer and use it in GitHub Desktop.
Genre fragment with a CollapsingToolbarLayout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<com.google.android.material.appbar.CollapsingToolbarLayout | |
android:id="@+id/collapsing_toolbar" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
app:expandedTitleMarginStart="@dimen/genre_clickable_title_left_margin" | |
app:expandedTitleMarginBottom="@dimen/genre_clickable_title_bottom_margin" | |
app:expandedTitleMarginTop="0dp" | |
app:collapsedTitleGravity="center" | |
android:background="@color/background" | |
app:collapsedTitleTextAppearance="@style/AppTheme.CollapsingToolbarTitle.Collapsed" | |
app:expandedTitleGravity="left|bottom" | |
app:expandedTitleTextAppearance="@style/AppTheme.CollapsingToolbarTitle.Expanded" | |
app:layout_scrollFlags="scroll|exitUntilCollapsed"> | |
<Space | |
android:id="@+id/expanded_size" | |
android:layout_width="match_parent" | |
android:layout_height="108dp"/> | |
<androidx.appcompat.widget.Toolbar | |
android:id="@+id/toolbar" | |
android:layout_width="match_parent" | |
app:titleMargin="0dp" | |
app:titleMargins="0dp" | |
app:contentInsetStart="?attr/actionBarSize" | |
app:contentInsetLeft="?attr/actionBarSize" | |
app:contentInsetRight="?attr/actionBarSize" | |
app:contentInsetEnd="?attr/actionBarSize" | |
app:layout_collapseMode="pin" | |
app:contentInsetStartWithNavigation="?attr/actionBarSize" | |
android:layout_height="?attr/actionBarSize" | |
app:layout_scrollFlags="scroll|exitUntilCollapsed"/> | |
<FrameLayout | |
android:id="@+id/clickable_layout" | |
android:layout_width="wrap_content" | |
tools:layout_width="200dp" | |
android:translationZ="10dp" | |
android:layout_gravity="bottom" | |
android:paddingBottom="@dimen/clickable_layout_bottom_padding_expanded" | |
android:layout_height="?attr/actionBarSize"> | |
<ImageView | |
android:id="@+id/chevron" | |
android:layout_width="wrap_content" | |
app:srcCompat="@drawable/ic_expand" | |
app:tint="@color/gray" | |
android:layout_gravity="right|bottom" | |
android:layout_height="wrap_content"/> | |
</FrameLayout> | |
<View | |
android:id="@+id/back_button_touch_forwarder" | |
app:layout_collapseMode="pin" | |
android:translationZ="12dp" | |
android:layout_width="?attr/actionBarSize" | |
android:layout_height="?attr/actionBarSize"/> | |
</com.google.android.material.appbar.CollapsingToolbarLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment