android-actionbar

Android Toolbar actionLayout of Switch causes text to jump when menu is pressed

我是研究僧i 提交于 2020-01-21 05:26:05
问题 Please refer to my project at: https://github.com/paulpv/ToolbarSwitch I am working on a simple custom layout for the Android Toolbar (aka: new ActionBar). This simple control adds a Switch to the Toolbar, and can be seen here highlighted in magenta: My problem is that immediately when the overflow menu is pressed, the Switch's Text jumps to the top of the Toolbar, and remains that way when you close the overflow menu: A similar thing happens in Landscape orientation (the subtle difference

How to keep expanded SearchView on the right side of ActionBar (while using custom icon)?

丶灬走出姿态 提交于 2020-01-20 04:58:04
问题 My question is closely related to SearchView wrong alignment and SearchView positions when expanded in ActionBar but the answers posted there do not work. So, I'm using a SearchView in the Action Bar: <item android:id="@+id/action_search" android:icon="@drawable/navi_search" android:title="@string/action_search" android:showAsAction="ifRoom|collapseActionView" android:actionViewClass="android.widget.SearchView" /> It looks like this by default (top-right corner, next to overflow menu):

onCreateOptionsMenu is being called too many times in ActionBar using tabs

二次信任 提交于 2020-01-19 23:19:12
问题 Here is my problem. I have an app where I am using ActionBar Sherlock with tabs, fragments with option menus. Every time I rotate the emulator, menus are added for all the fragments even those that are hidded/removed (I tried both). This is the setting: One FragmentActivity, that has an ActionBar with final ActionBar bar = getSupportActionBar(); bar.addTab(bar.newTab() .setText("1") .setTabListener(new MyTabListener(new FragmentList1()))); bar.addTab(bar.newTab() .setText("2") .setTabListener

Change Google Places picker Action bar color

杀马特。学长 韩版系。学妹 提交于 2020-01-17 13:09:45
问题 Good morning, i am quite new in Android and i have a problem setting the color of the built-in action bar in Google Places Picker. The documentation of this one clearly says that the action bar color inherits the matherial theme style of the project. The problem is that i have Theme.AppCompat.Light.NoActionBar and the color of this style isn't passed to the Google Place Picker because it uses only the colors of material themes. I would like to ask if it's somehow possible to replace Theme

change title text color of action bar

自作多情 提交于 2020-01-17 09:11:24
问题 I Used android action bar style generator to produce my action bar but I want to change color of action bar title this is code with generator gives me : style.xml <resources> <style name="Theme.Example" parent="@style/Theme.AppCompat.Light"> <item name="actionBarItemBackground">@drawable/selectable_background_example</item> <item name="popupMenuStyle">@style/PopupMenu.Example</item> <item name="dropDownListViewStyle">@style/DropDownListView.Example</item> <item name="actionBarTabStyle">@style

Unable to start new Activity:android

折月煮酒 提交于 2020-01-17 04:23:06
问题 I have added a new activity through right clicking on app. New >Activity >Navigation Drawer Activity . http://i.stack.imgur.com/Pdtbo.png Now i am not able to start this activity from MainActivity . And getting following errors. Please help me. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app.atlasmobile/com.app.atlasmobile.Pois_main}: android.view.InflateException: Binary XML file line #19: Error inflating class fragment at android.app.ActivityThread

Null pointer exception at action bar

爷,独闯天下 提交于 2020-01-16 01:54:19
问题 I am getting null pointer exception at action bar. I am using getActionBar() .Following are the errors..I am extending Activity java.lang.RuntimeException: Unable to start activity ComponentInfo{com.peoplecloud.guggu/com.peoplecloud.guggu.activity.LandingActivity_}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2211) at android.app.ActivityThread.access$600

ActionBar android with custom shape

女生的网名这么多〃 提交于 2020-01-16 00:46:16
问题 I have to develop an actionBar with a custom shape for an android app. The actionBar is a rectangle as always, but every option (icon) I add to the actionBar has to be bigger than the actionBar and with a circle shape. Any ideas how to implement that feature? I can't find how to solve this problem. Thanks. 回答1: I think you should remove the ActionBar completely and make your own custom view with desired content (as mentioned) and put that view on top of each activity. Customizing action bar

Action Bar Tabs - Having two fragments (one being dynamic) in one tab

喜夏-厌秋 提交于 2020-01-15 22:29:30
问题 I am trying to create a tab that displays a list on the left hand fragment and a detailed fragment on the right. When a user clicks a list item, the right hand fragment should change to the appropriate one. I am new to android so I used a tutorial and I know I need to do something with the tablistener: public static class TabListener implements ActionBar.TabListener { private final Activity mActivity; private final String mTag; private final Class mClass; private final Bundle mArgs; private

How to change Sherlock action bar text color programatically?

六眼飞鱼酱① 提交于 2020-01-15 16:39:11
问题 How can you change the tab text color of the action bar from Java code? Not switching to a different theme that was defined in an XML file, but something like .setTextColor(Color.GREEN). If there were a way to get the current (not custom) view, maybe I could try grabbing the TextView from there and changing it. 回答1: Figured it out.... You can pass in a SpannableString: SpannableString spannable = new SpannableString(myString); spannable.setSpan(new ForegroundColorSpan(Color.GREEN), 0,