Android Question Applying theme to StdActionBar

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi All,

I am trying to color tabs in action bar by using themes generated by Android Action Bar Style Generator.
As explained in https://www.b4x.com/android/forum/threads/stdactionbar-another-actionbar-library.36786/page-2 by
Wembley.

I copied all generated drawable folders to res\drawable folder.
I copied styles_test.xml file generated to res/values folder and renamed to themes.xml.
Made all of the read only
I added SetApplicationAttribute(android:theme, "@style/Theme.test") line to manifest editor.
"test" as i used this name for style name in generator.

It shows error
No resource found that matches the given name (at 'theme' with value '@style/theme.test').

I guess something is wrong somewhere.

Can please anyone guide me.

Thanks
Juzer
 

Brandsum

Well-Known Member
Licensed User
Create a folder (let assume the name of the folder is resource) in your project folder where you have the your_project.b4a file.
Copy all generated folder to that newly created folder. Like:
  • resource\drawable\themes.xml
  • resource\values\styles_test.xml


Then add this line to your main activity:
B4X:
#AdditionalRes: "..\resource"
 
Upvote 0

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi Brandsum,

Thanks for your quick reply.
As you said i made a new folder Resources in application folder with 2 sub folders drawable and values.
These contain the generated drawable folders and style_test.xml file and renamed it to themes.xml.
I removed the line
SetApplicationAttribute(android:theme, "@style/Theme.test") line to manifest editor. from manifest

and added
#AdditionalRes: "..\resource" in main activity

It gives error.

Failed to generate resource table for split ''
..\resources\values\themes.xml:29: error: Error: No resource found that matches the given name (at 'android:actionModeBackground' with value '@drawable/cab_background_top_test').

Juzer
 
Upvote 0

Brandsum

Well-Known Member
Licensed User
No resource found that matches the given name (at 'android:actionModeBackground' with value '@drawable/cab_background_top_test').
That means there is no cab_background_top_test file inside drawable folder.

Check if you have missed some files.
 
Upvote 0

Juzer Hussain

Active Member
Licensed User
Longtime User
Oh Erel having come this far i did not want to hear this. Anyways I will work on it.
Thanks to all of you Brandsum, mcqueccu and Erel.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…