I am trying to implement the holoeverywhere theme in my app.
When I implement the holoeverywhere theme, I get a actionbar by default. I think it is because of Actionbarsherlock library. I was not aware of this library and have implemented my own actionbar of sorts. So, how do I disable the actionbar that comes up now.
If you need any relevant portions of my code, please let me know. Thanks
Removed ABS depends from HoloEverywhere... It's hard and don't supported by me.
First. Remove full library/src/com/actionbarsherlock from HE.
Second. Change library/resources/*.json to extend from standart android themes, not sherlock. Rebuild styles by mvn resbuilder:styler
Third. Remove fake-actionbar from PreferenceScreen code.
Fourth. Edit library/src/org/holoeverywhere/app/Activity and remove all related to ABS and remove Sherlock addon.
Fifth. Uncomment special block in library/res/values/attrs.xml. Straight from the top.
Sixth. Pray to Cthulhu and make a couple of tricks ears.
Once there was a branch nosherlock. Not popular.
In the HoloEverywhere library included in my project, in the res>values>styles.xml file, there is a theme called Holo.Theme.Light.NoActionBar. I use that instead of Holo.Theme.Light which I used earlier. This fixed the issue. Thanks.
Related
So, I have tried to use ActionBarStyleGenerator. It generates all style.xml file and all its left is to somehow set it for the action bar. The problem is that I use support libraries (app support 2.1 android) and I have issues with setting action bar style.xml to it.
Have you ever tried using this tool. If so, can you help me out and explain how to set style for the action bar?
The problem is that I use support libraries (app support 2.1 android) and I have issues with setting action bar style.xml to it.
You can set it to generate the resources for ActionBarCompat or ActionBarSherlock as well.
Since you are using the support library you have to choose AppCompat:
I am developing a android application.i am using action-bar in my app.but its not working in my Android smartphone(2.2.3) crashing. give me the solution.
Use actionbar sherlock for supporting lower versions too.. follow this
Here is how to use ActionBarSherlock:
Download the ActionBarSherlock here.
Assuming you're using Eclipse IDE, right click your Project, click Properties, then Android. At the bottom, in Layout, Add ActionBarSherlock.
Make sure ActionBarSherlock and your Project are in the same directory.
Extend your classes to Sherlock naming. For example, instead of Activity, change it to Sherlock Activity. The main documentation of ActionBarSherlock is found here.
For easier usage of Sherlock, create util methods in changing the Sherlock names and modifying it.
If you just need to know ocally the android version and act according to it :
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) {
// do something
}
else {
// do something else
}
I've implemented ActionBar Sherlock in my project, but now i would prefer to replace it with a simple custom layout bar and remove ABS completely from my project. I've googled it and couldn't find anything similar to this. I remember when i implemented ABS that i have deleted the default #libs. How do i completely remove it and implement back the previous stuff without messing up? Thanks
Firstly, let your MainActivity extends Activity instead of SherlockActivity..and then right click on your project goto properties->Andrioid..scroll down and remove ABS library and apply..In manifest if u have applied any theme then change it to #style/AppTheme..and that should be it..
I'm having the same issue. In addition to removing the ABS Library and extending MainActivity from Activity instead of SherlockActivity... you have to make sure all of your activities are switched. You also have to make change fragments as well. Any imports you have need to be changed as well (ActionBar, Menu, MenuItem, etc). I'd suggest in a separate branch deleting ABS and see where the errors are and go from there.
The last few days I've been doing great stuff in development, but I've seem to have hit a wall on something probably stupid simple. It's annoying. I was hoping I could get some help.
What I'm trying to do
I'm trying to create the awesome transparent ActionBar animation effect from Google Music (as described by Cyril Mottier here)
The problem
I can't even get the actionbar to go into overlay / transparent mode.
My set-up
I've got a library-oriented set-up in Eclipse. I've got a library project (let's call it master) that contains all the actual code and activities. Then I've got a project, that just plugs into the master library (let's call it slave). Lastly there's some open source support libraries that master uses (among others is ActionBarSherlock).
The activity I'm trying to apply this effect to is in the master library. It is declared in slave's manifest as com.example.master.DetailActivity, and that works like a charm.
Also: The theme for the activity may come from several places. Either it's set by slave's manifest, or by master at runtime. Themes may come from the master OR the slave project.
What I've tried
Feels like everything. I've started out by creating a custom theme based on Cyril's article. I made sure that for every item I've had a version with and without the android: prefix as per Jake Wharton's instructions.
I've also tried setting it at runtime using requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
What I've got
Nothing. The theme applied succesfully (I can see the actionbar's colors change appropriately), but it NEVER goes into overlay mode, nor does it become transparent.
Help would be greatly appreciated, and would probably be helpful to other's trying this effect.
EDIT:
Here are my themes and styles. Codes are kinda messy because I've been experimenting with them to see where I was going wrong. AppTheme and Theme.TranslucentActionBar.ActionBar.Overlay both won't work.
/res/values/
styles.xml
themes.xml
/res/values-v11/
styles.xml
themes.xml
I'm testing on a Nexus 4 with 4.2.2 installed as well as a 2.3.3 emulator.
OK, so apparently, with my set-up, you can't do it using themes.
I ended it up doing it, globally like this.
setTheme(theme.whatever);
requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
super.onCreate(savedInstanceState);
setContentView(R.layout.content);
getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.color)); // This is #212121 solid color for the dark action bar.
The lines are spread out over my code, but this is the gist of it. The order is important.
I also found out that sliding menu seemed to be blocking the overlay mode. I had to remove the instance for it to work. I'm still looking for a way to enable both overlay mode and the sliding menu.
I created my own library with one activity and use it in another project. But when I create my own app theme with custom title bar for my activities in my project I have an issue. Activity from my library (of course) have default title bar. Any ideas how to solve it with the easiest way?
You could probably extend that Library's Activity and then set it manually. Check a similar situation somebody asked here