title: How to change edittext width depending on screen size in android?
body: <p>I want to change the size of edittext(only numbers are input) according to screensize as it has two spinners in same line of edittext horizontally ,so in some screens i cannot see second spinner or part of second spinner.</p>
  
  <p>So if i can decrease size of edittext depending on screen it will include all three (edittext and 2 spinners ) on same line.</p>
  
  <p>I don't want to keep edittext fixed with smaller width as its hint gets cut ,so depending on screensize i should also be able to change text size and hint size.
  and how to change text size depending on edittext width ?</p>
  
  <p><a href="https://i.stack.imgur.com/apTeq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/apTeq.png" alt="image from android studio"></a></p>
  
  <p>Below is my activity_main.xml file</p>
  
  <pre><code>        &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.constraintlayout.widget.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:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MainActivity"&gt;
  
      &lt;EditText
          android:id="@+id/editText"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="36dp"
          android:layout_marginTop="70dp"
          android:ems="10"
          android:hint="Storage Vessel Volume"
          android:inputType="number"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" /&gt;
  
      &lt;Spinner
          android:id="@+id/spinner"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="10dp"
          app:layout_constraintBottom_toBottomOf="@+id/editText"
          app:layout_constraintStart_toEndOf="@+id/editText" /&gt;
  
      &lt;Spinner
          android:id="@+id/spinner2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="10dp"
          app:layout_constraintBottom_toBottomOf="@+id/editText"
          app:layout_constraintStart_toEndOf="@+id/spinner" /&gt;
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>