android-actionbar

How to draw on ActionBar tab when using ActionBarSherlock in Android?

这一生的挚爱 提交于 2019-12-06 06:37:57
问题 I am using ActionBarSherlock to provide ActionBars for pre HoneyComb devices. My Activity has four fragments namely 1. User 2. Chat 3. Video 4. Extra, see image I have created actionBar using following code:- actionBar = getSupportActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); actionBar.setTitle("Meeting"); actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowCustomEnabled(false); actionBar.setDisplayShowTitleEnabled(false); /* Set Custom view */

Change the pressed color of action bar item of Lollipop action bar

妖精的绣舞 提交于 2019-12-06 06:10:58
I am using AppCompat and have successfully implemented the new action bar that rolled out with lollipop. The only problem is the pressed background color of the action items. I want to show a different background color for the action item when pressed. Any idea how it can be done? You have a couple of options. But first, some background: The action items in AppCompat use theme attribute ?attr/actionBarItemBackground (see res/values/styles_base.xml) which is set to ?attr/selectableItemBackgroundBorderless (see res/styles/themes_base.xml) by default. This attribute is set to a borderless ripple

Changing Actionbar Tab Text Size in AppCompact Theme

百般思念 提交于 2019-12-06 05:55:16
I've search around and tried several ways to change the Actionbar Tab text style. I would like the bigger text size for that "NOW SHOWING" text. Here's my Theme. <style name="Theme.Tabtheme" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <item name="actionBarItemBackground">@drawable/selectable_background_tabtheme</item> <item name="popupMenuStyle">@style/PopupMenu.Tabtheme</item> <item name="dropDownListViewStyle">@style/DropDownListView.Tabtheme</item> <item name="actionBarTabStyle">@style/ActionBarTabStyle.Tabtheme</item> <item name="android:actionBarTabTextStyle">@style

how to gradually turn transparent action bar into solid color as user scrolls down

我与影子孤独终老i 提交于 2019-12-06 05:51:23
In recent android L apps ( lets say google i/o 2014 app) with material theme we have seen that if there is image view at top (followed by any kind of list), then to begin with the actionbar is transparent, then as the user scrolls down the actionbar gradually becomes solid color. 2 questions: 1. does this phenomenon have some name, if yes what is it? 2. how do i code to achieve this in an app for android L or is it default take a look here : https://github.com/ManuelPeinado/FadingActionBar second question : based on my researching until now, we have to implement it by code. it's called Fading

Custom views in actionbar

坚强是说给别人听的谎言 提交于 2019-12-06 05:47:12
问题 I have an action bar. One of the items in the actionbar is for notifications. I want to add a little icon in the top right of the actionbar item which represents how many notifications the user currently has. I went ahead and made a custom layout for the action bar item. Went to go add it and to my surprise there is no way for me to add a custom view as a button on a Action bar. I am using Actionbar-Sherlock for compatibility to older device. This is what I am going for: 回答1: You're looking

How to keep actionbar fixed across all activities?

时光怂恿深爱的人放手 提交于 2019-12-06 05:40:57
In the Facebook app v2.3, when you navigate from one activity(or frgament?) to another, the actionbar stays fixed across all activities(or fragments?). For example, If you navigate from you news feed to someone's profile page, then the action bar stays constant, and the page below is refreshed. So my question is, is it possible to have this behavior using only activities? Or should i just have one main activity, and fragments for all sub activities? One activity and as many fragments as you need. the moment you call startActivity(intent); the framework will roll the activity transition

Update ActionBar title after leaving fragment

半世苍凉 提交于 2019-12-06 05:30:40
When my MainActivity is launched my ActionBar shows the app title. Once you navigate to a fragment through the nav drawer, the title is changed to match the fragment... however, once you navigate back using the back button, the title is left untouched and still has the title of the fragment. I am looking to change it back to the application Title. I have tried to use the onResume() method in the MainActivity.java but it appears that does not get called once you leave a fragment. @Override public void onResume() { super.onResume(); // Set title getActionBar().setTitle("FuelR");

List navigation (spinner) on the right side

蹲街弑〆低调 提交于 2019-12-06 05:23:14
I have tried so many tutorials, but I could not find article that would tell me how to create spinner in action bar (sherlock version), but on the right side. Is there a way to do it? Do I need to create additional views and adapters? I just want to know easy way to create that spinner on the right side, nothing else, just it. You'll need to create a custom layout for the view containing the spinner. Inflate and place it on the action bar and you're good to go. Here you have some sample code for this(this is what you do inside your activity to initialize and place your layout on the action bar

How to add subtitle to spinner in the action bar

☆樱花仙子☆ 提交于 2019-12-06 05:22:46
I have the following I am using action bar and spinner but what I want to do to add a subtitle to be like City subtitles => All , City 1 , City 2 like this image I have the following menu xml file <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/filter1" android:showAsAction="ifRoom" android:orderInCategory="1" android:actionViewClass="android.widget.Spinner" /> <item android:id="@+id/filter2" android:showAsAction="ifRoom" android:orderInCategory="1" android:actionViewClass="android.widget.Spinner" /> </menu> and

getSupportActionBar() NullPointerException

怎甘沉沦 提交于 2019-12-06 05:10:35
In onCreate() method of activity I have this code for ToolBar : toolbar = (Toolbar) findViewById(R.id.tool_bar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); My IDE warms me that getSupportActionBar().setDisplayHomeAsUpEnabled(true); may produce NullPointerException . My question is should I ignore it and how can I fix it anyway? The IDE warns you about a potential NullPointerException because there are many cases where the app could throw one. For the example you could be using a NoActionBar theme for your whole Application (or just for the concerned