I've just noticed that all my EditText
fields in my app do not show the selection anchors correctly. For example:
However, what I expect is the correct anchors to appear such as:
A typical example of an affected EditText
in my app:
<EditText
android:id="@+id/text_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/button_send"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:inputType="text|textShortMessage"
android:layout_marginRight="4dp"
android:hint="@string/hint_chat_send" />
Also notice that the "paste" hover view has a strange white border around it in my app, but in other apps it is completely transparent.
I suspect some kind of theme issue, since it affects multiple screens in my app, but I cannot find info on which attributes may cause this.
UPDATE
So, I've spent a few way too many hours debugging the EditText
, TextView
, and Editor
framework classes to no avail. Everything appears to be functioning as expected.
I created a new blank Activity
in the same application with the following layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<EditText
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="test" />
</RelativeLayout>
In my other screens, I am using the AppCompat library and it's related themes, but in this Activity
I overrode the theme and the Activity to be a stock Android Activity
with the built-in Material theme:
public class TestActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(android.R.style.Theme_Material_Light_NoActionBar);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
}
...
It's my understanding calling setTheme
in this manner should override any possible customizations from my app styles.xml
. Still, I see this:
Kind of at a loss here still...