Tag: android-actionbar

Android Tab Action Bar

I am trying out on the android action bar for 3.0, where I refer to The code in the TabsActivity are as follow: package com.test.actionbar; import android.app.ActionBar; import android.app.ActionBar.Tab; import android.app.Activity; import android.app.Fragment; import android.app.FragmentTransaction; import android.os.Bundle; public class TabsActivity extends Activity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActionBar bar = getActionBar(); bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); ActionBar.Tab […]

How to set Android toolbar height?

I want to achieve this: What I thought was to make a Custom Toolbar with a bigger height and work with the tabhost and tabpager normally. I have implemented it, but the toolbar is showing the normal height, so it doesn’t show as I want, just the top part. Is this the right approach or […]

How to animate background of ActionMode of the ActionBar?

Background It’s possible to change the background of the actionbar, and even animate between two colors, as such: public static void animateBetweenColors(final ActionBar actionBar, final int colorFrom, final int colorTo, final int durationInMs) { final ValueAnimator colorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), colorFrom, colorTo); colorAnimation.addUpdateListener(new AnimatorUpdateListener() { ColorDrawable colorDrawable = new ColorDrawable(colorFrom); @Override public void onAnimationUpdate(final ValueAnimator […]

ActionBar Title dynamically change with fragment

I have 1 Activity with 3 Fragments inside (Home-Login-RestorePass) Initially, HomeFragment shows and the other two are hidden. I want that the ActionBar Title change depending on which Fragment is showing. I’m trying in my Activity with: public void setActionBarTitle(String title){ getSupportActionBar().setTitle(title); } @Override public void onResume() { super.onResume(); // Set title setActionBarTitle(getString(R.string.app_name)); } and […]

Disable menubutton in the android emulator

When developing applications for ICS – the actionbar looks different depending on if there is a physical menubutton present on the device or not. For example if not, a virtual button is displayed in the actionbar. Is it possible to emulate a device without a menubutton by disabling it somehow in the emulator?

Displaying icon for menu items of Action Bar in Honeycomb android 3.0

hi I am developing an android application using Honeycomb android 3.0 . I am tryig to display a menu in Action Bar . The menu has an icon and tiltle. When we click the menu item it displays its items in the form of a dropdown list .It was the items in drop down list […]

How to display a custom view in the ActionBar?

I am trying to display a custom view in the action bar. I am using SherlockActionBar. Here is my code. The custom view is never showing. What am I doing wrong? View customNav = LayoutInflater.from(this).inflate(R.layout.my_layout, null); getSupportActionBar().setDisplayShowTitleEnabled(false); getSupportActionBar().setCustomView(customNav);

Applying shadow and text color for Title and Menu Item in Sherlock Action bar

I am trying to achieve 2 things White Text for Menu Items, Title text color works Text Shadows for Title and Menu item All this on XML. What works, after experiments? Custom Action bar layout works just fine with shadows. Text color for all Tiles works but text shadow has no effect Text color for […]

Android ActionBar not changing background color

I am trying to change the background color of my action bar but it doesnt change. My app is using the AppCompat theme if that affects anything. Here is my theme that is being used. My app points to use this theme so that is not the problem <!– Base application theme. –> <style name=”AppTheme” […]

Android Actionbar navigation spinner text color

I am able to change the background of the navigation spinner: <style name=”MyTheme” parent=”android:style/Theme.Light”> <item name=”android:actionBarStyle”>@style/MyActionBar</item> <item name=”android:actionDropDownStyle”>@style/MyDropDownNav</item> </style> <style name=”MyDropDownNav” parent=”android:style/Widget.Spinner”> <item name=”android:background”>@drawable/spinner_white</item> <item name=”android:textColor”>@color/red</item> </style> Nevertheless the textColor is not changed. I also tried other ways to change the textColor: <style name=”MyActionBar” parent=”@android:style/Widget.Holo.ActionBar”> <item name=”android:background”>?color_actionbar</item> <item name=”android:titleTextStyle”>@style/myTheme.ActionBar.Text</item> </style> <style name=”myTheme.ActionBar.Text” parent=”@android:style/TextAppearance”> <item name=”android:textColor”>@color/violet</item> […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.