Contextual Action Bar text selection - android

is there any way to add a custom contextual action bar when text is selected like this:
I have had a look around like here: http://developer.android.com/guide/topics/ui/menus.html#context-menu
But it really doesn't have much information an the EditText selection.
I am using a physical Android 4.0.3 device so all the API is available to me.
Anyone have any ideas?
Edit for anyone who wants to know how to do this I documented the code here
http://www.muktware.com/4022/text-selection-cab

Try setting a custom ActionMode.Callback on your EditText. You've got control over the default actions, as well as the ability to add new ones.

I have made my own version of this editing the code a bit to meet my needs, I do not believe that there is any actual way of doing this.

Related

Is it possible to customize the BottomNavBar without Icons, Change the text and Changing the selected tab background

BottomBarNavigationBar template
BottomBarNavigationBar
Note : It should follow google material design guidelines also.
Removing Bottom Navigation Bar is not possible in non-rooted android device. But you can set buttons to just above the Bottom navigation Bar,it would work fine and look nice.
For changing text style you can go through this link. It would clear your doubt.
Changing the selected tab is definitely possible. For this go through this link
And finally I am sorry that I am giving just link here, as all the questions you asked are already available on SO.
So please, next time when you ask any question, then do a detail research about it then post that here.

how to change the look and feel of a range-seek-bar?

In my application i am using range-seek-bar library to obtain this functionality.
I want to change the look and feel of the the range progress bar displayed in this library.
I have tried changing the design in similar line with this code :
click here
But could not achieve anything as the default options of a seek bar are not present in the range-seek-bar.
I want the range seek bar to be styled as :
I am not able to figure out how to solve this issue... I am struggling with this from quite a few days.
Please help ! Thanks In Advance!

How to get the files necessary for a floating action button?

All across the internet and several Stack Overflow pages, there are detailed instructions for the implementation of Floating Action Buttons, but nobody explains where I might be able to acquire the icon myself. Is everyone creating his own action buttons for his UI, or is there a downloadable library somewhere I have yet to discover?
Please link and explain!
Google doesn't provide any code for it, but it should be pretty basic to build yourself.
If you'd prefer to use a library for it, I use this one by shamanland: floating-action-button. You can change the color and icon displayed, and have it auto-hide when the user is scrolling.
There's another popular library by futuresimple here: android-floating-action-button. It includes support for sub-actions with text labels, and two button sizes, but won't give you auto-hiding on scrolling. I think I started with this one and switched to shamanland's, but I don't remember why.
I am creating Floating Action Button and shadow with .xml files as explained here and using icons from icons8.com, it has Android Lollipop specific icons.

Create Dropdown from button on menu

In android, I want to create a dropdown menu like the following:
I've seen some examples where there are just buttons, and no text (like QuickActionView), but none like this. If someone could direct me to some open source code, that'd be great, or point me in the correct direction.
Thank You in advance.
Android's ActionBar does exactly this. Unfortunately, it is only available for 3.0 and up. However, you could use ActionBarSherlock.

Android Text Selection Listener

I'm trying to create a graceful, distraction-free text editor.
One of the features I really would like to implement is a pop-up with simple text formatting commands, such as bold, italic, underline, font color, and font face.
To give you an idea, here is a picture of the popup in iOS(Obviously, this is just the idea. I want to create a custom design for the popup):
I have a few questions:
1) Is there such thing as a text selection listener, or some equivalent?
2) Will I need to override the default android action for text selection?
3) How would I display/create this popup? (Vague question, I know...)
I am just starting out in Java and Android development, but I have already created a few apps and have gotten the hang of it.
The key term you're looking for here, to help you with your research, is ActionMode, provided that your target is honeycomb or newer.
The API docs (scroll down to "using the contextual action mode) do an ok job of explaining things, once you find what you're looking for, which is the biggest barrier to their use, but basically what you're going to need to do is this:
set your EditText to be selectable (android:textIsSelectable="true" or setTextIsSelectable(true);
Implement the ActionMode.Callback interface and provide your own menu items.
NOTE: as mentioned above, this only works for API level 11+. If you're targeting earlier platforms, getting the events for text selection is much more complicated.

Categories

Resources