android-actionbar

Which Google document should be followed for Android icon sizes?

我的未来我决定 提交于 2019-12-24 10:21:16
问题 Google's Android document on Iconography says that action bar icons should be 32x32 while its document on Action Bar Icons says that they should be 24x24 for the baseline that is presumably mdpi. I thought that Android document on Iconography was obsolete, but Google usually is good at marking obsolete/deprecate features. Could anyone shed some light on this? 回答1: This is the first time I am hearing about the site you are referring to. I believe it was the older version of "developer.android

Animating the Application Icon or Logo in the actionbar

做~自己de王妃 提交于 2019-12-24 08:20:21
问题 Is it possible to animate(rotate) the application icon in the actionbar. Not the menuItems but the application icon on the left side of the screen. I have a circular logo for my app and I need to make it more dynamic by rotating it slowly and indefinitely as long as the app is running. Thanks in Advance... Happy Coding 回答1: Action bar accepts Drawable for an icon, hence you can use AnimationDrawable and define your animation frames in resources. Look through Drawable Animation android docs to

AppCompat v7 Toolbar “Error inflating class <unknown>”

你离开我真会死。 提交于 2019-12-24 08:15:18
问题 I need to use new Toolbar feature introduced in AppCompat V7:21 after reading SO thread here and android blog post here. I exacctly copied Toolbar snippet from the blogpost to my layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout 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="match_parent" android:orientation="vertical"> <android.support.v7.widget.Toolbar <-

How to import SlidingMenu on my project with ActionBarSherlock 4.2.0 [closed]

只谈情不闲聊 提交于 2019-12-24 07:59:13
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I found https://github.com/jfeinstein10/SlidingMenu very interesting and I want to use it on my existing project with actionbarsherlock 4.2. I have imported the library of the slidingmenu as an existing project

How to get supportactionbar when my class extends ExpandableListActivity

坚强是说给别人听的谎言 提交于 2019-12-24 07:29:39
问题 I have a class which extends ExpandableListActivity to display my data as explandable list view, now my app supporting older version till API 7 how to add ActionBar using getSupportActionBar() to this class...Please help me out public class Facts extends ExpandableListActivity { public void onCreate(Bundle savedInstanceState) { try{ super.onCreate(savedInstanceState); setContentView(R.layout.facts); SimpleExpandableListAdapter expListAdapter = new SimpleExpandableListAdapter( this,

Transparent ActionBar is not working

廉价感情. 提交于 2019-12-24 03:41:36
问题 I'm not able to set the transparency or any other color to the Actionbar. My style.xml: <style name="thin_actionbar" parent="android:Theme.Holo.Light"> <item name="android:actionBarStyle">@style/thin_actionbar_style</item> </style> <style name="thin_actionbar_style" parent="android:Widget.Holo.ActionBar"> <item name="android:height">60dp</item> <item name="android:homeAsUpIndicator">@drawable/ic_drawer</item> <item name="android:background">@color/translucent_control</item> </style>

Android: Actionbar item onclick

荒凉一梦 提交于 2019-12-24 03:41:25
问题 1-To add a search item to my actionbar i have the item in this way: <item android:id="@+id/search" android:icon="@drawable/ic_action_search" android:title="@string/Search" android:showAsAction="ifRoom" /> //onCreateOptionsMenu @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); MenuInflater inflater=getMenuInflater(); inflater.inflate(R.menu.main, menu); return super.onCreateOptionsMenu(menu); } //OnOptionItemSelected public boolean

How can I change the touch affect color of Actions with ActionBarSherlock?

拟墨画扇 提交于 2019-12-24 03:40:46
问题 I have several actions all of which display properly. When I click the actions however, the color comes up as the default blueish color and it looks awful with my app. How can I change the 'selected' color of the Action? This is basically a duplicate of this question, except that one doesn't deal with ActionBarSherlock. EDIT Using the accepted answer, I am getting this error after adjusting style.xml The error is error: Error retrieving parent for item: No resource found that matches given

Dismiss the Contextual Action Bar When Nav. Drawer is Toggled

蓝咒 提交于 2019-12-24 03:07:19
问题 The official page for the Navigation Drawer design pattern states: Sometimes the user will be in a state where a contextual action bar (CAB) appears instead of the app’s action bar. This typically happens when the user selects text or selects multiple items after a press-and-hold gesture. While the CAB is visible, you should still allow the user to open the navigation drawer using an edge swipe. However, replace the CAB with the standard action bar while the navigation drawer is open. When

Error : should use android:showAsAction when not using support library

送分小仙女□ 提交于 2019-12-24 02:55:08
问题 I'm using app compact support library v7 for providing support of lollipop in my app. I was able to make it work perfectly. When my actionbar not showing menu items as icon. I have followed this link to make it work . Following is my menu.xml : <menu xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/contact_add" android:icon="@drawable/ic_btn_add_contact" android:title="@string/add" app:showAsAction="always"