Created
May 1, 2014 23:50
-
-
Save heinrichreimer/a6c4b04cf77631857e50 to your computer and use it in GitHub Desktop.
Use android wallpaper as activity background
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources> | |
<style name="Configuration.Theme" parent="Configuration.Theme.Base"> | |
<item name="android:windowContentOverlay">@null</item> | |
<item name="android:windowShowWallpaper">true</item> | |
<item name="android:windowBackground">#1000</item> | |
</style> | |
</resources> |
Thanks!
It didn't work for me (Android 9), but I managed to fix it:
In styles.xml
add to the style
tag:
<item name="android:windowShowWallpaper">true</item>
<item name="android:windowBackground">@color/colorBackground</item>
and in colors.xml
add to the resources
tag:
<color name="colorBackground">#00000080</color>
My full styles.xml
(yours will be different):
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowShowWallpaper">true</item>
<item name="android:windowBackground">@color/colorBackground</item>
</style>
</resources>
and colors.xml
:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#009DF3</color>
<color name="colorPrimaryDark">#006DC3</color>
<color name="colorAccent">#00FFFF</color>
<color name="colorBackground">#00000080</color>
</resources>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you.