Hi I want to make edit text look like this
I have tried adding country picker in textinputlayout, but it never draws view as shown in layout editor
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tv_login"
android:layout_marginTop="@dimen/x60"
android:id="@+id/phone"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_centerHorizontal="true"
android:orientation="vertical">
<com.hbb20.CountryCodePicker
android:layout_width="@dimen/x40"
android:layout_height="wrap_content"
app:ccp_defaultNameCode="US"
app:ccp_defaultLanguage="ENGLISH"
app:ccp_arrowColor="@color/colorPrimary"
app:ccp_textGravity="RIGHT"/>
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:hint="Phone Number"
android:drawablePadding="@dimen/x16"
android:inputType="phone"
android:id="@+id/et_phone"
android:drawableStart="@drawable/ic_phone_outline"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
Country picker goes below the textinputlayout always, even I set orientation to horizontal
First Need to create a background
1- Create a drawable resource File and name it whatever you want
2- Now Create Download Pakistan's Flag Image from Here and name it flag_pk
3- Import Vector Asset call Icon and name it to tmep_call
4- Now copy-paste the code given below into the layout where you need your editText
Now comes the real part
END result will look like this
5: NOTE:: YOU NEED TO REPLACE THE TEXT "+92" WITH YOUR CODE PICKER"