Two different pages get clipped with login and signUp page display in android xml layout


Two different pages get clipped with login and signUp page display in android xml layout



Login And SignUp Screen



enter image description here



How to implement and write xml file like this image? Please Help me.




2 Answers
2



Create layout like this,


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="2"
tools:context=".MainActivity">


<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.90"
android:orientation="vertical">

<!-- put your Login page content ,email
,password Edittext and other button here.
-->

</LinearLayout>


<LinearLayout
android:layout_width="40dp"
android:layout_height="match_parent"
android:layout_weight="0.10"
android:background="@drawable/lay_background"
android:weightSum="1">

<TextView
android:id="@+id/signUp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="0.10"
android:elevation="20dp"
android:gravity="center"
android:rotation="270"
android:text="Sign Up"
android:textAllCaps="true"
android:textColor="#ffffff"
android:textStyle="bold"
android:weightSum="1" />

</LinearLayout>

</LinearLayout>



lay_background.xml


<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

<item>
<shape android:shape="rectangle">
<solid android:color="@color/colorAccent"/>
</shape>
</item>

<item
android:left="0dp"
android:right="0dp"
android:top="0dp"
android:bottom="2dp">
<shape android:shape="rectangle">
<solid android:color="@color/colorAccent"/>
<corners android:radius="5dp"/>
</shape>
</item>
</layer-list>



and onClick() of textview open your signup activity this is another approach.Try this I hope this will work for you.


onClick()





Thanks you.This is almost right my question answer but I want to use fold and unfold current fragment , clearfocus on this.
– Ptut
Jul 2 at 5:10




I would suggest using Viewpager/Recyclerview,



I have used Recyclerview with the snap feature. My project requirement is, the next module button should be partially visible part of the first screen. So I have used recyclerview and kept the Item size bit smaller than screen width. So that the next item visible partially. As soon as clicking the button it will smoothscrool to next item.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Rothschild family

Cinema of Italy