CollapsingToolbarLayout
CollapsingToolbarLayout is a wrapper for Toolbar which implements a collapsing app bar. It differs from Google’s one by introducing a new theme and new features.
This documentation page provides only the additional features, for a complete documentation of this component please take a look at:
We also suggest you to read Samsung’s One UI design guidelines before you implement this in your app:
- Samsung Developers
- One UI Design Guidelines (page 18-28)
Styles
-
Widget.Design.CollapsingToolbar
-
Widget.Design.Light.CollapsingToolbar
Avoid using “Widget.MaterialComponents.*” styles.
XML attributes
-
CollapsingToolbarLayout_extendedTitleEnabled
Sets whether this view should display its own title.
-
CollapsingToolbarLayout_extendedTitleTextAppearance
Sets text-specific styling for the title text.
-
CollapsingToolbarLayout_extendedSubtitleTextAppearance
Sets text-specific styling for the subtitle text.
-
CollapsingToolbarLayout_subtitle
Sets the subtitle of this view.
Methods
- Enable/disable the fade effect for the toolbar title.
public void seslEnableFadeToolbarTitle(boolean enabled)
- Set the subtitle of this view.
public void seslSetSubtitle(@StringRes int resId)
public void seslSetSubtitle(CharSequence subtitle)
- Get the subtitle of this view.
public CharSequence getSubTitle()
- Set a custom title view, requires a CollapsingToolbarLayout.LayoutParams instance.
public void seslSetCustomTitleView(View view, LayoutParams params)
- Set a custom subtitle view.
public void seslSetCustomSubtitle(View view)
- Get the custom subtitle view.
public View seslGetCustomSubtitle()
CollapsingToolbarLayout.LayoutParams
This documentation page provides only the additional features, for a complete documentation of this component please take a look at Google’s official documentation.
XML attributes
-
CollapsingToolbarLayout_Layout_isCustomTitle
Sets whether or not the view should be used as a custom title view.
Methods
- Set whether or not the view should be used as a custom title view.
public void seslSetIsTitleCustom(Boolean isCustom)
- Get if the view is being used as a custom title view.
public boolean seslIsTitleCustom()