Skip to content

Commit

Permalink
android social sign-in layout design
Browse files Browse the repository at this point in the history
android social sign-in layout design
  • Loading branch information
hmkcode committed Jan 24, 2014
1 parent 9c17491 commit ea25492
Show file tree
Hide file tree
Showing 20 changed files with 300 additions and 0 deletions.
27 changes: 27 additions & 0 deletions android-social-signin/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hmkcode.android.signin"
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.signin.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Binary file added android-social-signin/ic_launcher-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions android-social-signin/res/drawable-hdpi/button_fb_bg.xml
Original file line number Diff line number Diff line change
@@ -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="#449def" />
<stroke
android:width="1dp"
android:color="#2f6699" />
<corners
android:radius="1dp" />

</shape>
</item>
<item>
<shape>
<gradient
android:startColor="#449def"
android:endColor="#2f6699"
android:angle="270" />
<stroke
android:width="1dp"
android:color="#2f6699" />
<corners
android:radius="1dp" />

</shape>
</item>
</selector>
29 changes: 29 additions & 0 deletions android-social-signin/res/drawable-hdpi/button_gplus_bg.xml
Original file line number Diff line number Diff line change
@@ -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="#ef4444" />
<stroke
android:width="1dp"
android:color="#992f2f" />
<corners
android:radius="1dp" />

</shape>
</item>
<item>
<shape>
<gradient
android:startColor="#ef4444"
android:endColor="#992f2f"
android:angle="270" />
<stroke
android:width="1dp"
android:color="#992f2f" />
<corners
android:radius="1dp" />

</shape>
</item>
</selector>
29 changes: 29 additions & 0 deletions android-social-signin/res/drawable-hdpi/button_twitter_bg.xml
Original file line number Diff line number Diff line change
@@ -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="#74b7e0" />
<stroke
android:width="1dp"
android:color="#4b9ed1" />
<corners
android:radius="1dp" />

</shape>
</item>
<item>
<shape>
<gradient
android:startColor="#74b7e0"
android:endColor="#4b9ed1"
android:angle="270" />
<stroke
android:width="1dp"
android:color="#4b9ed1" />
<corners
android:radius="1dp" />

</shape>
</item>
</selector>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android-social-signin/res/drawable-hdpi/icon_fb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions android-social-signin/res/drawable-hdpi/layers_fb_button_bg.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:drawable="@drawable/button_fb_bg"
android:id="@+id/t_bg" />
<item
android:top="0dp" android:left="0dp">
<bitmap android:src="@drawable/icon_fb"
android:gravity="left" />
</item>
</layer-list>

12 changes: 12 additions & 0 deletions android-social-signin/res/drawable-hdpi/layers_gplus_button_bg.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:drawable="@drawable/button_gplus_bg"
android:id="@+id/t_bg" />
<item
android:top="0dp" android:left="3dp">
<bitmap android:src="@drawable/icon_gplus"
android:gravity="left" />
</item>
</layer-list>

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:drawable="@drawable/button_twitter_bg"
android:id="@+id/t_bg" />
<item
android:top="0dp" android:left="0dp">
<bitmap android:src="@drawable/icon_twitter"
android:gravity="left" />
</item>
</layer-list>

6 changes: 6 additions & 0 deletions android-social-signin/res/drawable-hdpi/linearlayout_bg.xml
Original file line number Diff line number Diff line change
@@ -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>
64 changes: 64 additions & 0 deletions android-social-signin/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -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="@drawable/balloon_bg">

<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/linearlayout_bg"
android:padding="10dp"
>


<Button
android:id="@+id/btnGplus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingLeft="30dp"
android:layout_margin="4dp"
android:background="@drawable/layers_gplus_button_bg"
android:text="Sign in with Google+"
style="@style/ButtonText"
/>
<Button
android:id="@+id/btnFb"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingLeft="30dp"
android:layout_margin="4dp"
android:background="@drawable/layers_fb_button_bg"
android:text="Sign in with Facebook"
style="@style/ButtonText"
/>
<Button
android:id="@+id/btnTwitter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingLeft="30dp"
android:layout_margin="4dp"
android:background="@drawable/layers_twitter_button_bg"
android:text="Sign in with Twitter"
style="@style/ButtonText"
/>
</LinearLayout>

</RelativeLayout>
9 changes: 9 additions & 0 deletions android-social-signin/res/menu/main.xml
Original file line number Diff line number Diff line change
@@ -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>
7 changes: 7 additions & 0 deletions android-social-signin/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -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>
22 changes: 22 additions & 0 deletions android-social-signin/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">Social Network Sign-In</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>

<style name="ButtonText">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#ffffff</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">#000000</item>
<item name="android:shadowDx">1</item>
<item name="android:shadowDy">1</item>
<item name="android:shadowRadius">2</item>
</style>

</resources>
20 changes: 20 additions & 0 deletions android-social-signin/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.hmkcode.android.signin;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

}

0 comments on commit ea25492

Please sign in to comment.