android-actionbar-compat

Fragment with CollapsingToolbar showing Activity Toolbar

和自甴很熟 提交于 2019-12-14 02:43:24
问题 I have a CollapsingToolbarLayout in my fragment and is showing fine, the thing is that App Toolbar is also being showed. I try this solution: Can I use CollapsingToolbarLayout in a Fragment from Navigation Drawer but is not working for me... This is my fragment AppBarLayout: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height=

ActionBar text color change while using ActionBarCompat

匆匆过客 提交于 2019-12-14 01:01:13
问题 I'm failed change the ActionBar Title color (by using ActionBarCompat ) by style.xml (not programatically) style.xml <style name="AppTheme" parent="AppBaseTheme"> <item name="android:windowBackground">@color/background_window</item> <!-- <item name="windowBackground">@color/background_window</item> --> <!-- <item name="android:actionBarStyle">@style/ActionBarStyle</item> --> <item name="actionBarStyle">@style/MyActionBar</item> </style> <style name="MyActionBar" parent="@style/Widget

How to find out the String ID of an item in the Menu knowing its decimal value?

一世执手 提交于 2019-12-13 12:08:30
问题 I am using android-support-v7-appcompat. In an activity I want to show in the actionbar the back button. I do: public class News extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.act_news_screen); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(false); } } And: @Override public boolean onOptionsItemSelected(MenuItem item) { System.out

Android - NullPointerException on SearchView in Fragment

一个人想着一个人 提交于 2019-12-13 04:59:36
问题 I am always getting searchView null at below line in my fragment class: SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem); here is my fragment class, Please find onCreateOptionsMenu method at bottom: public class FriendsListActivity extends Fragment implements EventListener { ArrayList<Users> friendList = new ArrayList<Users>(); ArrayList<Users> blockedList = new ArrayList<Users>(); ArrayList<Users> famliyList = new ArrayList<Users>(); ArrayList<Users>

How to change the color of the android actionbar without using any image resource?

感情迁移 提交于 2019-12-13 04:51:58
问题 I want to change the color of my actionbar but I'm no good at making image resources so I want to know if there is anyway it is possible to do that without images. like setting a color to some property or something? I surfed a lot but there are too many confusing answers and I can't figure out which one to use. I am developing for sdk above 8 so I'm using support libraries. Please help. 回答1: You could have easily found out the answer here. Or you can click here to create image resources very

Android - ActionBar pre Honeycomb

瘦欲@ 提交于 2019-12-13 03:40:05
问题 Good evening, i hope somebody could help me. Im developing a app where i use the action bar from the support library for pre 3.0-devices, but i have the problem, that espacially on the pre 3.0-devices no action bar is showing. When i use a device, which is higher then 3.0 it works fine. I've followed these tutorial: http://developer.android.com/guide/topics/ui/actionbar.html#Adding So my "main activity", which handles the action bar, extends from "ActionBarActivity". At these moment i figured

ActionBar aka Toolbar is black after upgrade to Support Library v21

不羁岁月 提交于 2019-12-13 02:38:07
问题 I have just upgraded to the newest library version after Android Lollipop was released. After I fixed serveral doublicated attributes (which where caused by the Support Library) I updated my android-switch-backport, and it compiled again. However now I have no more the ActionBar, it is now a Toolbar. So far so good, but now is that Toolbar black and I have no idea why. So how can I change it back to my custom colors, I used Android Action Bar Style Generator, for generating all required

ActionBar appearing in different colors with different versions of Android

雨燕双飞 提交于 2019-12-13 01:50:15
问题 I know the question seems simple, but not anything like chei here before. So there you go: In my android application using the Support Library with AppCompat v7, added an ActionBar. Everything works perfectly, except that when the application runs on android 2.3, the background of the ActionBar is dark, and when the squeegee android 4.0.2 ActionBar this background turns gray. Below is how to define my @style <resources> <!-- Base application theme, dependent on API level. This theme is

Can't format action bar Title

别说谁变了你拦得住时间么 提交于 2019-12-12 18:27:19
问题 This is probably a really simple question to answer but at the moment I can't sort it. I have my action set up as follows: // get action bar ActionBar actionBar = getSupportActionBar(); // set up the action bar layout final ViewGroup actionBarLayout = (ViewGroup) getLayoutInflater().inflate(R.layout.actionbar_layout,null); // apply layout actionBar.setCustomView(actionBarLayout); I have tried to set up the action bar title as follows: // setting action bar title actionBar.setTitle

No FEATURE_INDETERMINATE_PROGRESS in ActionBarCompat for Android 2.3-

情到浓时终转凉″ 提交于 2019-12-12 11:06:08
问题 I'm using requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); setSupportProgressBarIndeterminateVisibility(true); setSupportProgressBarIndeterminateVisibility(false); to enable/disable indeterminate progress bar. With ActionBarSherlock, it worked with all devices but when using it with ActionBarCompat, it works only for Android versions above 2.3. I thought about using WindowCompat instead of Window but WindowCompat doesn't have FEATURE_INDETERMINATE_PROGRESS flag. 回答1: