android-menu

How to implement a badge counter on android hamburger menu icon [duplicate]

倾然丶 夕夏残阳落幕 提交于 2019-12-04 12:06:23
This question already has an answer here: Add new item count to icon on button - Android 5 answers I am trying to implement a counter badge on the hamburger menu icon (i.e. not the other menu icons). Similar to the eBay app. as in.. Has anyone looked into this? Trying to figure out the cleanest way possible. its pretty simple to do with the Toolbar Widget you could follow below example to achieve that: first create an Oval shape <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <solid android:color="#ff00"/> </shape> then create a toolbar widget as below:

How to get view reference from menu item?

为君一笑 提交于 2019-12-04 11:45:29
Iam trying to get a menu item's reference but i just cant. This whole thing is inside a fragment. Menu: boat_accept_menu.xml: <?xml version="1.0" encoding="utf-8"?> <menu 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" tools:context="com.example.toolbar.MainActivity" > <item android:id="@+id/done_boat_select" android:title="@string/done_C" app:showAsAction="always"/> </menu> You can see the comment inside the code, i cannot get the reference. Code: @Override public void

Changing default text colour and still showing disabled menu items in different colour

浪子不回头ぞ 提交于 2019-12-04 10:56:23
With Theme.Holo.Light as the base theme, a designer noticed that the default text colour is not black, but a dark grey ( #505050 ). We'd like to change it to black. Looking for a simple way to change the default to black everywhere in the app, I found that this works: <resources> <style name="MyAppTheme" parent="android:Theme.Holo.Light"> <item name="android:textColor">@android:color/black</item> </style> </resources> Now, problem is , that also changes the colour of disabled items in Action Bar's overflow menu. How to override default text colour while still having disabled menu items look

ExpandableListView / Drill-Down in Sliding Menu

假如想象 提交于 2019-12-04 09:36:33
Here is the Current UI for Side Menu. Here is the image of an app with DRILL-DOWN or Expandable ListView Menu how to create same menu UI for the first image? anddev84 Looks like you've posted another similar question, where I've provided several links to tutorials and tips from my work with ExpandableListViews: Sub Menu in App Please let me know if there is any information you are still unclear on. I already implementing expandable listview inside navigation drawer. This is full source code for it. check this out: this is main_activity.java (include ExpandableDrawerAdapter): public class

How can I get menu item in NavigationView?

半世苍凉 提交于 2019-12-04 08:48:26
问题 <android.support.design.widget.NavigationView android:id="@+id/drawer_nav" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" android:theme="@style/Theme.AppCompat.Light.NoActionBar" app:headerLayout="@layout/drawer_header" app:menu="@menu/menu_drawer" /> I am using android.support.design.library for material design. What I want is to hide some menu items when the user is not logged-in. Now I have trouble to get the menu item in

How to animate toolbar overflow menu icon

被刻印的时光 ゝ 提交于 2019-12-04 08:23:45
Is there a way to animate the default 3-vertical-dotted menu icon on toolbar? I use toolbar as actionbar with the standard code: Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); and I also use the onCreateOptionsMenu method inside activity where I inflate my menu.xml file but I don't know how to gain more control over the overflow icon which is created automatically. What I'm most interested in is how to reference the menu icon So I can animate it. I don't care about the animation type. It can be a simple rotation animation Well, you play with the View

Push icons away when expandig searchview in android toolbar

 ̄綄美尐妖づ 提交于 2019-12-04 07:27:36
I'm facing this particular behaviour and I don't know how to fix it.. In my activity I have this toolbar: And when you click on the search icon it expands and pushes the other icon to out of the view. I want to know how could I keep the icon on the right and reduce the search view space. This is my menu layout: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/action_search" android:title="@string/buscar" app:actionViewClass="android.support.v7.widget.SearchView" app:showAsAction="always" /> <item

actionbar setnavigationmode deprecated

不羁的心 提交于 2019-12-04 03:38:39
问题 Hi I'm making an app in which I plan on showing floor & category wise listing of stores inside a mall. Below snap show an activity showing floor wise listing of stores I was thinking of adding a spinner in the ActionBar showing "by Floor" and "by Category" as options. Clicking on "by Category" would arrange the stores according to the category in which they belong. After googling a bit I found getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); would be apt but now I see that

Navigation Drawer menu items selected within different groups

僤鯓⒐⒋嵵緔 提交于 2019-12-04 01:36:44
I have a working Navigation Drawer and having some issues with menuItem.setChecked(true); when using groups and headers within the menu. It's not highlighting menu items as expected. Here is my XML: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context=".ActivityMap"> <group android:checkableBehavior="single"> <item android:id="@+id/nav_welcome" android:icon="@drawable/abc_btn_check_to_on_mtrl_000" android:title="Welcome" /> <item android:id="@+id/nav_map_showmap" android:icon="@mipmap/ic_map_black_24dp" android:title=

Android Bottom Navigation View item text color?

风流意气都作罢 提交于 2019-12-04 01:35:01
问题 I Started working on Android Bottom Navigation View. But i am facing one issue. If i added 5 items to bottom navigation view, only selected items showing item text. If i added 3 items it is working fine. Any one please tell me how to show the item text for all the 5 items. Thank you in advance. menu.xml: <menu 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" tools:context="com