Styling the system cursor and text selection options dialog box

I integrated this color picker as a module in my application with some changes.

I find some strange style that I don’t know where it comes from. Firstly, there is a solid blue background behind the cursor when you click EditText :

enter image description here

And when you long click on the text in EditText to open the normal copy / paste options dialog, I find that there is a big solid blue background behind the dialog:

enter image description here

Where can they be, and how to remove them?

The style applicable to the dialog is as follows:

 <style name="MyAlertDialogStyleLight" parent="Theme.AppCompat.Light.Dialog.Alert"> <item name="colorAccent">@color/textColorPrimary</item> <item name="android:textColorPrimary">@color/textColorPrimary</item> <item name="android:textColor">@color/textColorPrimary</item> <item name="android:textColorAlertDialogListItem">@color/textColorPrimary</item> <item name="android:textStyle">normal</item> <item name="android:textSize">14sp</item> <item name="android:background">@color/colorPrimary</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowTitleSize">16sp</item> </style> 
+6
source share
2 answers

So, I found a fix at the end. The answer is to replace the values ​​in the following properties:

 <item name="android:windowBackground">@android:color/transparent</item> <item name="android:background">@color/colorPrimary</item> 

in

 <item name="android:windowBackground">@color/colorPrimary</item> <item name="android:background">@android:color/transparent</item> 
0
source

From what you provided, I think you should try changing android:background to transparent :

  <item name="android:background">@android:color/transparent</item> 

But this can affect other dialogs using the MyAlertDialogStyleLight style.
Hope this helps.

0
source

Source: https://habr.com/ru/post/1013953/


All Articles