android-actionbar-compat

Android - Activity Home/Up arrow has additional padding/margin with SDK 24

↘锁芯ラ 提交于 2019-12-03 04:22:40
问题 I've just updated my app from using SDK 23 to SDK 24. A problem has arisen for my activities that have show the Up/Home arrow (i.e., getSupportActionBar().setDisplayHomeAsUpEnabled(true) ) in that there is now additional (unwanted) space between the Up arrow and the activity title. For activities that don't have an Up arrow, the activity title is in exactly the same place as before, which suggests the additional padding/margin is associated with the Up arrow rather than with the activity

Custom (gradient) background of ActionBar Compat

半腔热情 提交于 2019-12-03 03:49:35
I am using Action Bar Compat so that my action bar with navigation drawer was backward compatible down to API level 9 and I want to change the background of the action bar. I copied the code from Android Developers : <?xml version="1.0" encoding="utf-8"?> <resources> <!-- the theme applied to the application or activity --> <style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <item name="android:actionBarStyle">@style/MyActionBar</item> <!-- Support library compatibility --> <item name="actionBarStyle">@style/MyActionBar</item> </style> <!-- ActionBar styles

Strange divider with the v7 support actionbar

流过昼夜 提交于 2019-12-03 03:43:57
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 and the actionbar. I have tried changing the actionbar style but with not much of a success.

Type The container 'Android Dependencies' references non existing library android-support-v7-appcompat/bin/android-support-v7-appcompat.jar

一曲冷凌霜 提交于 2019-12-03 00:22:39
I just got some kind of error when trying to using Action Bar Compat support library to my project, I don't know what's wrong, because I have followed the instructions from this link > http://developer.android.com/tools/support-library/setup.html So, this is the screen shot of the error .. I also encountered such problem. My error was: The container 'Android Dependencies' references non existing library 'C:\development\adt-bundle-windows-x86-20140702\workspace\appcompat_v7\bin\appcompat_v7.jar' To solve this, I went project>properties>java build path>libraries>add jars>appcompat_v7>libs>, then

How to customize the Action Bar subtitle Font?

一世执手 提交于 2019-12-02 23:16:42
I have created an ActionBar ( android.support.v7.widget.Toolbar ) as below. <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/myToolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize"> </android.support.v7.widget.Toolbar> In my ActionBar, other than the title, I also have Subtitle. However I would like to customize the Subtitle. In customize, I mean the font size, color and typeface. I've tried through various Theme and Style, and still unsuccessful. If there's a

Android 4.4 Kitkat custom view actionbar not filling the whole width

丶灬走出姿态 提交于 2019-12-02 20:43:43
I am trying to have a Simple actionbar with a custom view, but I get the following result: For demonstration I created a simple xml with a yellow background color which is supposed to take the whole width. Here is the xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/yellow" android:orientation="vertical" > <TextView android:visibility="gone" android:id="@+id/action_save" android:layout_width="wrap_content" android:layout

Android toolbar menu is not showing

橙三吉。 提交于 2019-12-02 20:19:10
I'm trying to add a menu to the ToolBar. onCreateOptionsMenu method of my Activity is called, but no menu appears. This is dashboard.xml (from menu folder) <?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.app.android.ui.dashboard.DashboardActivity"> <item android:id="@+id/action_scan_qr" android:icon="@drawable/ic_drawer" android:title="@string/menu_scan_qr" app:showAsAction="always" /> </menu> NOTE: icon of this menu is

“You need to use a Theme.Appcompat theme…” when testing ActionBarActivity, but I am

拜拜、爱过 提交于 2019-12-02 18:47:51
I have a problem when testing an app which uses ActionBarActivity from android-support-v7-appcompat via Android JUnit test in Eclipse. When running in an emulator or device everything seems to work fine. I tried using a mock application as in ActivityUnitTestCase and startActivity with ActionBarActivity and changed the parent theme in values-v11 etc. as suggested in ActionBarCompat: java.lang.IllegalStateException: You need to use a Theme.AppCompat but it still does not work. You need to use a Theme.AppCompat theme (or descendant) with this activity does not give an answer either, als the

Toolbar custom view cannot clickable

半城伤御伤魂 提交于 2019-12-02 15:42:43
问题 I need your help!!! I'm in progress to this post. I have a layout_header <RelativeLayout 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="?attr/actionBarSize" android:background="@drawable/bg_shadow_blue"> <com.andexert.library.RippleView android:id="@+id/rippleLeft" style="@style/ripple" android:layout_alignParentLeft="true" android:layout_centerVertical="true" app:rv_type

Remove action bar shadow

给你一囗甜甜゛ 提交于 2019-12-02 12:30:28
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="android:actionBarStyle">@style/TransparentActionBar</item> <item name="android:windowActionBarOverlay">true<