Android : adjustResize overlaps the views below the editText - android-layout

I have a constraint layout as below:
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<androidx.constraintlayout.widget.ConstraintLayout
style="#style/LoginScreenBg"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:fillViewport="true"
android:scrollbars="none"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="#+id/imageIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="-100dp"
android:contentDescription="#null"
android:src="#drawable/ic_icon"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="#id/dm_title"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/dm_title"
style="#style/titlesp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="60dp"
app:layout_constraintBottom_toTopOf="#id/username_input_layout"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<EditText
android:id="#+id/username_input_layout"
style="#style/CreateAccountEditTextHint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/EMAIL_HINT_TEXT"
android:inputType="textEmailAddress"
app:layout_constraintBottom_toTopOf="#id/password_input_layout"
app:layout_constraintLeft_toLeftOf="parent"/>
<EditText
android:id="#+id/password_input_layout"
style="#style/CreateAccountEditTextHint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/PASSWORD_HINT_TEXT"
android:inputType="textPassword"
android:maxLength="20"
app:layout_constraintBottom_toTopOf="#id/btn_login"
app:layout_constraintLeft_toLeftOf="parent" />
<androidx.appcompat.widget.AppCompatButton
android:id="#+id/btn_login"
style="#style/LoginButton"
android:layout_width="match_parent"
android:layout_height="#dimen/generic_button_height"
android:layout_marginStart="#dimen/dp_16"
android:layout_marginEnd="#dimen/dp_16"
android:layout_marginBottom="#dimen/dp_24"
android:background="#color/login_button_color"
app:layout_constraintBottom_toTopOf="#+id/btn_forgot_username_password" />
<Button
android:id="#+id/btn_forgot_username_password"
style="#style/ForgotButton"
android:layout_width="wrap_content"
android:layout_height="#dimen/generic_button_height"
android:layout_marginBottom="#dimen/dp_24"
android:text="#string/FORGOT_USERNAME_PASSWORD_BUTTON"
app:layout_constraintBottom_toTopOf="#+id/btn_create_account"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<Button
android:id="#+id/btn_create_account"
style="#style/CreateAccountButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/dp_16"
android:layout_marginEnd="#dimen/dp_16"
android:layout_marginBottom="#dimen/dp_24"
android:text="#string/SCREEN_LOGIN_CREATE_ACCOUNT"
app:layout_constraintBottom_toBottomOf="parent"
app:uidComponentType="Secondary" />
<ProgressBar
android:id="#+id/progress_circular"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
Below code is added in the manifest
<activity
android:name=".ui.Activity"
android:configChanges="screenSize|orientation|keyboard"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
When we use the adjustResize, UI components gets overlapped with each other.
If I do not add the adjust resize there are few layouts which over the notification bar on my device.
If I add the adjust resize it is distorts the UI.
I am using single activity model. So the change in manifest will affect all the screens
Could you please let me know how to resolve this

This was happening because the views at the top of the screen are chained to each other but the button at the end is independent and is constrained to the bottom of the screen.
When the screen is resized, the elements are not chained to each other and the views are distorted

Related

Incorrect display of a custom dialog

Hi guys i have a problem with the view of a dialog window: in the preview of the screen, before sending the app in debug, I see the screen in a way; while, when I execute the app, my dialog window's layout doesn't respect the layout before the execution phase. Nel dialog I used a constraint layout; I don't know if this is the actual problem. I'm attaching the pictures of how it should be seen and the way it looks.
This is the XML ``
<?xml version="1.0" encoding="utf-8"?>
<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">
<TextView
android:id="#+id/textView_titolo_dialog_contratta_tasso_di_interesse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="47dp"
android:layout_marginTop="10dp"
android:text="Contratta tasso di interesse
"
android:textColor="#color/black"
android:textSize="25sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginTop="81dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/icona_direttore_banca_per_dialog_ridimensionata" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="540dp"
android:orientation="horizontal"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="1dp">
<Button
android:id="#+id/button_dialog_contratta_parla"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#drawable/bottone_modificato_banca"
android:text="Parla"
app:backgroundTint="#null" />
</LinearLayout>
<ImageView
android:id="#+id/imageView_dialog_contratta_risposta_si"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginStart="95dp"
android:layout_marginTop="44dp"
android:visibility="invisible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/risposta_s__direttore_della_banca" />
<ImageView
android:id="#+id/imageView_dialog_contratta_risposta_no"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginStart="95dp"
android:layout_marginTop="44dp"
android:visibility="invisible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/risposta_no_direttore_della_banca" />
</androidx.constraintlayout.widget.ConstraintLayout>
Photo of incorrect view
Photo of the correct view

ConstraintLayout stick view to wrap_content view

I tried to stick counter to nameText while counter should not exceed the container from the right side.
I want to only use the xml and no programmatically change it.
I played with the layout.xml
code example:
<?xml version="1.0" encoding="utf-8"?>
<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:id="#+id/wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#99776633"
tools:ignore="MissingDefaultResource">
<TextView
android:id="#+id/nameText"
android:layout_width="0dp"
android:layout_height="0dp"
android:ellipsize="end"
android:foreground="#66ff0000"
android:lines="1"
android:textSize="17dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_default="wrap"
tools:text="James BondJameames " />
<View
android:id="#+id/seperator"
android:layout_width="1dp"
android:layout_height="1dp"
app:layout_constraintLeft_toRightOf="#id/nameText"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/counter"
android:layout_width="0dp"
android:layout_height="0dp"
android:foreground="#9900fff0"
android:lines="1"
android:text="(47)"
android:textSize="17dp"
app:layout_constraintLeft_toRightOf="#id/seperator"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_default="wrap" />
</androidx.constraintlayout.widget.ConstraintLayout>
The results:
With short text:
With long text:
The expected result should be something like that:
Try placing the three views into a horizontal chain while shifting the horizontal bias of nameText to zero.
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#99776633"
tools:ignore="MissingDefaultResource">
<TextView
android:id="#+id/nameText"
android:layout_width="0dp"
android:layout_height="0dp"
android:ellipsize="end"
android:foreground="#66ff0000"
android:lines="1"
android:textSize="17dp"
app:layout_constraintEnd_toStartOf="#+id/counter"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_default="wrap"
tools:text="Short text" />
<View
android:id="#+id/seperator"
android:layout_width="1dp"
android:layout_height="1dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/counter"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/counter"
android:layout_width="0dp"
android:layout_height="0dp"
android:foreground="#9900fff0"
android:lines="1"
android:text="(47)"
android:textSize="17dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintEnd_toStartOf="#+id/seperator"
app:layout_constraintStart_toEndOf="#+id/nameText"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_default="wrap" />
</androidx.constraintlayout.widget.ConstraintLayout>
See the documentation on chains.
<?xml version="1.0" encoding="utf-8"?>
<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:id="#+id/wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#99776633"
tools:ignore="MissingDefaultResource">
<TextView
android:id="#+id/nameText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:foreground="#66ff0000"
android:lines="1"
android:textSize="17dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_default="wrap"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="#id/seperator"
tools:text="James BondJameames " />
<View
android:id="#+id/seperator"
android:layout_width="1dp"
android:layout_height="1dp"
app:layout_constraintEnd_toStartOf="#id/counter"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/counter"
android:layout_width="0dp"
android:layout_height="0dp"
android:foreground="#9900fff0"
android:lines="1"
android:text="(47)"
android:textSize="17dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_default="wrap" />
</androidx.constraintlayout.widget.ConstraintLayout>

Keyboard beeing shown when pressing tab before button

I'm very new to Android studio, and i'm trying to build a simple app that when I click a button, it does some calculations. The problem is that when I press tab on the last EditText before the button, the button become focused and a keyboard is shown, I just want the button to remain unfocusable so when the user input every necessary data, he can just click the button
What I tried is setting the property focusable and focusableInTouchMode to false but none of them seem to work and I havent found no other option that made sense for me.
What can I do to stop this behaviour?
Edit:
Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.rodolfo.trekking">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:windowSoftInputMode="stateHidden"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
Edit 2:
XML Layout:
ersion="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">
<EditText
android:layout_width="wrap_content"
android:layout_height="0dp"
android:inputType="number"
android:ems="10"
android:id="#+id/edTempo"
android:importantForAutofill="no"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="#+id/textView3" android:layout_marginStart="8dp"
app:layout_constraintStart_toStartOf="#+id/textView" android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="#+id/textView"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:ems="10"
android:id="#+id/edTrecho"
android:importantForAutofill="no"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="#+id/textView2" android:layout_marginStart="8dp"
app:layout_constraintStart_toStartOf="#+id/btCalcular" android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="#+id/btCalcular"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="0dp"
android:inputType="number"
android:ems="10"
android:id="#+id/edVelocidade"
android:importantForAutofill="no"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="#+id/textView" android:layout_marginStart="8dp"
app:layout_constraintStart_toStartOf="parent" android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="parent"/>
<TextView
android:text="#string/velocidade"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView"
android:layout_marginTop="64dp"
app:layout_constraintTop_toBottomOf="#+id/edTempo" app:layout_constraintStart_toStartOf="#+id/textView2"
app:layout_constraintEnd_toEndOf="#+id/textView2"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView2"
android:text="#string/trecho"
app:layout_constraintStart_toStartOf="#+id/edTrecho"
app:layout_constraintEnd_toEndOf="#+id/edTrecho" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="#+id/edVelocidade"/>
<TextView
android:text="#string/tempo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView3"
android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="#+id/edTempo"
app:layout_constraintEnd_toEndOf="#+id/edTempo"/>
<Button
android:text="#string/calcular"
android:layout_width="210dp"
android:layout_height="42dp"
android:id="#+id/btCalcular" app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
tools:text="#string/calcular" android:layout_marginTop="84dp"
app:layout_constraintTop_toBottomOf="#+id/edTrecho" app:layout_constraintHorizontal_bias="0.487"
android:focusableInTouchMode="false"
style="#style/Widget.AppCompat.Button" android:autoText="false" android:editable="false"/>
</android.support.constraint.ConstraintLayou
t>
Set this in your manifest file
android:windowSoftInputMode="stateHidden"

Elevate an Image in Pre-lollipop devices (<21)

Issue :Give elevation for an image in my layout.
Layout Structure: Constraint Layout-> Card View
The image to be elevated in half on constraint layout and half on card view.
I could not use the shadow approach since my image is not completely on a single view.
Is there a way this is possible on pre-lollipop devices?
Layout file:
<?xml version="1.0" encoding="utf-8"?>
<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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#246389"
android:orientation="vertical">
<android.support.v7.widget.AppCompatImageView
android:id="#+id/imageView3"
android:layout_width="264dp"
android:layout_height="152dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:elevation="12dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="#drawable/login_car" />
<android.support.v7.widget.CardView
android:id="#+id/cardView"
android:layout_width="270dp"
android:layout_height="450dp"
android:layout_margin="20dp"
app:cardBackgroundColor="#00AFEF"
app:cardUseCompatPadding="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintLeft_toRightOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="parent"
app:layout_constraintVertical_bias="0.5">
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>
I imitated a CardView with general android layouts and custom background. Then in parent FrameLayout it is easy to add one element above another
dialog_layout
<layout
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">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/base_transparent">
<FrameLayout
android:layout_width="300dp"
android:layout_height="210dp"
android:background="#drawable/bg_dialog">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="90dp"
android:background="#drawable/bg_dialog_upper_radius"
android:orientation="vertical">
<TextView
style="#style/AppTheme.PaymentContentTextAppearanceName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="16dp"
android:text="#string/payment_view_main_account" />
<TextView
android:id="#+id/tv_total_payment"
style="#style/AppTheme.PaymentView.Summ"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="16dp"
tools:text="80000" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="10dp"
android:orientation="horizontal">
<com.bifit.mobile.lite.std.ui.customview.CompatTextView
android:id="#+id/send_payment_email"
style="#style/AppTheme.BottomButton"
android:text="#string/payment_view_send_email"
android:textColor="#color/base_blue"
app:drawableTopCompat="#drawable/ic_message_send" />
<com.bifit.mobile.lite.std.ui.customview.CompatTextView
android:id="#+id/save_pdf_payment"
style="#style/AppTheme.BottomButton"
android:text="#string/payment_view_save_pdf"
android:textColor="#color/base_blue"
app:drawableTopCompat="#drawable/ic_save_pdf" />
</LinearLayout>
</FrameLayout>
<ImageButton
android:id="#+id/ib_okay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="170dp"
android:background="#drawable/bg_blue_circle"
android:clickable="true"
android:focusable="true"
app:srcCompat="#drawable/ic_check" />
</FrameLayout>
</layout>
bg_dialog_upper_radius
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#color/base_gray_light_second"/>
<corners
android:topLeftRadius="10dp"
android:topRightRadius="10dp"
/>
</shape>
</item>
</layer-list>
And the result

Dressing a mannequin with different items in android

I am trying to implement similar screen. Unable to add different items at proper place. I want to add shoes at the proper place.
Layout
<?xml version="1.0" encoding="utf-8"?><RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:padding="0dp">
<ImageView
android:id="#+id/imgBody"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:scaleType="fitXY"
android:src="#drawable/dress" />
<ImageView
android:id="#+id/imgFeet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/imgBody"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="0dp"
android:src="#drawable/ic_shoe1"
android:visibility="gone" />
<ImageView
android:id="#+id/imgFace"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_marginLeft="55dp"
android:layout_marginTop="0dp"
android:src="#drawable/ic_head"
android:visibility="gone" />
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:color/white"/>
Try to user Table layout for split a screen in two part. like below :
Here i have use android:layout_weight="0.5" for screen size.
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#EBEBEB"
android:stretchColumns="2"
android:weightSum="2">
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="0.5"
android:background="#FFFFFF"
android:orientation="vertical">
<!--Write your xml Right side xml code here-->
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="0.5"
android:background="#FFFFFF">
<!--Write your xml Left side xml code here-->
</RelativeLayout>
</TableRow>
</TableLayout>
Use Constraint Layout it will be easy for you to Design your Requirement
Add this dependency in your Project
compile 'com.android.support.constraint:constraint-layout:1.0.2'
Here I have added a code for your design
<?xml version="1.0" encoding="utf-8"?>
<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:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/imageView3"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="#+id/guideline4"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0"
app:srcCompat="#drawable/splash" />
<android.support.constraint.Guideline
android:id="#+id/guideline4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp" />
<android.support.design.widget.TabLayout
android:id="#+id/tabLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:minHeight="55dip"
app:layout_constraintLeft_toLeftOf="#+id/guideline4"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<android.support.design.widget.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Left" />
<android.support.design.widget.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Center" />
<android.support.design.widget.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Right" />
</android.support.design.widget.TabLayout>
<Button
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Review"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintLeft_toLeftOf="#+id/guideline4"
app:layout_constraintRight_toRightOf="parent"
tools:layout_editor_absoluteX="265dp"
tools:layout_editor_absoluteY="463dp" />
<android.support.v7.widget.RecyclerView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="0dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="0dp"
app:layout_constraintBottom_toTopOf="#+id/button"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintLeft_toLeftOf="#+id/guideline4"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/tabLayout"
app:layout_constraintVertical_bias="0.0" />
</android.support.constraint.ConstraintLayout>
I think instead of layout you should try to use canvas in left preview screen. On selecting any item should update left canvas by adding item in canvas and rendering elements.
Please have a look over canvas and drawing images over canvas.

Resources