material-components / material-components/material-components-android

[Calendar] Cannot scale for tablet (sw600dp)

Open
#3,659 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Widget: DatePicker
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

**Description:** Scaling Calendar dialog for tablet

**Expected behavior:**

Mobile
image

Tablet
image

It is actually too small in tablet (just didn't capture the whole screen) and the dialog padding has issue which can be seen when looking at the buttons

**Source code:** The code snippet which is causing this issue

```

<item name="android:textSize">24sp</item>
<item name="android:textColor">@color/colorPrimaryDark_Accent</item>



<!-- Background color -->
<item name="colorSurface">@color/colorWhite_Primary</item>
<!-- Indicator or focused field color -->
<item name="colorPrimary">@color/colorPrimary_Accent</item>
<!-- Day color (active) -->
<item name="colorOnPrimary">@color/colorWhite_PrimaryDark</item>
<!-- Day color (inactive) -->
<item name="colorOnSurface">@color/colorPrimaryDark_White</item>
<!-- Remove unnecessary overlay -->
<item name="elevationOverlayEnabled">false</item>
<item name="colorOnSurfaceVariant">@color/colorPrimary_Accent</item>
<item name="buttonBarPositiveButtonStyle">@style/DialogButtonStyle</item>
<item name="buttonBarNegativeButtonStyle">@style/DialogButtonStyle</item>
<item name="materialAlertDialogTitleTextStyle">@style/DialogTitleStyle</item>
<item name="materialAlertDialogBodyTextStyle">@style/DialogBodyStyle</item>
<item name="shapeAppearanceCornerExtraLarge">@style/ShapeAppearance.App.LargeComponent</item>



<!-- Background color -->
<item name="colorSurface">@color/colorWhite_Primary</item>
<!-- Message color -->
<item name="colorOnSurfaceVariant">@color/colorPrimaryDark_White</item>
<item name="buttonBarPositiveButtonStyle">@style/DialogButtonStyle</item>
<item name="buttonBarNegativeButtonStyle">@style/DialogButtonStyle</item>
<item name="alertDialogStyle">@style/MaterialAlertDialog.App</item>
<item name="materialAlertDialogTitleTextStyle">@style/DialogTitleStyle</item>
<item name="materialAlertDialogBodyTextStyle">@style/DialogBodyStyle</item>


<item name="shapeAppearance">@style/ShapeAppearance.App.MediumComponent</item>
<item name="shapeAppearanceOverlay">@null</item>




<item name="android:textColor">@color/colorPrimaryDark_White</item>
<item name="android:textAllCaps">true</item>
<item name="android:textSize">40sp</item>


<item name="android:textColor">@color/colorPrimaryDark_White</item>
<item name="android:textSize">18sp</item>

```

Here I was hoping that `materialAlertDialogTitleTextStyle ` and `materialAlertDialogBodyTextStyle ` will took effect just like in normal alert dialog.

**Minimal sample app repro:** N/A

**Android API version:** 21 and above

**Material Library version:** 1.10.0

**Device:** Pixel C Emulator

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Calendar dialog on the Pixel C emulator at sw600dp with Material Library 1.10.0, comparing it with the mobile layout. Inspect the AppCalendar, AppDialog, DialogButtonStyle, DialogTitleStyle, and DialogBodyStyle entries to determine how dialog sizing, padding, and text styles behave. Done means the tablet dialog scales appropriately, its button padding is correct, and the configured title and body styles take effect.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
design, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.