android-actionbar

ActionBarSherlock: changing homeAsUpIndicator doesn't work

南楼画角 提交于 2019-12-29 00:51:09
问题 I'm want to change the up icon with applying the following style to my activity, but it doesn't work and but I still get the default black '<' icon. Can anyone find out what is missing here? <style name="AppTheme.ActionBar" parent="@style/Theme.Sherlock.Light"> <item name="actionBarStyle">@style/actionBarStyle</item> <item name="android:actionBarStyle">@style/actionBarStyle</item> </style> <style name="actionBarStyle" parent="@style/Widget.Sherlock.Light.ActionBar.Solid"> <item name="android

ActionBarSherlock: changing homeAsUpIndicator doesn't work

不打扰是莪最后的温柔 提交于 2019-12-29 00:49:05
问题 I'm want to change the up icon with applying the following style to my activity, but it doesn't work and but I still get the default black '<' icon. Can anyone find out what is missing here? <style name="AppTheme.ActionBar" parent="@style/Theme.Sherlock.Light"> <item name="actionBarStyle">@style/actionBarStyle</item> <item name="android:actionBarStyle">@style/actionBarStyle</item> </style> <style name="actionBarStyle" parent="@style/Widget.Sherlock.Light.ActionBar.Solid"> <item name="android

Custom cursor color in SearchView

☆樱花仙子☆ 提交于 2019-12-29 00:25:31
问题 I want to change the color of the blinking cursor in a SearchView in the Actionbar (I'm using Actionbar Sherlock for compatibility). Until now I've managed to change the color of the cursor for a EditText element. This SO post helped me to accomplish that and the style I'm using for the EditText looks like this: <style name="CustomTheme" parent="Theme.Sherlock.Light"> <item name="android:editTextStyle">@style/edittext_style</item> </style> <style name="edittext_style" parent="@android:style

How can i exclude ActionBar when transitions between Activities on Android 5.0

亡梦爱人 提交于 2019-12-28 15:37:31
问题 On Android 5.0 Lollipop, I have two activities A and B. Activity B has a slie enter transition from bottom with a Overlay ActionBar, but when B shows, the ActionBar also slide from bottom to top. How can i prevent the actionbar from slide transition. does system actionbar has an id that i can add to the exclude target ? thanks! 回答1: If you are using the AppCompat v7 library, it is easy: View decor = getWindow().getDecorView(); int actionBarId = R.id.action_bar_container; enterTransition

Change the actionbar homeAsUpIndicator Programmatically

核能气质少年 提交于 2019-12-28 13:57:17
问题 I used the following hack to change the homeAsupIndicator programmatically. int upId = Resources.getSystem().getIdentifier("up", "id", "android"); if (upId > 0) { ImageView up = (ImageView) findViewById(upId); up.setImageResource(R.drawable.ic_action_bar_menu); up.setPadding(0, 0, 20, 0); } But this is not working on most new phones (HTC One, Galaxy S3, etc). Is there a way that can be changed uniformly across devices. I need it to be changed only on home screen. Other screens would have the

Show dropdown programmatically in ActionBar / ActionBarSherlock

余生颓废 提交于 2019-12-28 13:50:15
问题 I have an activity using ActionBarSherlock with ActionBar.NAVIGATION_MODE_LIST . When entering the page I want the spinner in the action bar to expand programmatically after it's populated with items so the user needs to pick an item. As of now the first item in the adapter is selected automatically. I can't figure out a nice way to expand the spinner in the action bar programmatically. Do I need to use a custom view to achieve this behavior? I've looked on the action bar with the

setProgressBarIndeterminateVisibility(true) not working

ε祈祈猫儿з 提交于 2019-12-28 11:47:07
问题 I'm trying to add a progress bar to my actionBar. I'm talking about the spinning circle. I did a request and tried to set is vissible, but nothing happens. I have read many likely questions but is still couldn't figure out what i'm doing wrong. My code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);//Above setContentView, very important setContentView(R.layout.activity_main)

Android Studio - just can't get action bar / overflow to work?

旧城冷巷雨未停 提交于 2019-12-28 07:01:38
问题 I'm using Android Studio (actually on Mac), only using real devices This is 4.1+ only. All projects created from fresh. CHECK - I did load support and appcompat, as best as I can understand Gradle. [A] CHECK - onCreateOptionsMenu, etc, looks good... CHECK - xml is good to go. (I do totally understand the showAsAction options, and tried them all.) [B] Regarding using text or an icon, I tried all permutations. So what happens? When I run it on a device (10+ tested). It simply shows as many

android action bar onNavigationItemSelected

纵饮孤独 提交于 2019-12-28 05:54:24
问题 I'm developing for android 3+ In my action bar i have a drop-down list(see how to hide/unhide the actionbar list on android 3? for the dropdown i intend). The problem is i need to do a certain action when the user selects something, but Android calls onNavigationItemSelected() as soons as it draws the view, so no selection actually happened. How can i detect if the user actually pressed something and it is not a fake call from android ? public class ListDittaListener implements

How to display and set click event on Back Arrow on Toolbar?

和自甴很熟 提交于 2019-12-28 03:46:12
问题 How can I set back arrow in Android toolbar and also apply click listener? 回答1: First make one toolbar.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize" android:background="@color/colorPrimary" local:theme="@style