Skip to content

Commit c1a3aa2

Browse files
committed
Shrink half day label sizes for tablets to fit on one line
1 parent 4b26fb8 commit c1a3aa2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/grid/GridTimePickerDialog.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@ public void onClick(View v) {
293293
mFirstHalfDayToggle.setCompoundDrawablesWithIntrinsicBounds(null, icon1, null, null);
294294
mSecondHalfDayToggle.setCompoundDrawablesWithIntrinsicBounds(null, icon2, null, null);
295295
}
296+
if (res.getConfiguration().smallestScreenWidthDp >= 600/*dp units*/) {
297+
// Shrink text size so that labels fit on one line
298+
mFirstHalfDayToggle.setTextSize(0.5f * mFirstHalfDayToggle.getTextSize());
299+
mSecondHalfDayToggle.setTextSize(0.5f * mSecondHalfDayToggle.getTextSize());
300+
}
296301
} else {
297302
mAmPmTextView.setVisibility(View.VISIBLE);
298303
mAmPmHitspace.setOnClickListener(new OnClickListener() {

0 commit comments

Comments
 (0)