I need to create a shadow for EditText as shown here - design .
I was able to partially recreate the same using the code below.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SignupActivity">
<ImageView
android:id="#+id/signinPageLogo"
android:layout_width="171dp"
android:layout_height="160dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="132dp"
android:src="#drawable/dummy_logo" />
<TextView
android:id="#+id/signinAppName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/signinPageLogo"
android:layout_centerHorizontal="true"
android:text="#string/welcomePageText1"
android:textSize="30sp"
android:textStyle="bold" />
<androidx.cardview.widget.CardView
android:id="#+id/signinEmailIdCardView"
android:layout_width="234dp"
android:layout_height="73dp"
android:layout_below="#+id/signinAppName"
android:layout_centerHorizontal="true"
android:layout_marginStart="6dp"
android:layout_marginTop="109dp"
android:layout_marginEnd="6dp"
android:outlineSpotShadowColor="#color/teal_700"
android:layout_marginBottom="10dp"
app:cardCornerRadius="10dp"
app:cardElevation="4dp"
app:cardUseCompatPadding="true">
<EditText
android:id="#+id/signinEmailId"
android:layout_width="211dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#drawable/rounded_edittext"
android:hint="#string/signinPageText1"
android:inputType="textEmailAddress"
android:padding="10dp" />
</androidx.cardview.widget.CardView>
<com.google.android.material.textfield.TextInputLayout
android:id="#+id/signinPassword"
android:layout_width="211dp"
android:layout_height="wrap_content"
android:layout_below="#id/signinEmailIdCardView"
android:layout_centerHorizontal="true"
app:boxBackgroundColor="#color/white"
app:boxBackgroundMode="none"
app:hintEnabled="false"
app:passwordToggleDrawable="#drawable/show_password_selector"
app:passwordToggleEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/signinPageText2"
android:inputType="textPassword" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="#+id/signinForgotPass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/signinPassword"
android:layout_alignEnd="#id/signinPassword"
android:text="#string/signinPageText3" />
<androidx.appcompat.widget.AppCompatButton
android:id="#+id/signinButton"
android:layout_width="256dp"
android:layout_height="64dp"
android:layout_below="#+id/signinForgotPass"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="#drawable/button_style"
android:gravity="center"
android:text="#string/welcomePageText1"
android:textAllCaps="false" />
</RelativeLayout>
But I need to increase the shadow length to get the correct effect. The design I am able to produce now - my design
The android:outlineSpotShadowColor is limited to above 28 api only. so is there any other alternative for this? Please advice to get this shadow effect properly.. Thanks a lot!
You can try using the "elevation" property. Here is the documentation: https://developer.android.com/training/material/shadows-clipping .
To change the color you will need to use Carbon (https://github.com/ZieIony/Carbon). You could also see this answer: Android change Material elevation shadow color .
Related
short clip of the issue
In the clip above you will be able to see the problem better.
Switching between Fragments user can see on the icon on the material button a grey box shaped element for short time.
I tried using both the emulator and a real device. Since im using Lottie in my project, custom made svg imported icons it started.. I think I am not quite sure what causing this.
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="14dp"
android:clickable="true"
app:cardCornerRadius="4dp"
app:cardElevation="8dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageViewWorkout"
android:layout_width="60dp"
android:layout_height="60dp"
android:src="#drawable/ic_training_arm" />
<TextView
android:id="#+id/workoutDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:layout_toEndOf="#id/imageViewWorkout"
android:text="workout date"
android:textSize="16sp"
android:visibility="gone" />
<TextView
android:id="#+id/workoutName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:layout_toEndOf="#id/imageViewWorkout"
android:layout_toRightOf="#id/workoutCalories"
android:text="workout name"
android:textSize="16sp" />
<TextView
android:id="#+id/workoutCalories"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/workoutName"
android:layout_marginStart="14dp"
android:layout_toEndOf="#id/imageViewWorkout"
android:text="workout calories"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
android:id="#+id/deleteButton"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_below="#id/workoutName"
android:layout_alignParentRight="true"
android:background="#drawable/delete_foreground" />
<com.google.android.material.button.MaterialButton
android:id="#+id/editButton"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_alignParentRight="true"
android:layout_toStartOf="#id/deleteButton"
android:background="#drawable/edit_foreground" />
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>
I am developing android app and how can I create ui like below picture
and below my xml I have played around but it is not giving expected output any suggestion will be greatly appreciated and hints welcome I dont know where exactly I am making mistake
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
card_view:cardPreventCornerOverlap="false"
card_view:cardCornerRadius="50dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="#+id/articleTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/articleSource"
android:paddingBottom="45dp"
android:text="22222222"
tools:layout_editor_absoluteX="25dp"
tools:layout_editor_absoluteY="16dp" />
<ImageView
android:layout_width="60dp"
android:contentDescription="#string/bbc_sport"
android:layout_height="60dp"/>
<TextView
android:id="#+id/articleSource"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="90dp"
android:text="News blalalalal"/>
<TextView
android:id="#+id/articleTime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="90dp"
android:text="News blalalalal"/>
</androidx.constraintlayout.widget.ConstraintLayout
>
</androidx.cardview.widget.CardView>
If you mean item list you maybe can do this
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp">
<ImageView
android:id="#+id/imageView"
android:layout_width="100dp"
android:layout_height="85dp"
android:layout_marginStart="16dp"
android:contentDescription="bbc"
tools:background="#color/colorPrimary" />
<TextView
android:id="#+id/articleTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_toEndOf="#id/imageView"
android:ellipsize="end"
android:lines="3"
android:maxLines="3"
android:text="1\n2\n3\n" />
<ImageView
android:id="#+id/imageCategory"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_below="#id/articleTitle"
android:layout_marginStart="16dp"
android:layout_toEndOf="#id/imageView"
tools:background="#color/colorPrimary" />
<TextView
android:id="#+id/articleCategory"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:layout_below="#id/articleTitle"
android:layout_marginStart="16dp"
android:layout_toEndOf="#id/imageCategory"
android:gravity="center|start"
android:text="Onefootbal" />
<TextView
android:id="#+id/articleTime"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:layout_below="#id/articleTitle"
android:layout_alignParentEnd="true"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_toEndOf="#id/articleCategory"
android:gravity="center|start"
android:text="- 1h"
android:textColor="#android:color/darker_gray" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
If you are looking for a way to build the whole screen I'd suggest you using Epoxy library by Airbnb https://github.com/airbnb/epoxy
You will basically treat this screen as RecyclerView which has 2 types of layouts - item without image (as the one on top) and item with image (all the bottom ones).
It will take some time to learn the library but it will be very handy especially if your layout is reusable and other screens use similar items
I am trying to build the following layout on Android:
As indicated by the dotted lines:
- The two TextViews should be left aligned.
- The ImageView should be center aligned with the title TextView
The labels should be anchored relative to the parent and each other as indicated in the sketch.
I have tried to implement this using ConstrainedLayout which gets me pretty far. But the tricky part is the alignment of image and title.
I would need an attribute like layout_constraintCenter_toCenterOf which unfortunately does not exist.
EDIT: ### removed hard-coded height ###
There was an unwanted hardcoded height in my code (marked in example below). After removing that it works fine for me.
But the question stands: What is the 'right' way to center-align views?
My solution feels like a hack.
#######################################
This is what I got so far:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:padding="5dp">
<ImageView
android:id="#+id/image1"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="8dp"
android:layout_weight="0"
android:adjustViewBounds="true"
android:contentDescription="#null"
app:layout_constraintEnd_toStartOf="#+id/titleText"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/titleText"
android:layout_width="0dp"
### edit: this line must go:
### android:layout_height="19dp"
android:layout_marginStart="158dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
app:layout_constraintBottom_toBottomOf="#+id/image1"
app:layout_constraintTop_toTopOf="#+id/image1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/image1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="parent"
tools:text="title" />
<TextView
android:id="#+id/detailText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginEnd="8dp"
android:layout_weight="0"
android:gravity="center_vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/titleText"
app:layout_constraintTop_toBottomOf="#+id/titleText"
app:layout_constraintBottom_toBottomOf="parent"
tools:text="subtitle" />
</android.support.constraint.ConstraintLayout>
I have tried to work around by aligning top and bottom which looks right in the preview but causes glitches in the real app:
app:layout_constraintBottom_toBottomOf="#+id/image1"
app:layout_constraintTop_toTopOf="#+id/image1"
Maybe ConstrainedLayout is the wrong tool for the job altogether.
What is the 'right way' to implement this layout in Android?
You may try this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:orientation="horizontal"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="10dp"
android:src="#drawable/connected_icon_png" />
<View
android:layout_width="10dp"
android:layout_height="0dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingTop="10dp">
<TextView
android:id="#+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:text="Title Label"/>
<TextView
android:id="#+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:maxLines="2"
android:text="Content that you want" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"/>
</LinearLayout>
</LinearLayout>
You may able to do further edit if you need.
Happy Coading
Snapshot:
use your widgets inside relative layout.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true"
android:padding="5dp">
<ImageView
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:id="#+id/image1"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="8dp"
android:src="#color/colorAccent"
android:adjustViewBounds="true"
android:contentDescription="#null"
app:layout_constraintEnd_toStartOf="#+id/titleText"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/titleText"
android:layout_width="match_parent"
android:layout_height="19dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:ellipsize="end"
android:text="abcjdnadnaadjdndd"
android:layout_toRightOf="#id/image1"
android:gravity="center_vertical"
android:maxLines="1"
app:layout_constraintBottom_toBottomOf="#+id/image1"
app:layout_constraintTop_toTopOf="#+id/image1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/image1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="parent"
tools:text="title" />
<TextView
android:layout_toRightOf="#id/image1"
android:textAlignment="center"
android:layout_below="#id/titleText"
android:id="#+id/detailText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginEnd="8dp"
android:text="sadhbhaeadhbaedn"
android:gravity="center_vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/titleText"
app:layout_constraintTop_toBottomOf="#+id/titleText"
tools:text="subtitle" />
</RelativeLayout>
I have a question.
Why android:elevation doesn't show shadows? I am making shadows first time
Only used in ImageButton it's working (when I use with android:background it isn't working)
This is my code:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:text="TestBTT"
android:layout_width="295dp"
android:layout_height="41dp"
android:padding="10dp"
android:elevation="30dp"
android:outlineProvider="bounds"
android:background="#drawable/przycisk"
android:id="#+id/button2" android:layout_marginTop="60dp"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="72dp"/>
<ImageButton
android:layout_width="247dp"
android:layout_height="61dp"
android:id="#+id/imageButton" android:layout_marginTop="188dp"
android:elevation="20dp"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="72dp" android:cropToPadding="true" android:adjustViewBounds="true"/>
<TextView
android:text="TextView"
android:elevation="40dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView" android:textSize="24sp"
android:layout_marginTop="360dp" app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="196dp"
app:layout_constraintStart_toStartOf="parent"/>
What to do to make the shadows appear under the button?
And what to do to show up under the button where is android: background?
The default Button style under Material has a StateListAnimator
that controls the android:elevation and android:translationZ
properties.
copied from here
just add this property to your Button. you can set your own using the android:stateListAnimator property.
android:stateListAnimator="#null"
full code :
<Button
android:id="#+id/my_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:elevation="2dp"
android:translationZ="2dp"
android:stateListAnimator="#null"
android:background="#android:color/holo_green_light"
android:text="BUTTON">
UpDate :
for Understanding I set it 10dp..
xml code :
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp">
<Button
android:id="#+id/my_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:elevation="10dp"
android:translationZ="10dp"
android:stateListAnimator="#null"
android:background="#android:color/holo_green_light"
android:text="BUTTON"/>
</RelativeLayout>
I am trying to use material design textfields in my android project.
Problem
when I use TextInputLayout and TextInputEditText in my xml code, I get an error that these two classes are not recognised or found.
I tried importing design support library but that didn't work.
Question
How can I use material design textfields in my android project?
My Target SDK version is 28
Here's my xml code
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:background="#android:color/background_light"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:id="#+id/pickImgBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Pick Image"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="0dp"
app:layout_constraintTop_toTopOf="parent"
style="?android:attr/borderlessButtonStyle"
android:onClick="pickImage" />
<com.google.android.material.textfield.TextInputLayout
android:id="#+id/textfieldContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="#id/pickImgBtn">
<com.google.android.material.textfield.TextInputEditText
android:id="#+id/toptextfield"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="add top text"
android:padding="10dp"
android:layout_margin="10dp" />
<com.google.android.material.textfield.TextInputEditText
android:id="#+id/bottomtextfield"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="add top text"
android:padding="10dp"
android:layout_margin="10dp" />
</com.google.android.material.textfield.TextInputLayout>
<Button
android:id="#+id/createMemeBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Create Meme"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
app:layout_constraintTop_toBottomOf="#id/textfieldContainer"
style="?android:attr/borderlessButtonStyle" />
<android.support.constraint.ConstraintLayout
android:id="#+id/memeLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="51dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintLeft_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="#id/createMemeBtn">
<ImageView
android:id="#+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#android:color/darker_gray"/>
<TextView
android:id="#+id/toptext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Insert Top Text Here"
android:layout_weight="0"
android:textSize="25sp"
android:layout_marginLeft="5dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:textStyle="bold"
android:textColor="#fff"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="#+id/bottomtext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="Insert Bottom Text Here"
android:textSize="25sp"
android:layout_marginLeft="5dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:gravity="center"
android:textStyle="bold"
android:textColor="#fff"
app:layout_constraintBottom_toBottomOf="parent"/>
</android.support.constraint.ConstraintLayout>
<Button
android:id="#+id/saveMemeBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Save Image"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
app:layout_constraintTop_toBottomOf="#id/memeLayout"
style="?android:attr/borderlessButtonStyle" />
</android.support.constraint.ConstraintLayout>
You need to use below code:
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_email"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/input_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/hint_email" />
</android.support.design.widget.TextInputLayout>
If you want to use Material Text Fields you need to add Material Library
implement com.google.android.material:material:1.0.0-beta01
Note: You should not use the com.android.support and com.google.android.material dependencies in your app at the same time.
Please read instructions here
try to complie this in gradle
implementation 'com.android.support:design:28.0.0-alpha3'
and this in your xml
<android.support.design.widget.TextInputLayout
style="#style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColorHint="#color/light_white"
app:boxStrokeColor="#color/light_white"
app:boxStrokeWidth="1dp">
<com.lynx.zaindelivery.views.ZainEditText
android:id="#+id/ActivityLoginMobileNumberOrEmailEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/mobile_number_or_email" />
</android.support.design.widget.TextInputLayout>
note you can try different style