Skip to main content
Beautiful  Login Screen Android







Create drawable resource file button1.xml

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="rectangle">
            <solid android:color="@color/white"/>
            <corners android:radius="20dp" />
            <stroke android:width="1dp" 
            android:color="#610687"/></shape>
 </item>
</selector>



Create another drawable resorce file button2.xml

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
           <solid android:color="#610687"/>
         <shape android:shape="rectangle">
<corners android:radius="20dp" />
            <stroke android:width="1dp"
android:color="#610687" /></shape>
    </item>
</selector>

Create curve.xml

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@color/colorPrimary"/>

    <padding android:left="1dp"        
            android:top="1dp"     
            android:right="1dp"    
             android:bottom="1dp" />

    <corners android:bottomRightRadius="100dp"    
             android:bottomLeftRadius="100dp" 
             android:topLeftRadius="0dp" 
              android:topRightRadius="0dp"/>
</shape>


Create login.xml



<?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:background="@color/white">
    <LinearLayout

        android:weightSum="1"     
   android:orientation="vertical"    
    android:layout_width="match_parent"      
  android:layout_height="match_parent">
        <LinearLayout
            android:orientation="vertical"        
    android:gravity="center"           
 android:layout_width="match_parent"           
 android:layout_height="0dp"           
 android:background="@drawable/curves"
            android:layout_weight="0.15">

            <TextView
                android:layout_width="wrap_content"      
          android:text="LOGO"               
 android:textColor="@color/white"             
   android:textSize="18sp"               
 android:layout_height="wrap_content" />


        </LinearLayout>
        <LinearLayout
            android:orientation="vertical"       
     android:gravity="center"           
 android:layout_width="match_parent"         
   android:layout_height="0dp"          
  android:layout_weight="0.15">

        </LinearLayout>

        <LinearLayout        
    android:layout_width="match_parent"    
        android:layout_height="0dp"   
         android:layout_weight="0.4">

            <LinearLayout              
  android:orientation="vertical"           
     android:weightSum="1.5"              
  android:layout_width="match_parent"            
    android:layout_height="match_parent">

                <LinearLayout
                    android:layout_weight="0.5"            
        android:layout_width="match_parent"              
      android:layout_height="0dp">

                    <LinearLayout
                        android:gravity="center|top"           
             android:paddingLeft="30dp"
android:paddingRight="30dp"                       
 android:layout_width="match_parent"                     
   android:layout_height="match_parent">
                        <LinearLayout                          
  android:background="@drawable/botuuon"                       
     android:layout_width="match_parent"
android:layout_height="40dp"                         
   android:orientation="horizontal"                       
     android:weightSum="1">

                            <LinearLayout                          
      android:layout_width="0dp"                             
   android:layout_height="match_parent"                            
    android:layout_weight="0.2"
android:background="@drawable/button1"                          
      android:layout_margin="1.2dp"                             
   android:gravity="center">

                                <ImageView                         
           android:padding="5dp"                                  
  android:layout_width="30dp"                                   
 android:layout_height="30dp"                                
    android:tint="@color/white"                               
     android:src="@drawable/user" />
                            </LinearLayout>
                            <LinearLayout                            
    android:layout_width="0dp"                               
 android:layout_height="match_parent"                           
     android:layout_weight="0.8"                        
 android:layout_gravity="center"                            
  >

                                <EditText                                 
   android:layout_width="match_parent"                     
        
       android:layout_height="match_parent"              
                      android:hint="Username"          
                          android:gravity="center|right"    
                                android:textColorHint="#610687"      
                              android:background="@null"           
                         android:layout_marginRight="10dp"        
                            android:textColor="@color/black"     
                               android:textSize="14sp" />

                            </LinearLayout>
                        </LinearLayout>
                    </LinearLayout>


                </LinearLayout>
                <LinearLayout                  
  android:layout_weight="0.5"                  
  android:layout_width="match_parent"         
           android:layout_height="0dp">
                    <LinearLayout
                        android:gravity="center|top"     
                   android:paddingLeft="30dp"
android:paddingRight="30dp"                    
    android:layout_width="match_parent"             
           android:layout_height="match_parent">
                        <LinearLayout                      
      android:background="@drawable/botton1"            
                android:layout_width="match_parent"              
              android:layout_height="40dp"                       
     android:orientation="horizontal"
                            android:weightSum="1">


                            <LinearLayout                             
   android:layout_width="0dp"                           
     android:layout_height="match_parent"                          
      android:layout_weight="0.8"                           
     android:gravity="center">

                                <EditText                            
        android:layout_width="match_parent"                            
        android:layout_height="match_parent"                           
         android:hint="Password"                                 
   android:textColorHint="#610687"                            
      
  android:background="@null"                                 
   android:layout_marginLeft="10dp"                                 
   android:textColor="@color/black"                                 
   android:textSize="14sp" />
                            </LinearLayout>
                            <LinearLayout                            
    android:layout_width="0dp"                              
  android:layout_height="match_parent"                        
        android:layout_weight="0.2"                             
   android:layout_margin="1.2dp"                             
   android:background="@drawable/button2"                              
  android:gravity="center">

                                <ImageView                                
    android:padding="5dp"                                  
  android:layout_width="30dp"                                 
   android:tint="@color/white"                                 
   android:layout_height="30dp"                                 
   android:src="@drawable/password" />
                            </LinearLayout>

                        </LinearLayout>
                    </LinearLayout>
                </LinearLayout>
                <LinearLayout                
    android:layout_weight="0.5"
                    android:layout_width="match_parent"      
              android:layout_height="0dp">
                    <Button                      
  android:layout_marginLeft="30dp"                     
   android:layout_marginRight="30dp"                      
  android:id="@+id/button1"                     
   android:layout_width="match_parent"                    
    android:layout_height="40dp"                   
     android:background="@drawable/button1"             
           android:paddingTop="10dp"                   
     android:paddingBottom="10dp"                     
   android:text="Login"                     
   android:textColor="@color/white"                    
    android:textSize="14dp" />
                </LinearLayout>

            </LinearLayout>

        </LinearLayout>
        <LinearLayout
            android:orientation="vertical"        
    android:gravity="center"          
  android:layout_width="match_parent"     
       android:layout_height="0dp"          
  android:layout_weight="0.15">

        </LinearLayout>

        <LinearLayout           
 android:orientation="vertical"      
      android:gravity="center"        
    android:layout_width="match_parent"         
   android:background="@drawable/cr"          
  android:layout_height="0dp"           
 android:layout_weight="0.15">



        </LinearLayout>
    </LinearLayout>

</LinearLayout>

Comments

Popular posts from this blog

Android Interview Questions And Answers 1. What is android ? Ans. Android is an Operation System based on Linux kernel . 2. What are the different Android Components ? Ans.  Activity           Intents          Service          Broadcast Receiver          Content Provider.