Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I hide of Bubble cursor on EditText?

If you have an EditText, clicking it will show a Bubble Cursor. I show a picture below (using Twitter app as example)...

My question is:

  1. What is this called actually (I think it's not Bubble Cursor definitely)?
  2. How to disabled it from our EditText? (or from our entire Activity/Fragment/App)

enter image description here

like image 299
Elye Avatar asked Aug 16 '16 04:08

Elye


1 Answers

It's called text select handle.

There is a tricky way to hide it: replace with an 0px transparent drawable in your style.xml.

drawable/zero_px_transparent.xml

 <?xml version="1.0" encoding="UTF-8"?>
 <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
     <size android:height="0dp" android:width="0dp"/>
 </shape>

And modify your style.xml:

<style name="CustomTheme" parent="@android:style/Theme.Holo.Light">
     <item name="android:textSelectHandleLeft">@drawable/zero_px_transparent</item>
     <item name="android:textSelectHandleRight">@drawable/zero_px_transparent</item>
     <item name="android:textSelectHandle">@drawable/zero_px_transparent</item>
</style>
like image 95
anhtuannd Avatar answered Nov 09 '22 11:11

anhtuannd