android-actionbar-compat

Android - Having different ripple colors for action bar and action mode with AppCompat

巧了我就是萌 提交于 2019-12-04 11:56:42
I wonder if it is possibile to have two different colors for the ripple effect in Action Bar and Action Mode. I've tried a lot of solutions but none worked. I've got this in my style.xml file: <style name="AppTheme" parent="Theme.AppCompat"> <item name="colorAccent">@color/holo_blue</item> <item name="colorControlHighlight">@color/holo_blue</item> <item name="actionModeStyle">@style/ActionModeStyle</item> </style> <style name="ActionModeStyle" parent="Widget.AppCompat.ActionMode"> <item name="background">@drawable/action_mode_style</item> </style> And this is the content of the action_mode

Remove action bar shadow

怎甘沉沦 提交于 2019-12-04 06:32:43
问题 I want to remove the shadow that appears below the appcompat action bar so that the background of the action bar is completely transparent. This is my theme and action bar style: <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name=

Action Bar detect back button click in fragment

若如初见. 提交于 2019-12-04 04:55:05
问题 I have a Fragment with action bar back button enabled in it. Code : @Override public void onAttach(Activity activity) { super.onAttach(activity); setHasOptionsMenu(true); actionBar = ((MainActivity)getActivity()).getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setCustomView(R.layout.custom_action_bar); actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowCustomEnabled(true); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup

android.view.InflateException: Binary XML file line #1: Error inflating class <unknown>

空扰寡人 提交于 2019-12-04 04:04:24
Added ActionBarCompat + NavDrawer to my project, running on 4.3 device is smooth, on 2.3 device I get the following exception: 09-08 15:09:15.229: E/AndroidRuntime(2964): FATAL EXCEPTION: main 09-08 15:09:15.229: E/AndroidRuntime(2964): android.view.InflateException: Binary XML file line #1: Error inflating class <unknown> 09-08 15:09:15.229: E/AndroidRuntime(2964): at android.view.LayoutInflater.createView(LayoutInflater.java:518) 09-08 15:09:15.229: E/AndroidRuntime(2964): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 09-08 15:09:15.229: E

Replace the action bar's title with a spinner (drop down)

雨燕双飞 提交于 2019-12-04 03:42:25
I am trying to display a spinner in the same position where the action bar's default title appear. I followed the instruction of the similar SO case here , so I managed to eliminate the title but still the spinner's position is not aligned to the left, as you can see from this screen-shot Here are the main definitions of my application to reproduce this case: AndroidMenifest.xml: <application android:label="app" android:icon="@drawable/ic_launcher" android:theme="@style/Theme.AppCompat" > ... <activity android:name="gm.activities.ViewAllActivity"> <meta-data android:name="android.support

SearchView on support.v7.appcompat library issue: default 9-patch background not renders properly

落花浮王杯 提交于 2019-12-04 02:55:57
问题 I'm developing an app with ActionBar using support.v7.appcompat library. The action bar works, the SearchView is shown, the hint shows. The only problem is that the background of the SearchView is not scalling properly. Insead of the usual, it appears big and with the 9-patch black lines. Using: Developing from command line, using ant debug to compile. On Linux Mageia 3, ant version: Apache Ant(TM) version 1.8.4 compiled on January 11 2013 Linking to library with project.properties line:

How to load a circular appcompat actionbar logo using glide

旧时模样 提交于 2019-12-03 22:04:37
Till now I have done the following, if I omit the circular image creation part it works fine, but I must show a circular image in actionbar here is what I have tried so far, any help will be highly appreciated Glide.with(mContext) .load(doctorDetailsList.get(0).getDoc_imgurl().replace("200x200", Measuredwidth + "x" + Measuredwidth)) .placeholder(R.drawable.no_image) .override(Measuredwidth, Measuredwidth) .into(new Target<GlideDrawable>() { @Override public void onLoadStarted(Drawable placeholder) { } @Override public void onLoadFailed(Exception e, Drawable errorDrawable) { } @Override public

Replacing ActionBarSherlock With AppCompat

﹥>﹥吖頭↗ 提交于 2019-12-03 17:29:44
I'm currently working on a simple navigation drawer + sliding tab. However, I wanted these a material design on my own app. Therefore, I have no choice except to get rid off ActionBarSherlock . When in these attempt, I found that 2 types of imports which are as follows: import com.actionbarsherlock.app.SherlockFragment; import com.actionbarsherlock.app.SherlockFragmentActivity; has to be removed too. However, more errors seem to appear after removing it. So, is there any other type of imports that could replace these 2 above? Ye Lin Aung If you're going to use appcompat-v7 , I am sure you have

android.support.v7.widget.Toolbar icon alignment issue

不问归期 提交于 2019-12-03 15:56:05
问题 Using the new Android 5.0 Toolbar approach, and following the Google IO example, I'm setting a navigation icon and a spinner in the toolbar. The issue is, the navigation icon is BOTTOM-aligned. I can't find any reason why this is happening... [Note that I deliberately set it to a solid square to see the alignment issue more clearly] My code is as follows: toolbar.xml <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android

Strange divider with the v7 support actionbar

浪子不回头ぞ 提交于 2019-12-03 13:46:24
问题 The used theme for the actionbar is Theme.AppCompat.Light when using Theme.Holo the issue does not exists. I am using a custom view for the support v7 actionbar: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/white" > </LinearLayout> And I get the following result : How do I remove the black line/divider between the layout