android-actionbar

How can I allow horizontal tab navigation (swipe views) with action bar navigation tabs?

自闭症网瘾萝莉.ら 提交于 2019-12-06 04:18:32
How can I allow horizontal tab navigation (swipe views) if I'm using action bar navigation tabs ? Is there anything special I have to do to get this to work with ActionBarSherlock ? CommonsWare The code-generated stuff for a "Tabs+Swipe" activity (from BlankActivity in the new activity wizard in Eclipse) has code for this. Basically, your tabs tie into a ViewPager , calling setCurrentItem() to change the page, rather than running their own FragmentTransaction or otherwise affecting the UI. The ViewPager handles the horizontal swiping, and you populate those pages using some form of

Change custom Up/Back Button Icon on Android ActionBar

北城余情 提交于 2019-12-06 04:03:40
问题 I'm trying to use a custom up/back button icon with a different color since I haven't been able to figure out a straight forward way of changing the color of the default android up/back button. I downloaded a 128x128 back button icon (PNG) and changed it to the color I want, also placed it in my drawable folder. But i have not been able to get it to display, still. Here's what I tried so far, In my Styles.xml, I included this: <style name="customStyle" parent="@style/Theme.AppCompat.Light

Reusing Action Bar in all activities of application

时间秒杀一切 提交于 2019-12-06 03:45:57
I have created a MenuActivity which is having an Action Bar and an Split Action Bar. I want to use this actionbar and splitactionbar view for all activities in my application. I am a newbie to android so can somebody guide me stepwise about this. Also I am trying to put the search icon on actionbar which is right now appearing on SplitActionBar. I have four icons on SplitActionBar and i want to show search icon on the actionbar not on the SplitActionBar. The search icon is a SearchView item which when clicked expands on ActionBar, which is very untidy. I want it to appear on rightmost position

Change Android ShareActionProvider background color when pressed

大兔子大兔子 提交于 2019-12-06 03:41:55
My app's primary color is some kind of yellow. The ShareActionProvider in the action bar has a kind of spinner that when pressed shows the default holo blue color. To make the action bar style coherent, I need to have the share button background go yellow when pressed. How to achieve that? I am using the standard action bar (no compatibility or sherlock) That one does not work: shareMenuItem.getActionView().setBackgroundResource(R.drawable.spinner_background_ab_webcamhd_custom_ab); And none of the questions on SO about styling the ShareActionProvider got any answer :( I wanted white share

Change logo that appears in Android ActionBar programatically

自闭症网瘾萝莉.ら 提交于 2019-12-06 03:33:33
问题 Is there a way to change the logo that appears in the ActionBar inside an Activity instead of listing it in the Manifest? The reason I ask is I have an app for phones where I build a similar type of bar across the top with the launcher icon in the left corner similar to the ActionBar using an ImageView . I also allow the user to change that image to one on their phone or on the internet. I am currently making the app work for tablets and would like to just use the ActionBar instead but can't

Is it possible to use TransitionDrawable on the ActionBar?

我怕爱的太早我们不能终老 提交于 2019-12-06 03:05:48
I'm trying to do some color animation on the action bar by using a TransitionDrawable. The code I'm trying is pretty simple, during onCreate, I put the transition drawable as the actionbar background: Drawable d = getResources().getDrawable(R.drawable.actionbar); actionbarDrawable = new TransitionDrawable(new Drawable[] { d, d }); getActionBar().setBackgroundDrawable(actionbarDrawable); then on the event I replace the second drawable of the TransitionDrawable and ask to animate it. actionbarDrawable.setDrawableByLayerId(1, d); actionbarDrawable.startTransition(666); I've tried the same code on

Android: change width of overflow menu

◇◆丶佛笑我妖孽 提交于 2019-12-06 03:04:25
问题 Currently I have an overflow menu which has default width: What I want is: I have tried changing the theme this way: <style name="MyWorkspaceDetailTheme" parent="@android:style/Theme.Holo.Light.DarkActionBar"> <item name="android:popupMenuStyle">@style/MyPopupMenu</item> </style> <style name="MyPopupMenu" parent="@android:style/Widget.Holo.ListPopupWindow"> <item name="android:dropDownWidth">30dp</item> </style> but didn't got any success. Please can anyone help. 回答1: I was follwing this[http

How can I change the 'little triangle color' in action bar NAVIGATION_MODE_LIST

Deadly 提交于 2019-12-06 02:52:13
问题 After I set action bar to NAVIGATION_MODE_LIST getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); and then set an adapter for it. The list show up as expected, but I need to change the 'little triangle' color of the list as the default color is very close to my background color . Is it possible to do this, if so, how can I do it? 回答1: The little triangle you want to change is in the background of a Spinner widget in ActionBar . The background is a state list drawable. Items of

ActionBar MenuItem selector [closed]

半城伤御伤魂 提交于 2019-12-06 02:31:06
Is it possible to change the Image of a MenuItem when pressed and can that be done by a selector (different MenuItems should be changed with a different image when pressed or selected). Some sample code would be nice. I looked up a lot of solutions but not many of them made a clear explanation. Cheers ! Is it possible to change the Image of a MenuItem when pressed and can that be done by a selector Yep, absolutely. Here's an example: Add a selector to your drawable folder. <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- Pressed state --> <item android:drawable="

How to know if an Android actionbar's action icon is on the top bar or the bottom bar (split)?

橙三吉。 提交于 2019-12-06 02:12:13
问题 I have a split action bar, where the top bar is dark and the bottom bar (split) is light. Consequently, I'd like to show a contrast action icons: Light icons in the top dark bar and dark icons in the bottom light bar. The problem is knowing if the actions should be painted on the top or bottom bar. How can I know that? Another option is to know whether the action bar is currently split. How do I know that? Thanks. 回答1: Simple. You use boolean values. By default you'll have a split ActionBar