android-actionbar

Gmail Android App like ActionView/Spinner (NAVIGATION_MODE_LIST)

廉价感情. 提交于 2019-12-06 10:43:13
I am trying to achieve NAVIGATION_MODE_LIST like gmail Android Application. My main issue is to hide the currently selected item from spinner list. so for example as shown here in if you select Sent then it will only have other elements shown in the spinner. My Understanding says that it is a custom ActionView rather than using NAVIGATION_MODE_LIST with custom adapter. Prashant Gami If someone else is looking for the solution to this problem here it is, Here is sample code which is written with the help of link use following code to create your adapter and join it to ActionBar List Navigation

making custom copy and paste menu appear when text is selected

試著忘記壹切 提交于 2019-12-06 10:43:11
问题 I am trying to create a custom copy and paste menu in the Action bar but when I select the text in the EditText area the default copy and paste menu will pop up, but when I long press the EditText area instead of the text, the custom menu appears in the Action bar. How can I have my custom copy and paste menu appear when the text is selected? I looked at this similar question Override the general paste context menu in Android public class MainActivity extends Activity { @Override protected

How to have android action bar back button return to fragment

半城伤御伤魂 提交于 2019-12-06 09:46:39
Hello all I have implemented a back button in the action bar in my app but I dont know how to return from an activity to a fragment or a fragment to fragment. so if someone could show me how to return from an activity to a fragment or even a fragment to another fragment that would be amazing. Here is the code i have right now public class Article extends Activity{ private WebView webview; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.articleview); // etc... getActionBar().setDisplayHomeAsUpEnabled(true); Bundle b =

How to create new LinkedIn app style ActionBar with Tabs inside it?

孤人 提交于 2019-12-06 09:16:48
问题 I'm trying to create an ActionBar with 5 tabs and a button/imageview that will open NavigationDrawer from the right side. Very similar to what LinkedIn have done in their new Android application, here is an image: I tried two methods, but non of them went well for me: I tried to created a new TabbedActivity project, the resulted layout included this: <android.support.design.widget.CoordinatorLayout android:id="@+id/main_content" xmlns:android="http://schemas.android.com/apk/res/android" xmlns

Actionbar tabs overlapping on screen rotation

放肆的年华 提交于 2019-12-06 08:46:24
For some reason, when I change the orientation of the device, the actionbar is not properly rebuilt and the tabs (sometimes shown as a spinner) are overlapped with the other menu items. I have 4 tabs (it works fine up to 3) (I use Actionbarsherlock, if relevant) On portrait, I use images instead of text for the tabs. Here's a screenshot to explain: And here's the code I use: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Set up the action bar. actionBar = getSupportActionBar(); actionBar

Use different Color for different ActionBar.Tab

馋奶兔 提交于 2019-12-06 08:38:17
问题 I want to have all tabs in ActionBar to have different Color Indicators, for example blue for tab 1, red for tab 2 etc. To achieve that I did create different selectors for all colors and put them in different xmls in drawable. In style.xml I am calling them by <style name="MyTheme" parent="AppBaseTheme"> <item name="android:actionBarTabStyle">@style/ActionBarTabStyleRed</item> </style> <style name="ActionBarTabStyleRed"> <item name="android:background">@drawable/tab_indicator_red</item> <

Android - Remove “More actions” button from the ActionBar

被刻印的时光 ゝ 提交于 2019-12-06 08:25:57
问题 I have an ActionBar that should display the action buttons in a custom way. For this I created a custom view and attached it to the ActionBar. One thing to mention is that I am using a menu.xml resoure file to load the options menu and display them on a smartphone, but do not display them on tablet, instead use a custom view. For this I market every menu item in the xml as: android:showAsAction="never" Everything looks fine, except one little thing that still remains on the right of the

How to handle drag-to-select of sub-menu items on Kitkat?

好久不见. 提交于 2019-12-06 08:20:14
Background I have an app which has sub menus in the action bar, for selecting the sorting type. It works really well if you just tap the action items. Here's how a submenu looks like on the actionBar: The code To make it easy to understand what I did, here's a short, simple version of just the sub menu part: <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.example.test.MainActivity" > <item android:icon="@drawable/ic_action_collections_sort_by_size_holo_dark"

A TaskDescription's primary color should be opaque Android 6.0

↘锁芯ラ 提交于 2019-12-06 08:14:13
my code is, if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Bitmap bm = BitmapFactory.decodeResource(context.getResources(),R.drawable.app_icon); ActivityManager.TaskDescription taskDescription = new ActivityManager.TaskDescription("AppName", bm ,R.color.colorPrimaryDark); setTaskDescription(taskDescription); } in colors.xml <color name="colorPrimaryDark">#FF9800</color> it gives error java.lang.RuntimeException: A TaskDescription's primary color should be opaque EDIT 1: manifest.xml <application android:allowBackup="true" android:icon="@drawable/app_icon3" android:label="@string

Android fullscreen activity with action bar

耗尽温柔 提交于 2019-12-06 07:59:12
问题 what theme should I use to hide the notification bar but show the action bar? (Like calculator on Samsung phones) 回答1: getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); Use this with Theme holo **you have to do it through coding add this before setContentView() ** 来源: https://stackoverflow.com/questions/27313117/android-fullscreen-activity-with-action-bar