Skip to content

Commit 29bed9a

Browse files
imhappidsn5ft
authored andcommitted
[CollapsingToolbarLayout] Exposing methods to set text size for collapsed and expanded text size
Resolves #775 PiperOrigin-RevId: 465391478
1 parent 8bec167 commit 29bed9a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

lib/java/com/google/android/material/appbar/CollapsingToolbarLayout.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,34 @@ public int getExpandedTitleGravity() {
11851185
return collapsingTextHelper.getExpandedTextGravity();
11861186
}
11871187

1188+
/**
1189+
* Sets the text size of the expanded title.
1190+
*
1191+
* @param textSize The text size of the expanded title.
1192+
*/
1193+
public void setExpandedTitleTextSize(float textSize) {
1194+
collapsingTextHelper.setExpandedTextSize(textSize);
1195+
}
1196+
1197+
/** Returns the text size of the expanded title. */
1198+
public float getExpandedTitleTextSize() {
1199+
return collapsingTextHelper.getExpandedTextSize();
1200+
}
1201+
1202+
/**
1203+
* Sets the text size of the collapsed title.
1204+
*
1205+
* @param textSize The text size of the collapsed title.
1206+
*/
1207+
public void setCollapsedTitleTextSize(float textSize) {
1208+
collapsingTextHelper.setCollapsedTextSize(textSize);
1209+
}
1210+
1211+
/** Returns the text size of the collapsed title. */
1212+
public float getCollapsedTitleTextSize() {
1213+
return collapsingTextHelper.getCollapsedTextSize();
1214+
}
1215+
11881216
/**
11891217
* Set the typeface to use for the collapsed title.
11901218
*

0 commit comments

Comments
 (0)