Material Date Picker Custom Styling

前端 未结 4 844
清酒与你
清酒与你 2021-02-09 03:18

i have used range date picker from google material with this library

implementation \'com.google.android.material:material:1.2.0-alpha02\'

4条回答
  •  独厮守ぢ
    2021-02-09 04:22

    About the fullscreen.

    The range picker should cover the entire screen (default = dialog for single date, fullscreen for range). However you can change this behavior in your style.

    You can use the setTheme method to apply a theme overlay:

    //To apply a dialog
    builder.setTheme(R.style.ThemeOverlay_MaterialComponents_MaterialCalendar);
    //To apply the fullscreen:
    builder.setTheme(R.style.ThemeOverlay_MaterialComponents_MaterialCalendar_Fullscreen);
    

    Note: it requires at least the version 1.2.0-alpha01.

    As alternative you can add in your app theme the materialCalendarFullscreenTheme attribute.

    
    

    where:

      
    

    Here you can override the value with the android:windowFullscreen attribute:

      
    


    About the strings.
    Currently there isn't a method to change the strings.
    The only existing method is builder.setTitleText to change the title.

    However you can override all the existing strings in your project, but this workaround can stop to run in the next releases. For example:

      ....
      ...
      ...
    

    Here you can find all the strings used by the material calendar in the 1.2.0-alpha02.

提交回复
热议问题