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

Commit f2e834b

Browse files
GovernaFernando Governatore
authored and
Fernando Governatore
committed
Workaround for #1076 and #1157 - IllegalStateException in autofill activity
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.
1 parent 436557c commit f2e834b

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
~ This Source Code Form is subject to the terms of the Mozilla Public
3+
~ License, v. 2.0. If a copy of the MPL was not distributed with this
4+
~ file, You can obtain one at http://mozilla.org/MPL/2.0/.
5+
-->
6+
7+
<resources>
8+
<!-- Bug #1076 workaround: windowIsTranslucent -> false -->
9+
<style name="NoBackgroundTheme" parent="Theme.AppCompat.Light.NoActionBar">
10+
<item name="android:windowIsTranslucent">false</item>
11+
<item name="android:windowContentOverlay">@null</item>
12+
<item name="android:windowNoTitle">true</item>
13+
<item name="android:windowBackground">@android:color/transparent</item>
14+
<item name="android:background">@android:color/transparent</item>
15+
<item name="colorPrimaryDark">@android:color/transparent</item>
16+
<item name="android:backgroundDimEnabled">true</item>
17+
<item name="android:popupBackground">@android:color/transparent</item>
18+
</style>
19+
</resources>
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
~ This Source Code Form is subject to the terms of the Mozilla Public
3+
~ License, v. 2.0. If a copy of the MPL was not distributed with this
4+
~ file, You can obtain one at http://mozilla.org/MPL/2.0/.
5+
-->
6+
7+
<resources>
8+
<!-- Undo bug #1076 workaround (see values-26/styles.xml) -->
9+
<style name="NoBackgroundTheme" parent="Theme.AppCompat.Light.NoActionBar">
10+
<item name="android:windowIsTranslucent">true</item>
11+
<item name="android:windowContentOverlay">@null</item>
12+
<item name="android:windowNoTitle">true</item>
13+
<item name="android:windowBackground">@android:color/transparent</item>
14+
<item name="android:background">@android:color/transparent</item>
15+
<item name="colorPrimaryDark">@android:color/transparent</item>
16+
<item name="android:backgroundDimEnabled">true</item>
17+
<item name="android:popupBackground">@android:color/transparent</item>
18+
</style>
19+
</resources>

0 commit comments

Comments
 (0)