android-actionbar-compat

ActionBarCompat - how to use it

允我心安 提交于 2019-11-30 02:15:10
I'm trying to use ActionBarCompat on my own project. I've already opened the sample project (http://developer.android.com/resources/samples/ActionBarCompat/index.html), But I don't know how to implement it on my own. I can't find any tutorial of some kind. Should I make this project as a library? Can someone give me some directions, please. As for implementation, just stick to the sample code provided under the MainActivity.java class. You can find it here or under <your local android-sdks folder>/samples/android-15/ActionBarCompat/src/com/example/android/actionbarcompat/MainActivity.java . In

AppCompat Action Bar library not displaying added fragments

坚强是说给别人听的谎言 提交于 2019-11-29 13:41:43
EDIT : If I extend FragmentActivity instead of ActionBarActivity my layout shows up again (without an ActionBar of course). The ActionBar works as intended on 4.x devices, but on my 2.3 device all I get is the ActionBar and a blank screen below it. The Fragment doesn't seem to be getting added to the Activity . themes.xml <style name="AppTheme" parent="AppBaseTheme"> <item name="actionBarStyle">@style/Widget.ActionBar</item> </style> themes-v11.xml <style name="AppTheme" parent="AppBaseTheme"> <item name="android:actionBarStyle">@style/Widget.ActionBar</item> </style> styles.xml <style name=

ActionBarActivity closes after pressing hardware menu button. Without stack trace

倾然丶 夕夏残阳落幕 提交于 2019-11-29 11:30:27
I have a really strange problem. When I use ActionBarActivity after clicking on hardware menu button (device with Android 2.3) the app closes unexpectedly without any particular error. Logcat gives only: W/KeyCharacterMap﹕ No keyboard for id 0 W/KeyCharacterMap﹕ Using default keymap: /system/usr/keychars/qwerty.kcm.bin 30-30/? I/DEBUG﹕ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 03-19 15:54:48.612 30-30/? I/DEBUG﹕ Build fingerprint: 'generic/sdk/generic/:2.2/FRF91/43546:eng/test-keys' 03-19 15:54:48.612 30-30/? I/DEBUG﹕ pid: 785, tid: 785 >>> com.myapp <<< 03-19 15:54:48

ActivityUnitTestCase and startActivity with ActionBarActivity

偶尔善良 提交于 2019-11-29 11:23:39
问题 I try to test a Activity which uses ActionBarActivity (from the appcompat library). I need a custom Application to be able to manipulate the DI system to load my test service instead of the real service. If I have my test written and call startActivity I get the following error: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. If I call launchActivityWithIntent the Activity starts without any problems but It is using my Real

Android expanded SearchView makes other ActionBar items disappear

大憨熊 提交于 2019-11-29 11:17:02
I'm facing some problems with a SearchView in a Contextual Action Bar called by a Fragment. The major one is that when my SearchView is expanded, it makes disappear all other items in action bar (except the closing button) even if there's some unused space, like you can see in this screenshot: Screenshot Furthermore, I'm also having the same exact problem discussed in this question: ActionBar always expanded SearchView with the icon inside This is the XML code of my SearchView: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app=

Couldn't show items with AppCompat library

时间秒杀一切 提交于 2019-11-29 10:49:54
I am having some troubles to show items in the ActionBar with AppCompat. This code works on a normal actionbar <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/item1" android:showAsAction="always" android:title="Se connecter" android:visible="true"> </item> </menu> But with the AppCompat library the item isn't shown.. What should I do ? Thanks in advance :) showAsAction is not in the android xml namespace for API < 11 try something like the following: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:yourapp="http://schemas.android

Android: AppCompat 21, how to change the back icon and the overflow icon to a custom one?

冷暖自知 提交于 2019-11-29 09:47:51
On my project until some days ago I used sherlock actionbar but I dicided to change the whole actionbar style to the new material design. On my old theme for the back and overflow icon I had some custom icons setted on my theme. But on the appcompat I tried define it on my theme where I use it on a toolbar but it's not working. Anyone knows how to make this possible? My theme where I use on the toolbar(Generated with asset studio): <style name="Theme.Themewiz" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <item name="android:actionBarStyle">@style/ActionBar.Solid.Themewiz</item> <item

Android ActionBar's custom view not filling parent [duplicate]

元气小坏坏 提交于 2019-11-29 06:08:23
问题 This question already has an answer here: Android Lollipop, AppCompat ActionBar custom view doesn't take up whole screen width 8 answers Similar to the question here, but has some key differences. Most notably being that the accepted answer did work until the latest support library releases. Here's the custom view layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match

Indeterminate Horizontal ProgressBar BELOW ActionBar using AppCompat?

假装没事ソ 提交于 2019-11-29 03:11:28
问题 I have been looking for answers on how to place the indeterminate horizontal progress bar below the action bar using AppCompat. I'm able to get the horizontal progress bar to appear, but it is at the top of the action bar. I want it under/below the action bar kind of like how gmail does it (except without the pull to refresh). I used the following code to have the progress bar appear: supportRequestWindowFeature(Window.FEATURE_PROGRESS); setContentView(R.layout.main_activity);

How to change HomeAsUp indicator in new AppCompat Toolbar?

半世苍凉 提交于 2019-11-29 00:07:27
问题 I wanna change default ActionBar homeAsUp indicator (drawable) in my AppCompat Toolbar. How to achieve that? Only default arrow shows up. styles (same for other API's level): <style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- API 14 theme customizations can go here. --> <item name="android:windowActionBarOverlay">true</item> <item name="android:homeAsUpIndicator">@drawable/home</item> <!-- Support library compatibility --> <item name="windowActionBarOverlay">true<