AutoCompleteTextView strange behaviour in LolliPop Device
R

2

7

I am using AutoCompleteTextView in my layout. But it's colorControlNormal and Activate is not Working as I expected.

My Color value is #0072BA.

Below is figure for Different Device.

1.) Android Kitkat

enter image description here

2.) Android LolliPop

enter image description here

3.) Android Marshmallow

enter image description here

Xml code that i used is below

 <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColor="@color/md_black_1000"
        android:layout_marginTop="5dp"
        android:textSize="15sp"
        android:text="Medical Store Name"
        android:textColorHint="#999999"
        android:layout_below="@+id/search_drug_store"
        android:id="@+id/autoCompleteTextView_storename"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="10dp"/>

<AutoCompleteTextView
    android:id="@+id/autoCompleteTextView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ems="10"
    android:textSize="12sp"
    android:textColor="#999999"
    android:layout_below="@+id/autoCompleteTextView_storename"
    android:layout_marginLeft="25dp"
    android:inputType="textNoSuggestions"
    android:layout_marginRight="10dp"/>

I am not giving any style to AutoCompleteTextView then Why it's Happening ?

What I Have Try :

If i give this Style

Reference Material Design link :

http://www.materialdoc.com/autocomplete-view/

and give this style

 <style name="Autocomplete" parent="Widget.AppCompat.Light.AutoCompleteTextView">
    <item name="android:background">@color/green500</item>
    <item name="colorControlNormal">@color/amber500</item>
    <item name="colorControlActivated">@color/cyan500</item>
</style> 

But in Lollipop nothing has Change.

Is this bug in lollipop version or i am doing something wrong ?

Retiring answered 21/8, 2016 at 4:39 Comment(0)
A
0

actually this is not solution to this problem but you can use this for unique design all over device. i have implemented for edittext like this in xml,set background null for edittext and add horizontal line below edittext.

 <EditText
        android:id="@+id/newPasswordEditText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginRight="@dimen/activity_horizontal_margin"
        android:layout_marginLeft="@dimen/activity_horizontal_margin"
        android:background="@null"
        android:textColor="@color/color_black"
        android:inputType="textPassword"
        android:layout_marginBottom="10dp"
        android:hint="Enter New Password"
        android:layout_marginTop="10dp"
        android:textSize="14sp"
        android:layout_below="@+id/titleTextView" />

    <LinearLayout
        android:id="@+id/linearLayout2"
        android:layout_width="match_parent"
        android:layout_height="2dp"
        android:orientation="horizontal"
        android:layout_marginBottom="7dp"
        android:layout_marginLeft="@dimen/activity_horizontal_margin"
        android:layout_marginRight="@dimen/activity_horizontal_margin"
        android:layout_below="@+id/newPasswordEditText"
        android:background="@color/color_standard_green" /> 
Andean answered 23/8, 2016 at 5:5 Comment(1)
I am using AutoCompleteTextView not the EditText so this is not work for me.Retiring
R
0

There is no bug in lollipop version you just not override the style of theme with your style,use in this way https://mcmap.net/q/98566/-changing-edittext-bottom-line-color-with-appcompat-v7

Ranch answered 23/8, 2016 at 7:21 Comment(1)
This color in editText support theme settings in lollipop,please check if you done it right.Ranch

© 2022 - 2024 — McMap. All rights reserved.