android-actionbar

ActionBar AppCompat change Tab indicator color

被刻印的时光 ゝ 提交于 2019-12-11 01:36:57
问题 I have seen many posts and answers but still not clear to me, what to do if i have to change Tab indicator color without using Android Asset Studio public class MainActivity extends ActionBarActivity implements android.support.v7.app.ActionBar.TabListener{ private ViewPager tabsviewPager; private TabsAdapter mTabsAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tabsviewPager = (ViewPager)

ActionBar and Fragments on ICS 4.0.3

只谈情不闲聊 提交于 2019-12-11 01:06:40
问题 I'm trying to develop an Android app and I have some problems with the ActionBar. I need something similar to Instagram or Twitter for Android: I have an Action Bar with 3 tabs and these tabs have some buttons; every button has an OnClick() that replaces the actual fragment with a new one (for example ''FragmentN'') using FragmentTransaction (and the method replace()) . My first problem is that when I select a tab from the ActionBar, the selected tab doesn't replace "FragmentN" but it places

How to change individual action item text color in ActionBar PROGRAMMATICALLY?

故事扮演 提交于 2019-12-11 01:03:59
问题 In my ActionBar , I have a MenuItem that has attribute showAsAction="always" as seen in the image below. Based on the connection a user has to our servers, I will be changing the text as well as color of the item. Currently, I am able to change the text of the item very easily in onPrepareOptionsMenu(...) : @Override public boolean onPrepareOptionsMenu(Menu menu) { MenuItem item = menu.findItem(R.id.action_connection); if(mIsConnected) { item.setTitle(R.string.action_connected); } else { item

ActionBar isn't displaying in API 16

谁说胖子不能爱 提交于 2019-12-11 00:58:09
问题 I'm a beginner, I have made an app which contains navigation drawer along with the action bar in mainactivity.It worked perfectly on API 23 but in API 16, action bar isn't showing up.I searched many links on "actionbar not displaying" but they were having problems below API 11/8.After API 11, I think AppCompat should work (which I have used) Here are images Here is my styles.xml <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat"> <!-- Customize your

Styling radio buttons on ActionBarCompat dropdown menu

房东的猫 提交于 2019-12-11 00:36:45
问题 I am working on an app that uses a theme that extends @style/Theme.AppCompat.Light.DarkActionBar . On one of my activities, there is an Action Bar icon that shows three options with radiobuttons (here's an extract from the menu XML file): <item android:icon="@drawable/ic_action_filter_white" android:showAsAction="always" android:title="" preparatest:showAsAction="always"> <menu> <group android:checkableBehavior="single" > <item android:id="@+id/menu_filter_all" android:title="@string/history

Android Action Bar Two Line Text Labels

≡放荡痞女 提交于 2019-12-11 00:25:55
问题 Is there a way (perhaps some special character along the lines of non-breaking spaces) that I can force the menu items in my Action Bar to have two line labels? I think this just looks better than long, single-line tab labels... Thanks, R. Edit, additional info: My apologies, I have so far managed to avoid needing the overflow menu, probably because I'm developing for a Nexus 7 with a nice large screen. To clarify, one of my menu tabs (in the action bar proper) is "Restore Defaults", but I

Impossible to change the background of tabs with ActionBarSherlock

非 Y 不嫁゛ 提交于 2019-12-11 00:05:44
问题 I would like to change the background of the tabs. I tried everything during the last 2 days, so I decided to post my code here. The background of the ActionBar is set correctly but the TABS stay black. <style name="CustomActivityTheme" parent="Theme.Sherlock"> <item name="android:actionBarStyle">@style/MyActionBar</item> <item name="android:actionBarTabStyle">@style/MyActionBarTabStyle</item> <!-- other activity and action bar styles here --> </style> <!-- style for the action bar

How to exit fullscreen (show Action Bar) programmatically on Android 4.0+?

喜你入骨 提交于 2019-12-10 23:41:44
问题 If I have an Activity with a fullscreen theme , set up like this: <activity android:name=".FullscreenActivity" android:theme="@style/MyTheme.FullScreen"/> With MyTheme.FullScreen defined as: <style name="MyTheme.FullScreen" parent="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"> </style> ... is it possible to exit fullscreen mode programmatically ? I specifically want to show the Action Bar (with its navigation options) in certain situations, while usually having the activity in

How to implement a menuitem click listener inside a fragment in android

血红的双手。 提交于 2019-12-10 22:56:06
问题 I have MenuItems in the ActionBar and I am using Fragments inside ViewPager. Now I would like to handle onMenuItemClickListener event inside my fragment. It works fine inside Main Activity. But not inside Fragments. And also it doesn't fetch any error. Here is the methods that I tried. Both works fine inside Activity. First method: public boolean onCreateOptionsMenu(Menu menu) { MenuItem item = menu.findItem(R.id.grid_view); item.setOnMenuItemClickListener(new OnMenuItemClickListener() {

ActionBar covering my activity

女生的网名这么多〃 提交于 2019-12-10 22:31:00
问题 I have an activity whose xml is: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:context="ivykoko.com.likechecker.MainActivity"> <android.support.v7.widget.RecyclerView xmlns:android=