I have simple button
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="#d22d2d"
android:text="Proceed"
android:textSize="35sp"
/>
On MotoG5 it shows unwanted outline on Button text, while it is okay in other devices.
This text outline does not appear in TextView. I tested it.
I checked another app in mobile, all apps (Gmail, Contacts etc.) having same behaviour.
I think there should be some theme fix to remove this unwanted outline in MotoG5.
You can disable it from Settings > Accessibility > Set off to High-contrast text
Your problem will solve.
Related
anyone has had this issue?
I am making an android app and my text within textview is a light grey. It is not very visible, but that is the effect I want.
When I look at my emulator it is fine, but when i upload the app to my android device, the text is corrected and now appears as white with a black outline.
I don't want this. I want the light grey color...
here is the actual code for the full layout for those asking:
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/activity_splash_screen"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="20dp"
android:layout_gravity="center"
android:background="#ffffff"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="some text here"
android:textColor="#888888" /> </RelativeLayout>
In the comments, #Ma3x asked in the comments:
Since also your battery level and your clock display text are white with a black outline, I assume this is something at your system's level. Do you have some high contrast accessibility turned ON or any custom system-wide UI modifications? Or is it just a default theme like that? –
That gave me the hint I needed. In Settings > accessibility > High Contrast.
One of the users of my app is having an issue where the text he enters in the EditText elements of my app is white, which effectively renders it invisible against a white background. He's the only user experiencing this issue, and it's only happening to him in my app.
As an example, here's the code for one of my EditText elements:
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/usernameTextBox"
android:imeOptions="actionDone"
android:singleLine="true"/>
There are dozens of these in my app, and all are essentially coded the same. Any ideas why this might be happening?
Every android distribution can overwrite default colors for widget. Therefore, if you want all of your EditText to look the same you should explicitly set their background and text color like so:
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/usernameTextBox"
android:imeOptions="actionDone"
android:singleLine="true"
android:background="#FFFFFF"
android:textColor="#000000"/>
To ensure that the text colour being displayed correctly, strictly set the textColor attribute for each declared TextView like so android:textColor="#android:color/black"
I had googled around but there seem no way to may the text appears on the right instead of on the default Left. image explained.
May i know is there way to make the text ("sound") appear on the right for Android Switch (Android classify them the same) ?
Switch Button
I don't know Why you are struggling with it but when I tried below code text appears right side of toggle button
<Switch
android:text="Switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/switch1"
/>
while typing into EditText, text color automatically changing from black to white, initially i set the text color to white and set hint color also white, but when testing it, it shows typing in black color on start but while in mid or reach to a random number of characters, it turns to white text. its working fine Samsung Galaxy Gio, Nexus One and on different emulators but on HTC Evo 3G and some other devices, its showing this behavior!
I tried to fix by setting style to normal, text color to white, hint color to white and other things relating to focus etc, everything is set to white but still on some devices it is showing the behavior and continues to changing color in mid of typing.
Please let me know if someone is familiar with this and fixed any issue like this.
Here is the video demonstrating the issue.
http://youtu.be/1dydBvZnSHI
Here is my xml for this EditText
<EditText
android:id="#+id/email_edittext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/textView2"
android:background="#drawable/share_email_bg"
android:ems="10"
android:lines="1"
android:maxLines="1"
android:padding="5dip"
android:singleLine="true"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:inputType="textEmailAddress"/>
Well I am answering this because some may get benefit out of this. Actually I got the same problem in one of my device and after a long struggle I found that its a very silly mistake.
To solve this we just need to add one attribute in the <EditText> node. Here is the solution :
<EditText
android:textColor="#android:color/black"
..........
/>
Use:
android:textColorHighlight="#android:color/black"
in the textEdit if you refer to edit text down line change color when editing you need to set the color on:
android:backgroundTint="#color/colorPrimaryDark"
I have a button like so:
<Button
android:id="#+id/button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#android:color/transparent"
android:text="Button"
android:textColor="#color/my_gray" />
After pressing the button, the text color turns a darker gray color (a "this has already been pressed" color). How do I prevent this? On the button press I do button.setTextColor(R.color.my_gray); to reset the color, but it has no effect.
Try using a different kind of button. CompoundButton or ImageButton might work out for you since you can control their backgrounds/images more easily.
However, the best way to do it might be to use a selector like this guide shows.