android-actionmode

How to display menu item Icons on Android 9 in Floating Action Mode

亡梦爱人 提交于 2019-12-10 15:57:08
问题 I have an Android menu XML that resembles this:- <item android:id="@+id/action_share" android:orderInCategory="100" android:icon="@drawable/ic_social_share" app:showAsAction="always" android:title="" /> <item android:id="@+id/action_something_else" android:orderInCategory="200" android:icon="@drawable/ic_airplanemode_active_black_24dp" app:showAsAction="always" android:title="" /> My Android code resembles this:- private void startActionMode() { startActionMode(new android.view.ActionMode

Remove default CAB items in TextView selection ActionMode

℡╲_俬逩灬. 提交于 2019-12-08 11:21:21
问题 I'm trying to remove default items, such as "Copy" and "Select All", from the CAB when the user selects some text from a TextView element. I've overridden the default action using this code, but inflating a new menu resource doesn't remove default items. textView.setCustomSelectionActionModeCallback(new ActionMode.Callback() { @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { mode.setTitle("Test"); mode.getMenuInflater().inflate(R.menu.new_menu_selection, menu); return

Remove Title from Contextual Action Bar

孤街醉人 提交于 2019-12-06 10:15:50
问题 I want to remove the view that is allocated for the title in a contextual action bar. Please note that I do not want to set the title; I want the View entirely gone. This is to allow more room so that actions can be displayed on the menu bar rather than being dropped into the overflow menu. Also note that I do not want to set android:showAsAction="always" . I want Android to decide how much space there is for the icons. I just want there to be more space by removing the blank area that is

Android - Having different ripple colors for action bar and action mode with AppCompat

99封情书 提交于 2019-12-06 07:13:49
问题 I wonder if it is possibile to have two different colors for the ripple effect in Action Bar and Action Mode. I've tried a lot of solutions but none worked. I've got this in my style.xml file: <style name="AppTheme" parent="Theme.AppCompat"> <item name="colorAccent">@color/holo_blue</item> <item name="colorControlHighlight">@color/holo_blue</item> <item name="actionModeStyle">@style/ActionModeStyle</item> </style> <style name="ActionModeStyle" parent="Widget.AppCompat.ActionMode"> <item name=

How to display popup instead of CAB when textview is selected?

我的未来我决定 提交于 2019-12-06 06:59:48
问题 I am making a reading app and it has a full screen activity. When user selects the part of the text a contextual action bar appears with option of copy. This is the default behaviour. But this actionbar blocks the text under it so user cannot select it. I want to show a popup window like below. I tried returning false from onCreateActionMode but when i do this i can't select the text either. I want to know if there is a standart way to achieve this as many reading applications use this design

Is it possible to create a custom floating text selection menu in Android versions pre Marshmallow?

旧时模样 提交于 2019-12-06 06:04:01
问题 I'm looking to create a custom menu for text selection. I know it's possible to edit the behaviour of the action bar with setCustomSelectionActionModeCallback, but in my case I don't want that action bar to show at all, I want my own floating custom menu which I have already achieved. Only thing is that there is no way to not show the action bar menu after selecting the text in the TextView. The behaviour I need is not the standard cut/copy/paste, the actions I have implemented are for

How to animate background of ActionMode of the ActionBar?

自作多情 提交于 2019-12-06 01:15:09
问题 Background It's possible to change the background of the actionbar, and even animate between two colors, as such: public static void animateBetweenColors(final ActionBar actionBar, final int colorFrom, final int colorTo, final int durationInMs) { final ValueAnimator colorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), colorFrom, colorTo); colorAnimation.addUpdateListener(new AnimatorUpdateListener() { ColorDrawable colorDrawable = new ColorDrawable(colorFrom); @Override public void

Remove Title from Contextual Action Bar

天大地大妈咪最大 提交于 2019-12-04 16:58:05
I want to remove the view that is allocated for the title in a contextual action bar. Please note that I do not want to set the title; I want the View entirely gone. This is to allow more room so that actions can be displayed on the menu bar rather than being dropped into the overflow menu. Also note that I do not want to set android:showAsAction="always" . I want Android to decide how much space there is for the icons. I just want there to be more space by removing the blank area that is reserved for a title. UPDATE Things I have tried: ActionMode.setCustomView(null) ActionMode

Material Design: Add circular reveal animation while switching between toolbars

好久不见. 提交于 2019-12-04 14:08:24
问题 I was reading the "Selection" section in material design guidelines (https://material.io/guidelines/patterns/selection.html), and one effect i wanted to add in my app was the circular reveal animation while switching between the app bar and the ActionMode ? An other toolbar ? Here is an example from the guidelines: https://storage.googleapis.com/material-design/publish/material_v_10/assets/0Bwp7jtSjaW36RGF3eUFsRkdqU1U/patterns_selection_item_controlling_desktop_click.webm I didn't found any

Change ActionMode Overflow icon

拜拜、爱过 提交于 2019-12-04 12:00:00
问题 Is there a way to change the ActionMode Overflow icon without changing the icon for the "normal" ActionBar? 回答1: I still need to figure out how to only change the Overflow-Icon inside of the ActionMode-Actionbar as I changed my Overflow-Icon in the default-Actionbar which is not visible in the ActionMode-Actionbar (and no, I don't want to change the background of my ActionMode-Actionbar!) Okay. Let's start with defining some styles. I will try and explain why we are defining them in this