android-actionbar

Getting DrawerLayout to Slide over the ActionBar

无人久伴 提交于 2019-12-17 10:18:05
问题 I have a sliding drawer menu in an activity, which has an actionbar with some tabs on it. I'd like to get the sliding drawer to slide over the tabs , not below them. This is what it looks like right now... Any ideas on how this could be done? Note: I understand that I might be breaking some conventions and UI patterns here, and if it does not work at all, I'll look at alternatives. But I'd like to get this working first. EDIT: See the below screen shot of the Google Play Music app that does

getActionView() of my MenuItem return null

萝らか妹 提交于 2019-12-17 07:42:21
问题 I just would like to tweak the View of an ActionBar MenuItem by code. Unfortunately, it seems that getActionView always return null! My code: @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = this.getSupportMenuInflater(); inflater.inflate(R.menu.folder, menu); return super.onCreateOptionsMenu(menu); } public boolean onPrepareOptionsMenu(final Menu menu) { MenuItem menuFolder = menu.findItem(R.id.menu_folder); Log.i("", "* onPrepareOptionsMenu *" + menuFolder);

android/view/view$onUnhandledKeyEventListener (onMeasure error)

馋奶兔 提交于 2019-12-17 07:37:57
问题 I had a problem in creating a new project in Android studio 3.1.3, whenever I created a project the design layout will throw an error message: Failed to load AppCompat ActionBar with unknown error. error screenshot: warning screenshot: style.xml (while error)--> <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">

How can I customize the Action Mode's color and text?

*爱你&永不变心* 提交于 2019-12-17 07:19:49
问题 The default action mode (3.0 and up) comes with a green theme and a 'Done' button on the left side. How can I customize these? Thanks 回答1: This is the style used for any ActionMode, I pulled it from the SDK. You'll need to create your own style to customize it. It's really easy to do. If you've never done anything like this before, you should read through this post on customizing the ActionBar. It explains everything you'll need to know. <style name="Widget.ActionMode"> <item name="android

How can I customize the Action Mode's color and text?

回眸只為那壹抹淺笑 提交于 2019-12-17 07:19:21
问题 The default action mode (3.0 and up) comes with a green theme and a 'Done' button on the left side. How can I customize these? Thanks 回答1: This is the style used for any ActionMode, I pulled it from the SDK. You'll need to create your own style to customize it. It's really easy to do. If you've never done anything like this before, you should read through this post on customizing the ActionBar. It explains everything you'll need to know. <style name="Widget.ActionMode"> <item name="android

Is it possible to change actionbar tab indicator programmatically

吃可爱长大的小学妹 提交于 2019-12-17 07:18:08
问题 How can i change programmatically the selected tab indicator of my action bar ? i have read about tab styling, and Tab.setCustomView() method, but none of these helps : With tab styles, i can change the indicator color, but it will remain for all tabs (i want to have an indicator for each tab). With tab custom view, i have used a layout with a TextView for tab title, and View for managing the indicator color. In the java i change the View 's background dynamically, but the problem with that

Android: how to hide ActionBar on certain activities

旧街凉风 提交于 2019-12-17 07:04:44
问题 I've developed a simple demo application with a splash screen a map and some regular screens. I have an action bar at the top that contains a logo. It all looks fine on my phone (Galaxy s1 I9000 V2.3) but when i test it on Galaxy s2 v4 the action bar appears also in the splash screen and in the map screen. The spalsh and map activity are not even inheriting from ActionBarActivity so how is that possible and how can i make it go away? Manifest: <application android:allowBackup="true" android

How to display both icon and title of action inside ActionBar?

寵の児 提交于 2019-12-17 07:04:41
问题 I need to display both icon and title of action inside ActionBar . I've tried " withText " option, but it has no effect. 回答1: ' always|withText ' will work if there is sufficient room, otherwise it will only place icon. You can test it on your phone with rotation. <item android:id="@id/menu_item" android:title="text" android:icon="@drawable/drawable_resource_name" android:showAsAction="always|withText" /> 回答2: You can create actions with text in 2 ways: 1- From XML: <item android:id="@id

How to add Action bar options menu in Android Fragments

若如初见. 提交于 2019-12-17 06:33:21
问题 I am trying to have a options menu in Android Fragments . ActionBar options menu are not displaying in my Fragments. Here is my code and I have both onCreateOptionsMenu() and onOptionSelected() function. My code doesn't shows any error. But options menu are not displaying. package org.reachout; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import

How to add Action bar options menu in Android Fragments

♀尐吖头ヾ 提交于 2019-12-17 06:33:10
问题 I am trying to have a options menu in Android Fragments . ActionBar options menu are not displaying in my Fragments. Here is my code and I have both onCreateOptionsMenu() and onOptionSelected() function. My code doesn't shows any error. But options menu are not displaying. package org.reachout; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import