android-sign-in-up-screen

android-sign-in-up-screen
master
hmkcode 12 years ago
parent f2ffb1c3a7
commit ae2ac49e36

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hmkcode.android.sign"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.hmkcode.android.sign.MainActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.hmkcode.android.sign.SignUpActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.SignUpActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.hmkcode.android.sign.SignInActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.SignInActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape>
<solid
android:color="#f8f9fa" />
<stroke
android:width="1dp"
android:color="#d2d2d2" />
<corners
android:radius="1dp" />
</shape>
</item>
<item>
<shape>
<gradient
android:startColor="#f8f9fa"
android:endColor="#d2d2d2"
android:angle="270" />
<stroke
android:width="1dp"
android:color="#d2d2d2" />
<corners
android:radius="1dp" />
</shape>
</item>
</selector>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:padding="10dp" >
<solid android:color="#FFFFFF"/>
<stroke
android:width="0.5dp"
android:color="#d2d2d2" />
<corners android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"/>
</shape>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:padding="10dp">
<solid android:color="#FFFFFF"/>
<stroke
android:width="0.5dp"
android:color="#d2d2d2" />
</shape>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:padding="10dp">
<solid android:color="#FFFFFF"/>
<stroke
android:width=".05dp"
android:color="#d2d2d2" />
<corners android:topLeftRadius="5dp"
android:topRightRadius="5dp"/>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#99000000" ></solid>
<corners android:radius="8px"></corners>
<stroke android:width="0dp" android:color="#A4C2E0"></stroke>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -0,0 +1,44 @@
<RelativeLayout 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:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity"
android:background="@drawable/balloon_bg">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/linearlayout_bg"
android:padding="10dp"
>
<Button
android:id="@+id/btnSignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_margin="4dp"
android:text="Sign Up"
android:background="@drawable/button_default_bg"
style="@style/DefaultButtonText"
/>
<Button
android:id="@+id/btnSingIn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_margin="4dp"
android:text="Sign In"
style="@style/DefaultButtonText"
android:background="@drawable/button_default_bg"
/>
</LinearLayout>
</RelativeLayout>

@ -0,0 +1,54 @@
<RelativeLayout 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:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity"
android:background="#ffffff">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:padding="10dp"
>
<EditText
android:id="@+id/etUserName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/edittext_top_bg"
android:padding="10dp"
android:hint="Email"
android:textColorHint="#cccccc"
android:drawableLeft="@drawable/email"/>
<EditText
android:id="@+id/etPass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/edittext_bottom_bg"
android:layout_marginTop="-2dp"
android:padding="10dp"
android:hint="Password"
android:textColorHint="#cccccc"
android:password="true"
android:drawableLeft="@drawable/password"/>
<Button
android:id="@+id/btnSingIn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_margin="4dp"
android:text="Sign In"
style="@style/DefaultButtonText"
android:background="@drawable/button_default_bg"
/>
</LinearLayout>
</RelativeLayout>

@ -0,0 +1,64 @@
<RelativeLayout 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:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity"
android:background="#ffffff">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:padding="10dp"
>
<EditText
android:id="@+id/etEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/edittext_top_bg"
android:padding="10dp"
android:hint="Email"
android:textColorHint="#bbbbbb"
android:drawableLeft="@drawable/email"/>
<EditText
android:id="@+id/etUserName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/edittext_default_bg"
android:layout_marginTop="-2dp"
android:padding="10dp"
android:hint="User Name"
android:textColorHint="#bbbbbb"
android:drawableLeft="@drawable/user"/>
<EditText
android:id="@+id/etPass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/edittext_bottom_bg"
android:layout_marginTop="-2dp"
android:padding="10dp"
android:hint="Password"
android:textColorHint="#bbbbbb"
android:password="true"
android:drawableLeft="@drawable/password"/>
<Button
android:id="@+id/btnSingIn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_margin="4dp"
android:text="Sign Up"
style="@style/DefaultButtonText"
android:background="@drawable/button_default_bg"
/>
</LinearLayout>
</RelativeLayout>

@ -0,0 +1,9 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_settings"/>
</menu>

@ -0,0 +1,7 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Sign In&amp;Up</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<style name="DefaultButtonText">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#979797</item>
<item name="android:gravity">center</item>
<item name="android:layout_margin">3dp</item>
<item name="android:textStyle">normal</item>
<item name="android:textSize">20sp</item>
<item name="android:shadowColor">#f9f9f9</item>
<item name="android:shadowDx">1</item>
<item name="android:shadowDy">1</item>
<item name="android:shadowRadius">1</item>
</style>
</resources>

@ -0,0 +1,20 @@
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>

@ -0,0 +1,42 @@
package com.hmkcode.android.sign;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class MainActivity extends Activity implements OnClickListener {
Button btnSignIn;
Button btnSignUp;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnSignIn = (Button) findViewById(R.id.btnSingIn);
btnSignUp = (Button) findViewById(R.id.btnSignUp);
btnSignIn.setOnClickListener(this);
btnSignUp.setOnClickListener(this);
}
@Override
public void onClick(View v) {
Intent i = null;
switch(v.getId()){
case R.id.btnSingIn:
i = new Intent(this,SignInActivity.class);
break;
case R.id.btnSignUp:
i = new Intent(this,SignUpActivity.class);
break;
}
startActivity(i);
}
}

@ -0,0 +1,16 @@
package com.hmkcode.android.sign;
import android.os.Bundle;
import android.app.Activity;
public class SignInActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sign_in_screen);
}
}

@ -0,0 +1,17 @@
package com.hmkcode.android.sign;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class SignUpActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sign_up_screen);
}
}
Loading…
Cancel
Save