Layout responsive issue [closed]

I have xml design with a Linear layout as root and inside this constraint layout is used. I have an issue (this) in responsiveness while using the layout validator. Please suggest me.

//LinearLayout and ConstraintLayout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    android:orientation="vertical">

    

//FullName EdittextView

     <EditText
        android:id="@+id/et_full_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_marginStart="@dimen/activity_start_margin"
        android:layout_marginEnd="@dimen/activity_end_margin"
        android:background="@drawable/rectangle_pedittext"
        android:drawableStart="@drawable/ic_full_name"
        android:drawablePadding="@dimen/activity_start_margin"
        android:fontFamily="@font/poppins_regular"
        android:gravity="center_vertical"
        android:hint="@string/prompt_full_name"
        android:inputType="textPersonName"
        android:paddingLeft="@dimen/activity_start_padding"
        android:selectAllOnFocus="true"
        android:textColorHint="#C0C0C0"
        android:textSize="@dimen/_11ssp" />
    

//Email EdittextView

           <EditText
            android:id="@+id/et_email"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="30dp"
            android:layout_marginStart="@dimen/activity_start_margin"
            android:layout_marginEnd="@dimen/activity_end_margin"
            android:background="@drawable/rectangle_pedittext"
            android:drawableStart="@drawable/ic_icon_user"
            android:drawablePadding="@dimen/activity_start_margin"
            android:fontFamily="@font/poppins_regular"
            android:gravity="center_vertical"
            android:hint="@string/prompt_email"
            android:inputType="textEmailAddress"
            android:paddingLeft="@dimen/activity_start_padding"
            android:selectAllOnFocus="true"
            android:textColorHint="#C0C0C0"
            android:textSize="@dimen/_11ssp" />
        

 //Spinner for Country Option

          <Spinner
            android:id="@+id/et_country_name"
            style="@style/SpinnerTheme"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="30dp"
            android:layout_marginStart="@dimen/activity_start_margin"
            android:layout_marginEnd="@dimen/activity_end_margin"
            android:paddingLeft="@dimen/_50sdp" />
    

//Phone Number EditTextView

    <EditText
        android:id="@+id/et_phone_details"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="30dp"
        android:layout_marginStart="@dimen/activity_start_margin"
        android:layout_marginEnd="@dimen/activity_end_margin"
        android:background="@drawable/rectangle_pedittext"
        android:drawableStart="@drawable/ic_phone"
        android:drawablePadding="@dimen/activity_start_margin"
        android:fontFamily="@font/poppins_regular"
        android:gravity="center_vertical"
        android:hint="@string/prompt_phone"
        android:inputType="phone"
        android:paddingLeft="@dimen/activity_start_padding"
        android:selectAllOnFocus="true"
        android:textColorHint="#C0C0C0"
        android:textSize="@dimen/_11ssp" />
    

//Date of birth calendar alert dialog popped out

       <EditText
            android:id="@+id/et_date_of_birth"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="30dp"
            android:layout_marginStart="@dimen/activity_start_margin"
            android:layout_marginEnd="@dimen/activity_end_margin"
            android:background="@drawable/rectangle_pedittext"
            android:drawableStart="@drawable/ic_dob"
            android:drawablePadding="@dimen/activity_start_margin"
            android:fontFamily="@font/poppins_regular"
            android:gravity="center_vertical"
            android:hint="@string/prompt_dob"
            android:paddingLeft="@dimen/activity_start_padding"
            android:selectAllOnFocus="true"
            android:textColorHint="#C0C0C0"
            android:textSize="@dimen/_11ssp" />
    

//EditTextView for password

<EditText
    android:id="@+id/et_password"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="30dp"
    android:layout_marginStart="@dimen/activity_start_margin"
    android:layout_marginEnd="@dimen/activity_end_margin"
    android:background="@drawable/rectangle_pedittext"
    android:drawableStart="@drawable/ic_icon_password"
    android:drawablePadding="@dimen/activity_start_margin"
    android:fontFamily="@font/poppins_regular"
    android:gravity="center_vertical"
    android:hint="@string/prompt_password"
    android:inputType="textPassword"
    android:paddingLeft="@dimen/activity_start_padding"
    android:selectAllOnFocus="true"
    android:textColorHint="#C0C0C0"
    android:textSize="14sp" />

//EditTextView for confirmpassword

  <EditText
    android:id="@+id/et_confirm_password"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="30dp"
    android:layout_marginStart="@dimen/activity_start_margin"
    android:layout_marginEnd="@dimen/activity_end_margin"
    android:background="@drawable/rectangle_pedittext"
    android:drawableStart="@drawable/ic_icon_password"
    android:drawablePadding="@dimen/activity_start_margin"
    android:fontFamily="@font/poppins_regular"
    android:gravity="center_vertical"
    android:hint="@string/prompt_confirm_password"
    android:inputType="textPassword"
    android:paddingLeft="@dimen/activity_start_padding"
    android:selectAllOnFocus="true"
    android:textColorHint="#C0C0C0"
    android:textSize="14sp" />
        

//constraintlayoutdesign

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    

//rombus image //Half rombus images (i.e 2 image) present in footer

<ImageView
    android:id="@+id/imageView3"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:paddingEnd="@dimen/_40sdp"
    android:src="@drawable/mask_group"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.0"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.0" />

//signup button

        <Button
            android:id="@+id/btn_signUp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/sign_btn"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="1.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.835" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

Answer

try weightSum in Linear layout and in it’s child you can set the value of layout_weight.

For example: if you set the value of weightSum is equal to 10 then you can divide it’s child like textview and imageview etc is equal to 6 and 4 respectively which is equal to 10.

for more help read this article

Source: stackoverflow
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .