android-actionbar

Popup menu on click of a button in action Bar

假装没事ソ 提交于 2019-12-03 15:52:46
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:showAsAction="always" android:title="@string/menu_refresh"/> <Item android:id="@+id/popup" android:icon="

Android SearchView Icon

我的梦境 提交于 2019-12-03 15:44:19
问题 I want to disable the Mag icon displayed inside the search view component. Any idea how to reference it and remove it or replace it with another drawable ? 回答1: In your theme: <style name="Theme" parent="Your parent theme"> <item name="android:searchViewSearchIcon">@android:drawable/ic_search</item> </style> Edit: searchViewSearchIcon is a private attribute. This answer therefore does not work (on the native ActionBar). 回答2: Since the wording of the question does not contain any mention of

ActionBar with rounded edges

可紊 提交于 2019-12-03 15:04:32
问题 I would like to know, if it is possible to make my ActionBar have rounded edges, more specifically only the top ones (top-left, top-right). I did some searching, but most of the methods are outdated and did not work for me. I am using AppCompat support library v22.1.1. I have made an image of what I am trying to achieve, but my reputation is too low to upload images so I tried to describe as best as I could with words. If I have missed out any relevant information, let me know. 回答1: Yes, it

Getting screen coordinate of action bar menu item for creating introduction screen

我们两清 提交于 2019-12-03 13:55:35
I was wondering, if there is any possibility of getting the screen coordinates of an action bar menu item? As I would like to create an introduction screen, to draw an arrow pointing to the desired action bar menu item, so that the user knows where to start. penduDev Here's how I did it: @Override public boolean onOptionsItemSelected(MenuItem item) { if(item.getItemId().equals(R.id.my_menu_item)) { View menuView = findViewById(R.id.menu_item_search); int[] location = new int[2]; menuView.getLocationOnScreen(location); int menuViewX = location[0]; int menuViewY = location[1]; } } Presently,

Animation actionBar material design

江枫思渺然 提交于 2019-12-03 13:51:00
问题 how you can do this kind of animations in the ActionBar? Example animation actionBar material design 回答1: Currently there isn't public API to obtain this. You can try this library: https://github.com/markushi/android-ui 回答2: I have used balysv/material-menu library and implemented successfully. ActionView By Markushi requires API level 14+ but material-menu by balysv can be used with ActionBarSherLock also with animation customization. Here you have four icon states: BURGER, ARROW, X, CHECK.

Actionbar convert tabs to list navigation if there is no room

时光毁灭记忆、已成空白 提交于 2019-12-03 13:30:44
I have an actionbar with a logo, a title, 2 tabs and a search function. On a phone (3.5") everything works fine. The actionbar has 2 lines. The logo title and the search function appear on the first line and the tabs apear on the second line. On my tablet (7") everyting is shown on a single line. But the tabs will be convert to a list when i click the search icon. How can i split the (sherlock)actionbar in 2 lines on my 7" tabblet? Or is there an other way to solve this problem? In ActionBarSherlock, there is a boolean value(abs__action_bar_embed_tabs) that determine whether the Tabs should be

Action bar overflow not displayed

↘锁芯ラ 提交于 2019-12-03 13:25:12
问题 I'm setting up an action bar with Sherlock with 3 items/icons. Running on a ICS emulator, I only can see 2 icons. And moreover: NO overflow menu (those 3 dots-icon)! I only get the 3rd icon if I press the menu button of the phone. Do I have to force the overflow icon, and if so how can I do so? 回答1: Do I have to force the overflow icon, and if so how can I do so? All you need to do is have your theme inherit from one of the .ForceOverflow themes. Note this will only work for Android 2.0 and 3

Have the split ActionBar display twice as many icons

社会主义新天地 提交于 2019-12-03 13:20:32
I'd like to have an app layout as the one they used for Gmail. They have the actionbar that has icons (on my device it has the app logo for up navigation, and a custom view for selecting priority inbox/inbox/etc), but there is also some kind of split ActionBar because at the bottom I have several icons (compose, search, labels, etc). How could I do this? I have implemented the following ActionBar through this XML: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/menu_gps" android:icon="@drawable/icone_gps_continu"

Actionbar dropdown click event

妖精的绣舞 提交于 2019-12-03 12:48:30
I have dropdown list in actionbar as navigation list. Using ActionBar.OnNavigationListener and onNavigationItemSelected to detect when user has clicked on item in actionbar dropdown navigation list and that works fine. However, onNavigationItemSelected is not called if user has clicked on the same item as the one which is currently selected in dropdown list! (I need this exact functionality behavior for app to work properly) So is there any way to detect click on any part of the dropdown list in actionbar? Is there a way to somehow reference dropdown view in actionbar, and then set

Two action bars (Bottom and Up) at the same time?

扶醉桌前 提交于 2019-12-03 12:44:57
问题 I have need to make two action bars , I am using actionBarSherlock by the way . So what I need exactly is to put a "Welcome screen" toggle on the normal action bar up , and add two normal ActionBar Action options . Similar to what I need are Gmail and Maps like here : http://cdn.androidcommunity.com/wp-content/uploads/2012/03/Screenshot_2012-03-28-12-58-16.png (They didn't allow me to post an image for reputation is low , see the link please) This Maps app has an upper and bottom action bar ,