Skip to content

BlurTitlebarView

Use Component

xml
<com.qmdeve.blurview.widget.BlurTitlebarView
    android:id="@+id/blurTitlebar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:blurRadius="25dp"
    app:overlayColor="#D1FFFFFF"
    app:titleText="Title"
    app:subtitleText="Subtitle"
    app:showBack="true"
    app:menuText="Edit"
    app:centerTitle="false" />
java
BlurTitlebarView titlebar = new BlurTitlebarView(context);
titlebar.setTitle("Title");
titlebar.setSubtitle("Subtitle");
titlebar.setShowBack(true);
titlebar.setMenuText("Edit");
titlebar.setCenterTitle(true);
kotlin
val titlebar = BlurTitlebarView(context)
titlebar.setTitle("Title")
titlebar.setSubtitle("Subtitle")
titlebar.setShowBack(true)
titlebar.setMenuText("Edit")
titlebar.setCenterTitle(true)

Attribute Description

Attribute NameTypeDefault ValueDescription
app:titleTextstringnullTitle text.
app:subtitleTextstringnullSubtitle text.
app:titleTextColorcolortransparentTitle text color. Auto-calculated from overlay when transparent.
app:subtitleTextColorcolortransparentSubtitle text color. Auto-calculated from overlay when transparent.
app:showBackbooleanfalseWhether to show the back area/icon.
app:backIconreferencenullBack icon drawable resource.
app:backIconTintcolortransparentBack icon tint. Auto-calculated from overlay when transparent.
app:menuTextstringnullRight-side menu text.
app:menuTextColorcolortransparentMenu text color. Auto-calculated from overlay when transparent.
app:menuIconreferencenullRight-side menu icon drawable resource.
app:menuIconTintcolortransparentMenu icon tint. Auto-calculated from overlay when transparent.
app:centerTitlebooleanfalseAnimate title/subtitle to centered mode.
app:blurRadiusdimension25dpInherited blur radius from BlurView.
app:overlayColorcolor#AAFFFFFFInherited overlay color from BlurView.

API Reference

MethodDescription
setCenterTitle(boolean)Animate title/subtitle alignment to center or start.
setTitle(String)Set title text.
setSubtitle(String)Set subtitle text.
setShowBack(boolean)Show or hide back area.
setBackIcon(Drawable)Set back icon drawable.
setBackIconTint(int)Set back icon tint color.
setMenuText(String)Set right-side menu text.
setMenuIcon(Drawable)Set right-side menu icon drawable.
setMenuIconTint(int)Set right-side menu icon tint color.
setOnBackClickListener(OnBackClickListener)Set back click callback.
setOnMenuClickListener(OnMenuClickListener)Set menu click callback.
setBlurRadius(float)Inherited blur radius API from BlurView.
setOverlayColor(int)Inherited overlay color API from BlurView.