android-actionmode

How to make contextual actionmode bar overlay my layout instead of “pushing” it down

北慕城南 提交于 2019-12-03 06:29:38
问题 I have implemented my own viewgroup for my application. Using actionbar is not an option for various reasons so in my viewgroup I have my own "actionbars" one on top and one in the bottom. Image 1 illustrates my current layout. As you can see there are two edittexts in the layout and everything looks ok. However when the user selects some text in any of the edittexts the contextual actionmode bar is shown. Image 2 illustrates this. When this happens actionmode bar "pushes" down my entire

When using ActionMode, the status bar turns black on Lollipop

折月煮酒 提交于 2019-11-30 08:02:23
I have a status bar with the following in the theme set on it: <!-- Base Theme for all "Material"-esque styles. We use NoActionBar so we can use the Toolbar at runtime. --> <style name="Material" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:windowDrawsSystemBarBackgrounds">true</item> <item name="android:windowTranslucentStatus">true</item> ... </style> I also have a DrawerLayout for most of my activities, which sets the color of the status bar to my liking using: mDrawerLayout.setStatusBarBackgroundColor(getResources().getColor(R.color.myapp_green)); I am using a Toolbar ,

The method startSupportActionMode(ActionMode.Callback) is undefined for the type FragmentActivity?

喜你入骨 提交于 2019-11-29 23:03:31
问题 I'm want to implement Action Mode Compact in Fragment Android. But I get error The method startSupportActionMode(ActionMode.Callback) is undefined for the type FragmentActivity in my code : list.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { getActivity().startSupportActionMode(modeCallBack); return true; } }); get error at getActivity().startSupportActionMode

When using ActionMode, the status bar turns black on Lollipop

◇◆丶佛笑我妖孽 提交于 2019-11-29 10:56:33
问题 I have a status bar with the following in the theme set on it: <!-- Base Theme for all "Material"-esque styles. We use NoActionBar so we can use the Toolbar at runtime. --> <style name="Material" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:windowDrawsSystemBarBackgrounds">true</item> <item name="android:windowTranslucentStatus">true</item> ... </style> I also have a DrawerLayout for most of my activities, which sets the color of the status bar to my liking using:

Webview text selection not clearing

泄露秘密 提交于 2019-11-28 21:56:22
I have implemented an ActionMode.Callback for custom text selection functions within a WebView . The problem that I am having is that the selection and the action mode states do not match. When I long-press, everything starts out just fine. When I interact with one of the buttons, or the WebView (excluding the actual selection) then the ActionMode should be destroyed, and the selection should disappear. In Android 4.4, KitKat, this is exactly what happens. However, this is not what is happening in 4.1.1 - 4.3, Jelly Bean. When I click one of the buttons, the selection is not removed. When I

Remove “Done” button of ActionMode

喜夏-厌秋 提交于 2019-11-28 05:25:19
0I'm using startActionMode(ActionMode) on my app. By default it's add a "Done" button on the bar, I want to remove it. Also, if there's a way to change it's text, I want to know too, cause a different description than "Done" can make the action be correspondent to the behaviour of what it does. Even I was stuck with same and I found this way to solve it. int doneButtonId = Resources.getSystem().getIdentifier("action_mode_close_button", "id", "android"); LinearLayout layout = (LinearLayout) findViewById(doneButtonId); TextView doneview = (TextView) layout.getChildAt(1); doneview.setText("");

Webview text selection not clearing

*爱你&永不变心* 提交于 2019-11-27 14:06:30
问题 I have implemented an ActionMode.Callback for custom text selection functions within a WebView . The problem that I am having is that the selection and the action mode states do not match. When I long-press, everything starts out just fine. When I interact with one of the buttons, or the WebView (excluding the actual selection) then the ActionMode should be destroyed, and the selection should disappear. In Android 4.4, KitKat, this is exactly what happens. However, this is not what is

Display ActionMode over Toolbar

北城以北 提交于 2019-11-27 11:24:25
I am trying to use the android.view.ActionMode with the new android.support.v7.widget.Toolbar , in addition to the traditional android.app.ActionBar . I am able to display it with: toolbar.startActionMode(callback); The problem is that the ActionMode is displayed over the ActionBar , and not over the Toolbar . Is there a way to change that? I tryied to set the following in my theme, but it does not seem to change anything: <item name="windowActionModeOverlay">true</item> Kuffs Since you are using the Toolbar , I also assume you are using the AppCompatActivity and have replaced the built in

How to change ActionMode background color in Android

江枫思渺然 提交于 2019-11-27 04:31:49
i am creating an android app in which support level api is 7 so i am using sherlock actionbar. I am using action mode in it. Issue is i want to change the background of action mode. So i have tried <item name="android:background">@color/something</item> <item name="android:backgroundStacked">@color/something</item> <item name="android:backgroundSplit">@color/something</item> these style solution's available but none of them works. http://i43.tinypic.com/2nriic1.png Shayan Pourvatan if you want change the color of ActionBar just do this: ActionBar bar = getActionBar(); bar.setBackgroundDrawable

How can I customize the Action Mode's color and text?

五迷三道 提交于 2019-11-27 03:54:10
The default action mode (3.0 and up) comes with a green theme and a 'Done' button on the left side. How can I customize these? Thanks adneal This is the style used for any ActionMode, I pulled it from the SDK. You'll need to create your own style to customize it. It's really easy to do. If you've never done anything like this before, you should read through this post on customizing the ActionBar. It explains everything you'll need to know. <style name="Widget.ActionMode"> <item name="android:background">?android:attr/actionModeBackground</item> <item name="android:backgroundSplit">?android