Open top menu

Android Custom Login Screen Design  ?

try this design....

In this design used EditText without Border line...


without_borderline.xml.
..................................................................................................................................................................
<?xml version="1.0" encoding="UTF-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">

 <item android:state_focused="true" >
    <shape android:shape="line">
        <gradient
            android:startColor="#8e44ad"
            android:endColor="#8e44ad"
            android:angle="270" />
        <stroke
            android:width="3dp"
            android:color="#F8B334" />
         
    </shape>
</item>  
</selector>


main.xml.
...................................................................................................................................................................

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#8e44ad"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="131dp"
        android:src="@drawable/user_male_circle" />

    <EditText
        android:id="@+id/editText_email"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/imageView1"
        android:layout_centerHorizontal="true"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="54dp"
        android:background="@drawable/without_borderline"
        android:ems="10"
        android:gravity="center"
        android:hint="Email Address"
        android:inputType="textEmailAddress"
        android:padding="8dp"
        android:textColorHint="#ffffff" />

    <EditText
        android:id="@+id/editText_password"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/editText_email"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="14dp"
        android:background="@drawable/without_borderline"
        android:ems="10"
        android:gravity="center"
        android:hint="*******"
        android:inputType="textPassword"
        android:padding="8dp"
        android:textColorHint="#ffffff" >
    </EditText>

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="52dp"
        android:text="UserLogin"
        android:textSize="18sp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_below="@+id/editText_password"
        android:layout_marginRight="24dp"
        android:layout_marginTop="24dp"
        android:text="New User Account"
        android:textStyle="bold|italic" />

    <TextView
        android:id="@+id/textView3"
        android:layout_width="fill_parent"
        android:layout_height="1dp"
        android:layout_below="@+id/editText_email"
        android:layout_centerHorizontal="true"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:background="#ffffff" />

    <TextView
        android:id="@+id/textView4"
        android:layout_width="fill_parent"
        android:layout_height="1dp"
        android:layout_below="@+id/editText_password"
        android:layout_centerHorizontal="true"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:background="#ffffff" />

</RelativeLayout>

...................................................................................................................................................................

user icon image download here....

Read more

Android Custom  ProgrssBar with Animation ?

In blog explain how to create Ring ProgressBar in android ....try this

Step 1 Create anim class inside res/drawable/ring_progress_anim...

ring_progress_anim.xml
...................................................................................................................................................................

<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:fromDegrees="0"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toDegrees="360" >
    <shape
        android:innerRadius="60dp"
        android:shape="ring"
        android:thickness="8dp"
        android:useLevel="false" >
        <size
            android:height="80dp"
            android:width="80dp" />
        <gradient
            android:centerColor="#1e6008"
            android:centerY="0.5"
            android:endColor="#afab24"
            android:startColor="#0d4599"
            android:type="sweep"
            android:useLevel="false" />
    </shape>
</rotate>

Step 2.Create activity_main.xml class inside res/layout/ folder..

activity_main.xml.
...................................................................................................................................................................

<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:orientation="vertical" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:src="@drawable/logoweb" />

   <ProgressBar
   android:layout_width="200dp"
   android:layout_height="200dp"
   android:layout_gravity="center"
   android:layout_marginTop="60dp"
   android:indeterminateDrawable="@drawable/ring_progress_anim" />

</LinearLayout>









Link Learn More...
Read more

Android Custom Circle  Shape ProgrssBar with Animation ?

In blog explain how to create Circle ProgressBar in android ....try this

Step 1 Create anim class inside res/drawable/circle_progress_anim...

circle_progress_anim.xml
...................................................................................................................................................................

<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:fromDegrees="0"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toDegrees="360" >
    <shape
        android:innerRadius="60dp"
        android:shape="oval"
        android:thickness="4dp"
        android:useLevel="false" >
        <size
            android:height="80dp"
            android:width="80dp" />
        <gradient
            android:centerColor="#1e6008"
            android:centerY="0.5"
            android:endColor="#afab24"
            android:startColor="#0d4599"
            android:type="sweep"
            android:useLevel="false" />
    </shape>
</rotate>

Step 2.Create activity_main.xml class inside res/layout/ folder..

activity_main.xml.
...................................................................................................................................................................

<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:orientation="vertical" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:src="@drawable/logoweb" />

   <ProgressBar
   android:layout_width="200dp"
   android:layout_height="200dp"
   android:layout_gravity="center"
   android:layout_marginTop="60dp"
   android:indeterminateDrawable="@drawable/circle
_progress_anim" />

</LinearLayout>










 Learn More...
Read more

Android Custom Rectangle Shape ProgrssBar with Animation ?

In blog explain how to create Rectangle ProgressBar in android ....try this

Step 1 Create anim class inside res/drawable/rotate_progress_anim...

rotate_progress_anim.xml
...................................................................................................................................................................

<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:fromDegrees="0"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toDegrees="360" >
    <shape
        android:innerRadius="60dp"
        android:shape="rectangle"
        android:thickness="4dp"
        android:useLevel="false" >
        <size
            android:height="80dp"
            android:width="80dp" />
        <gradient
            android:centerColor="#1e6008"
            android:centerY="0.5"
            android:endColor="#afab24"
            android:startColor="#0d4599"
            android:type="sweep"
            android:useLevel="false" />
    </shape>
</rotate>

Step 2.Create activity_main.xml class inside res/layout/ folder..

activity_main.xml.
...................................................................................................................................................................

<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:orientation="vertical" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:src="@drawable/logoweb" />

   <ProgressBar
   android:layout_width="200dp"
   android:layout_height="200dp"
   android:layout_gravity="center"
   android:layout_marginTop="60dp"
   android:indeterminateDrawable="@drawable/rotate_progress_anim" />

</LinearLayout>



Step 3. Create MainActivity.java class inside src folder...
Main_Activity.java.
...................................................................................................................................................................

package com.androidbeginner.testcode;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;

@SuppressLint("ResourceAsColor")
public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setTitle("Rectangle Shape ProgressBar");
setContentView(R.layout.activity_main);
 
}

}



Read more

How to display Justify text in android ?

In this blog explain how to justify text in android show below code
the blog used align & justify text in about us in android app .

Step 1 You can create activity_main.xml class inside res folder...

activity_main.xml. 

In this class create webview .
...................................................................................................................................................................

<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:orientation="vertical" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:src="@drawable/logoweb" />

    <WebView
        android:id="@+id/web_history"
        android:layout_width="215dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="30dp"
        android:background="#cfcfcf"
        android:paddingBottom="5dp"
        android:paddingLeft="10dp"
        android:paddingRight="10dp"
        android:src="@drawable/logoweb" />

</LinearLayout>




Step 2. you can add html tag in string class inside res/string....
String.xml
..................................................................................................................................................................
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">Test Code</string>
    <string name="hello_world">Hello world!</string>
    <string name="action_settings">Settings</string>
  
    <string name="Yellow">Yellow</string><string name="History">
<![CDATA[
<html>
 <head></head>
 <body style="text-align:justify;color:white;background-color:green;">
 Mohandas Karamchand Gandhi, more commonly known as ‘Mahatma’ (meaning ‘Great Soul’) was born in Porbandar, Gujarat, in North West India, on 2nd October 1869, into a Hindu Modh family. His father was the Chief Minister of Porbandar, and his mother’s religious devotion meant that his upbringing was infused with the Jain pacifist teachings of mutual tolerance, non-injury to living beings and vegetarianism
 </body>
</html>
]]>
    </string

</resources>


Setp 3. create MainActivity.java class inside src folder...


MainActivity.java

In this class load html text in webview from String class.
...................................................................................................................................................................

 package com.androidbeginner.testcode;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.webkit.WebView;

@SuppressLint("ResourceAsColor")
public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setTitle("Justify text ");
setContentView(R.layout.activity_main);
WebView view = (WebView) findViewById(R.id.web_history);
view.getSettings();
view.setBackgroundColor(Color.GREEN);
view.loadData(getString(R.string.History), "text/html", "utf-8");
}

}




Read more