The commit primarily fixes a few overlapping issues caused by the window
inset handling. Previously, there were two main issues:
* Because setTransparentNavigationBar() checked for portrait mode, the
inset logic never executed in landscape mode. This caused the app to
overlap the status bar and navigation bar.
* The inset logic did not have handling for displayCutout insets. In
landscape mode, this would cause the app to overlap the notch or
camera hole punch area on phones.
In addition to fixing those issues, this commit simplifies the inset
logic a bit:
* applyWindowInsets() now accepts an EnumSet of WindowInsetPosition to
avoid needing to duplicate logic for the various position
combinations.
* Insets are now applied to the main container in the layout instead of
individual elements where possible. This eliminates the need for the
previous manual IME height handling logic in BOTTOM_IME vs
TOP_BOTTOM_IME (for avoiding the insets being applied twice).
* Since insets are now applied to the main layout container,
applyWindowInsets() now takes systemBars, displayCutout, and ime all
into consideration. This should avoid all possible overlapping.
* Add support for using padding instead of margins for insets. This is
used for GroupActivity's navigation drawer, where Material design
intends for the drawer background to be drawn behind system bars.
Signed-off-by: Andrew Gunnerson <[email protected]>
This addresses J-Jamet's feedback that keeping the global setting would
potentially lead to confusion, so it should be removed now that we are
remembering each database's read-only state.
The app has supported a global setting for opening (all) databases in
read-only mode. But that's not particularly flexible for the use case
where you have one database that should be read-only and one that should
be read-write.
Previously, to handle this use case you could open one database in
read-only mode, but the next time you attempted to open the same
database, it would "forget" that, so you would have to toggle it to
read-only mode again manually. This commit changes that behavior so that
if you toggle a database to read-only mode, it'll be remembered the next
time you open the database. (You can still toggle it back to read-write
if you change your mind, and that, too, will be remembered the next time
you open the database.)