-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
android social sign-in layout design
android social sign-in layout design
- Loading branch information
Showing
20 changed files
with
300 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
29
android-social-signin/res/drawable-hdpi/button_gplus_bg.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
29
android-social-signin/res/drawable-hdpi/button_twitter_bg.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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
12
android-social-signin/res/drawable-hdpi/layers_fb_button_bg.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
12
android-social-signin/res/drawable-hdpi/layers_gplus_button_bg.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
12 changes: 12 additions & 0 deletions
12
android-social-signin/res/drawable-hdpi/layers_twitter_button_bg.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
22 changes: 22 additions & 0 deletions
22
android-social-signin/src/com/hmkcode/android/signin/MainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} |