android-actionmode

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

巧了我就是萌 提交于 2019-12-04 11:56:42
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="background">@drawable/action_mode_style</item> </style> And this is the content of the action_mode

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

☆樱花仙子☆ 提交于 2019-12-04 10:05:12
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 highlighting and saving the highlighted section of text to a database. I have done some tinkering and the

contextual action mode in fragment - close if not focused?

筅森魡賤 提交于 2019-12-04 09:31:11
问题 i implemented a contextual action mode bar in a nested fragement. This fragment is part of a view pager and the view pager is also a fragment and part of a navigation drawer. My Problem: I want to close the contextual action mode bar if the fragment is no more focused. So, if I swipe through the view pager the action mode bar should close. But if I use the onPause() method of the nested fragment, the method is not called directly. Often it waits until i swiped two or three times forward...

How to animate background of ActionMode of the ActionBar?

大憨熊 提交于 2019-12-04 07:49:01
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 onAnimationUpdate(final ValueAnimator animator) { colorDrawable.setColor((Integer) animator

android webview: prevent text selection actionMode actionBar

╄→гoц情女王★ 提交于 2019-12-04 05:37:58
I want to preserve the text selection in a webView while preventing any contextual menu of the actioMode from being shown. Neither the new floating one nor the old actionBar, just the selection handles and of course the selection behaviour. Hooking to the actionModeCallback in startActionMode allows me to clear all items in the menu in the callback onCreateActionMode. This works fine on android 6, since an empty floating menu won't show at all, and the actionMode text selection behaviour is preserved. Unfortunately on android < 6 this leaves an empty actionBar shown, how can I completely

Couldn't resolve resource @style/Widget.Holo.Light.ActionMode.Inverse

拈花ヽ惹草 提交于 2019-12-04 02:33:47
I'm creating an Android app in Android Studio. When I open the layout editor, I see that gray "popup window" on top of the layout, which says that it Couldn't resolve resource @style/Widget.Holo.Light.ActionMode.Inverse. This happens when I change the "rendering version" to API 15 ( Android 4.0.3 ). It worked a minute ago, but when I switched back to the layout, I just got this error. Edit: I use the AppCompat library. The theme is defined like this <style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar" /> The app works fine when I run it, but doesn't render correctly (at

How to specify dark action mode with my theme

老子叫甜甜 提交于 2019-12-03 09:41:15
问题 I know there are a couple of questions about styling the contextual action bar (ActionMode) piece of the action bar, but they don't quite seem to address what I'm after. I'm using the Toolbar with a light theme and dark action bar. The Toolbar looks like I want it, but the action mode looks like the regular dark theme. What do I need to change in my style to get the dark themed action mode (not just action bar)? It seems I should be able to do this quickly by tapping into Theme.AppCompat

Material Design: Add circular reveal animation while switching between toolbars

走远了吗. 提交于 2019-12-03 08:56:19
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 explanations about how to do that. I do not even know if they use an ActionMode or something else...

contextual action mode in fragment - close if not focused?

佐手、 提交于 2019-12-03 07:55:23
i implemented a contextual action mode bar in a nested fragement. This fragment is part of a view pager and the view pager is also a fragment and part of a navigation drawer. My Problem: I want to close the contextual action mode bar if the fragment is no more focused. So, if I swipe through the view pager the action mode bar should close. But if I use the onPause() method of the nested fragment, the method is not called directly. Often it waits until i swiped two or three times forward... Here are some pictures: In the second picture you can see that the action mode bar is still there. So my

Change ActionMode Overflow icon

走远了吗. 提交于 2019-12-03 07:51:43
Is there a way to change the ActionMode Overflow icon without changing the icon for the "normal" ActionBar? 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 fashion: // This is just your base theme. It will probably include a lot more stuff. // We are going to define