android-actionbar

How to “install” Action Bar Sherlock?

夙愿已清 提交于 2019-12-05 01:30:35
I'm trying to build the sample project "Action Bar Styled" using the Action Bar Sherlock. I download the .zip file containing ABS here http://actionbarsherlock.com/ but I can't figure out where to unzip so that it will appear on Project>Properties>Add library. Can someone give me an hand? Also, I read somewhere (can't find it now, sorry) that the current Android Compatibility library supports the Action Bar in pre 3.0 versions, so it has basically the same "effect" as Action Bar Sherlock - can someone confirm this? Which library should I install? Elad92 Didn't heard about Compatibility library

How to set Android toolbar height?

我们两清 提交于 2019-12-05 01:27:16
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 is it possible to set a TabHost below a Linear/Relative Layout? Because I don't need to work with it as an action bar. Relevant Code toolbar.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbarTitle"

Set selected item background color on Android dropdown navigation

三世轮回 提交于 2019-12-05 01:22:07
问题 I think this is an easy question, but I haven't been able to find an answer to my specific problem. I've read this great article and would like to set the background color of the selected item on the Android Dropdown list on the stock ActionBar (I'm not using Sherlock and I'm targetting ICS+), as explained in the image link below: So far I've set my theme in this way: <resources> <style name="AppBaseTheme" parent="android:Theme.Holo.Light"> <item name="android:dropDownListViewStyle">@style

Why getActionBar() getting null value in TabHost from Android?

為{幸葍}努か 提交于 2019-12-05 01:18:17
问题 I am trying to write a code in Android , to hide the Actionbar during scroll down event. I have a grid 10x50. So when i am scrolling down the action bar should hide. I am getting scroll state result in the Log Cat correctly so , whenever i am applying for getActionBar().hide , i am getting NullPointerException error. My Code : package com.example.complexdatepicker; import android.app.TabActivity; import android.content.Intent; import android.os.Bundle; import android.widget.TabHost; import

Android Action Bar: Changing the color of Action Buttons

旧街凉风 提交于 2019-12-05 01:07:10
问题 I have an app with an action bar that looks like this: I would like the text of the menu action buttons "Home" and "Logout" to be white as well. How can I change their text color? Let me know if you want to see any code. Thanks! 回答1: As i perceive it this is a simple attribute called android:actionMenuTextColor . To use it properly you should create your own styles, like this: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="myTheme" parent="@android:style/Theme.Holo.Light">

How to add actions to the top part of a split ActionBar

眉间皱痕 提交于 2019-12-05 00:43:13
If an Android ActionBar is split into a top and a bottom portion using android:uiOptions="splitActionBarWhenNarrow" in the Manifext.xml , is there a way to force some of the actions to be displayed in the top portion instead of having them all at the bottom? There's no standard way of doing this. That said, the Action Bar custom view will appear in the upper bar, so you can just use that. You will lose some of the extras (toasts on long press), so you'll have to implement them yourself. That said, of you're using ActionBarSherlock, all the layouts and styles for a normal button are there, so

Popup menu on click of a button in action Bar

百般思念 提交于 2019-12-05 00:34:32
问题 I am trying to implement an action bar in which one of the buttons on click shows a popup menu. Here's the menu. XML (menu items in the action bar) <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/search" android:icon="@drawable/ic_action_search" android:orderInCategory="0" android:showAsAction="always" android:title="@string/menu_search"/> <item android:id="@+id/refresh" android:icon="@drawable/ic_action_refresh" android:orderInCategory="1" android

ActionBarSherlock hardkey menu panel text color

牧云@^-^@ 提交于 2019-12-05 00:29:57
I have a small question about theming my app that uses ActionBarSherlock. Everything works fine except on Samsung phones with TouchWizz . The overflow menu items appear by pressing the hardware menu key. I know how to change the panel background. My default theme extends Theme.Sherlock.Light.DarkActionBar , so the default menu item text color in the hardware panel will be black , I wan't to change this. Any ideas on how to do this besides changing the parent of my default theme? <style name="Theme.MyApp" parent="@style/Theme.Sherlock.Light.DarkActionBar"> <item name="android:panelBackground">

how to change the padding or margin of the action bar icon or logo in XML theme?

那年仲夏 提交于 2019-12-04 23:52:16
问题 how to change the top and bottom padding or margin of the action bar icon or logo space by using XML theme? <style name="Theme.Whycheck" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <item name="actionBarItemBackground">@drawable/selectable_background_whycheck</item> <item name="actionBarStyle">@style/ActionBar.Solid.Whycheck</item> <item name="actionModeBackground">@drawable/cab_background_top_whycheck</item> <item name="actionModeSplitBackground">@drawable/cab_background_bottom

searchview not closing correctly on FIRST back press (it's only loosing focus)

杀马特。学长 韩版系。学妹 提交于 2019-12-04 23:36:29
I have to press the backbutton twice, to close the SearchView . Why? On the first press, the SearchView only looses focus... Setting setOnKeyListener on SearchView does not work either... Btw, I'm using the ABS implementation... My code is simple and looks like the following: mMenuItemSearch = menu.findItem(R.id.search); mSearchView = new SearchView(getSupportActionBar().getThemedContext()); mMenuItemSearch.setActionView(mSearchView); mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { public boolean onQueryTextChange(String newText) { mPagerManager.getFragment