Android Question How can i change theme background color

azzam223

Active Member
Licensed User
Longtime User
hello every one how can i change theme background color that display when app start because my logo background color is different than theme background color
 

azzam223

Active Member
Licensed User
Longtime User
Thanks erel I have checked but I didn't know what the the property change background color only I see action bar changed not background
 
Upvote 0

asales

Expert
Licensed User
Longtime User
B4X:
<style name="LightTheme" parent="@android:style/Theme.Material.Light">
    <item name="android:colorBackground">#FF6495ED</item>
</style>
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Thanks artless but how can I applied it
I STRONGLY recomment you to check the Thread Erel posted instead of asking first.
You DID NOT

B4X:
etApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, colors.xml,
<resources>
    <color name="actionbar">#ff039be5</color>
   <color name="statusbar">#ff006db3</color>
   <color name="textColorPrimary">#ffffffff</color>
   <color name="navigationBar">#ff006db3</color>
</resources>
)
CreateResource(values, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Material.Light">
        <item name="android:colorPrimary">@color/actionbar</item>
        <item name="android:colorPrimaryDark">@color/statusbar</item>
        <item name="android:textColorPrimary">@color/textColorPrimary</item>
        <item name="android:navigationBarColor">@color/navigationBar</item>
    </style>
</resources>
)
 
Upvote 0

azzam223

Active Member
Licensed User
Longtime User
B4X:
res\values-v14\theme.xml:5: error: style attribute 'android:attr/colorbackground' not found.

i have added but i got this error
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User


B4X:
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, colors.xml,
<resources>
    <color name="actionbar">#ff039be5</color>
    <color name="statusbar">#ff006db3</color>
    <color name="textColorPrimary">#ffffffff</color>
    <color name="navigationBar">#ff006db3</color>   
    <color name="colorBackground">#6EFF33</color>
</resources>
)
CreateResource(values-v20, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Material.Light">
         <item name="android:colorPrimary">@color/actionbar</item>
         <item name="android:colorPrimaryDark">@color/statusbar</item>
         <item name="android:textColorPrimary">@color/textColorPrimary</item>
         <item name="android:navigationBarColor">@color/navigationBar</item>
         <item name="android:colorBackground">@color/colorBackground</item>
    </style>
</resources>
)
CreateResource(values-v14, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Holo.Light">
        <item name="android:actionBarStyle">@style/CustomActionBarStyle</item>
    </style>
    <style name="CustomActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
        <item name="android:background">@color/actionbar</item>
    </style>
</resources>
)
 

Attachments

  • 1.zip
    8.7 KB · Views: 78
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
see directory of generated resources:
ThemeColors\B4A Samples\Objects\res
ThemeColors\B4A Samples\Objects\res\values
\ThemeColors\B4A Samples\Objects\res\values-v20
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
You may be interested, dynamic change of themes, through xml files.
 
Upvote 0

azzam223

Active Member
Licensed User
Longtime User
thanks TILogistic is work now
 
Upvote 0

azzam223

Active Member
Licensed User
Longtime User


hello how can i remove the white space around the logo i tried to make the logo bigger but nothing changed
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
hello how can i remove the white space around the logo i tried to make the logo bigger but nothing changed
Do not expect anyone can give you a congrete answer if you do not upload a small project showing the issue.

How can we know what you did and how?

Away from that
- the Question in #1 is answered.
- you should create A NEW THREAD for any new question/issue you have.
- Also give ENOUGH details for anyone want to help.
- Upload a small project showing the issue.
 
Last edited:
Upvote 0

azzam223

Active Member
Licensed User
Longtime User
Do not expect anyone can give you a congrete answer if you do not upload a small project showing the issue.

How can we know what you did and how?

hi don i have used this snipped code in manifest editor and also select logo with 512×512
B4X:
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, colors.xml,
<resources>
    <color name="actionbar">#FF7F5B8B</color>
    <color name="statusbar">#ff006db3</color>
    <color name="textColorPrimary">#ffffffff</color>
    <color name="navigationBar">#ff006db3</color>  
    <color name="colorBackground">#FF7F5B8B</color>
</resources>
)
CreateResource(values-v20, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Material.Light">
         <item name="android:colorBackground">@color/colorBackground</item>
    </style>
</resources>
)
CreateResource(values-v14, theme.xml,
<resources>
 
    <style name="CustomActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
        <item name="android:background">@color/actionbar</item>
    </style>
</resources>
)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
hi don i have used this snipped code in manifest editor and also select logo with 512 size
I´ll not try to guess what could be wrong. Your Manifest helps exactly zero to reproduce the issue.

- the Question in #1 is answered.
- you should create A NEW THREAD for any new question/issue you have.
- Also give ENOUGH details for anyone want to help.
- Upload a small project showing the issue.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…