Skip to content

Android date and time pickers layout doesn't update on orientation change #49

@starsnostars

Description

@starsnostars

Bug

On android, neither DatePickerDialog nor TimePickerDialog update their layout on orientation change. This results in parts of view being cut off if user opens up either of these pickers and then changes their device orientation.

Environment info

React native info output:

System:
    OS: Windows 7
    CPU: (4) x64 Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
    Memory: 13.04 GB / 31.78 GB
  Binaries:
    Node: 10.15.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.15.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
    Watchman: 4.9.4 - C:\watchman\watchman.EXE
  SDKs:
    Android SDK:
      API Levels: 23, 25, 26, 27, 28
      Build Tools: 27.0.3, 28.0.2, 28.0.3, 29.0.2
      System Images: android-25 | Google APIs Intel x86 Atom, android-25 | Google APIs Intel x86 Atom_64, android-25 | Google Play Intel x86 Atom, android-26 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: Version  3.5.0.0 AI-191.8026.42.35.5791312
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: 0.61.2 => 0.61.2

Library version: 2.1.0

Steps To Reproduce

  1. Add DateTimePicker to your component.
  2. Open it on android in either date or time mode
  3. Change orientation from portrait to landscape or vice-versa

Describe what you expected to happen:

  1. The dialog should be recreated preserving its previous state, but with a new layout (either portrait or landscape to match device's configuration)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions