Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
Workaround for #1076 and #1157 - IllegalStateException in autofill ac…
Browse files Browse the repository at this point in the history
…tivity

  It seems that in Android 8.0.0 (API 26) there is a bug where setting the
auto fill activity window to translucent causes an exception to be thrown.
Per #1076 it doesn't happen on Android 8.1.

  This patch works around the problem by not setting the window to be
translucent on API 26 only. The window is (obviously) not translucent, but
the App doesn't crash and is otherwise usable.
  • Loading branch information
Governa authored and Fernando Governatore committed Jun 23, 2020
1 parent 436557c commit 5521966
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/src/main/res/values-v26/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!--
~ This Source Code Form is subject to the terms of the Mozilla Public
~ License, v. 2.0. If a copy of the MPL was not distributed with this
~ file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->

<resources>
<!-- Bug #1076 workaround -->
<style name="NoBackgroundTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowIsTranslucent">false</item>
</style>
</resources>
12 changes: 12 additions & 0 deletions app/src/main/res/values-v27/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!--
~ This Source Code Form is subject to the terms of the Mozilla Public
~ License, v. 2.0. If a copy of the MPL was not distributed with this
~ file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->

<resources>
<!-- Undo bug #1076 workaround (see values-26/styles.xml) -->
<style name="NoBackgroundTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
</style>
</resources>

0 comments on commit 5521966

Please sign in to comment.