Added basis for styles, themes, colour scheme. Added activity for login.
|
@ -4,5 +4,6 @@
|
|||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry kind="lib" path="libs/android-support-v4.jar"/>
|
||||
<classpathentry kind="output" path="bin/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -7,16 +7,20 @@
|
|||
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />
|
||||
|
||||
<application
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name">
|
||||
android:icon="@drawable/logo"
|
||||
android:label="@string/newsblur"
|
||||
android:theme="@style/NewsBlurTheme">
|
||||
<activity
|
||||
android:name=".activity.Main"
|
||||
android:label="@string/app_name" >
|
||||
android:name=".activity.Login"
|
||||
android:label="@string/newsblur" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.Main"
|
||||
android:label="@string/newsblur" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
BIN
media/android/NewsBlur/libs/android-support-v4.jar
Normal file
Before Width: | Height: | Size: 9.2 KiB |
BIN
media/android/NewsBlur/res/drawable-hdpi/logo.png
Normal file
After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 166 B |
After Width: | Height: | Size: 166 B |
After Width: | Height: | Size: 162 B |
After Width: | Height: | Size: 303 B |
Before Width: | Height: | Size: 14 KiB |
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="@color/darkgray"
|
||||
android:startColor="@color/black" />
|
||||
|
||||
</shape>
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:padding="10dp"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/lightorange" />
|
||||
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="@color/lightorange"
|
||||
android:startColor="@color/darkorange" />
|
||||
|
||||
<corners
|
||||
android:bottomLeftRadius="12dp"
|
||||
android:bottomRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"
|
||||
android:topRightRadius="12dp" />
|
||||
|
||||
</shape>
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:padding="10dp"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/lightorange" />
|
||||
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="@color/darkorange"
|
||||
android:startColor="@color/lightorange" />
|
||||
|
||||
<corners
|
||||
android:bottomLeftRadius="12dp"
|
||||
android:bottomRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"
|
||||
android:topRightRadius="12dp" />
|
||||
|
||||
</shape>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/textfield_activated_blur" />
|
||||
</selector>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item android:state_pressed="true" android:drawable="@drawable/button_background_pressed" />
|
||||
<item android:drawable="@drawable/button_background_default" />
|
||||
|
||||
</selector>
|
49
media/android/NewsBlur/res/layout/fragment_login.xml
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="fill_parent" >
|
||||
|
||||
<EditText
|
||||
android:id="@+id/login_username"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="60dp"
|
||||
android:hint="@string/login_username_hint"
|
||||
android:inputType="textEmailAddress"
|
||||
android:textSize="22dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/login_password"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/login_username"
|
||||
android:layout_marginTop="40dp"
|
||||
android:hint="@string/login_password_hint"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="textPassword"
|
||||
android:nextFocusDown="@+id/login_button"
|
||||
android:textSize="22dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/signup_button"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:contentDescription="@string/description_signup_button"
|
||||
android:text="@string/login_button_signup" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/login_button"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:contentDescription="@string/description_login_button"
|
||||
android:text="@string/login_button_login" />
|
||||
|
||||
</RelativeLayout>
|
36
media/android/NewsBlur/res/layout/login.xml
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/activity_background" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/login_logo"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:contentDescription="@string/description_login_logo"
|
||||
android:src="@drawable/logo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/login_logo_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignBaseline="@+id/login_logo"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_toRightOf="@+id/login_logo"
|
||||
android:gravity="center"
|
||||
android:text="@string/newsblur"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="40dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/login_container"
|
||||
android:layout_width="280dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/login_logo" />
|
||||
|
||||
</RelativeLayout>
|
12
media/android/NewsBlur/res/values/colors.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<color name="white">#FFF</color>
|
||||
<color name="black">#000</color>
|
||||
<color name="darkgray">#434343</color>
|
||||
<color name="hintgray">#66bbbbbb</color>
|
||||
<color name="lightgray">#bbbbbb</color>
|
||||
<color name="lightorange">#d98800</color>
|
||||
<color name="darkorange">#b44a00</color>
|
||||
|
||||
</resources>
|
|
@ -1,7 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="newsblur">NewsBlur</string>
|
||||
|
||||
<string name="login_username_hint">username</string>
|
||||
<string name="login_password_hint">password</string>
|
||||
<string name="login_button_login">Log In</string>
|
||||
<string name="login_button_signup">Sign Up</string>
|
||||
|
||||
<string name="hello">Hello World!</string>
|
||||
<string name="app_name">NewsBlur</string>
|
||||
|
||||
<string name="description_login_button">Press to log in.</string>
|
||||
<string name="description_login_logo">NewsBlur Logo</string>
|
||||
<string name="description_signup_button">Press to sign up</string>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</resources>
|
25
media/android/NewsBlur/res/values/styles.xml
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="edittext" parent="@android:style/Widget.EditText">
|
||||
<item name="android:focusable">true</item>
|
||||
<item name="android:focusableInTouchMode">true</item>
|
||||
<item name="android:clickable">true</item>
|
||||
<item name="android:background">@drawable/edittext_newsblur</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:textColor">@color/white</item>
|
||||
<item name="android:textColorHint">@color/hintgray</item>
|
||||
</style>
|
||||
|
||||
<style name="button" parent="@android:style/Widget.Button">
|
||||
<item name="android:background">@drawable/selector_button_background</item>
|
||||
<item name="android:textColor">@color/white</item>
|
||||
<item name="android:shadowDx">2</item>
|
||||
<item name="android:shadowDy">2</item>
|
||||
<item name="android:shadowRadius">3</item>
|
||||
<item name="android:shadowColor">@color/darkgray</item>
|
||||
<item name="android:textSize">20dp</item>
|
||||
<item name="android:padding">15dp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
7
media/android/NewsBlur/res/values/theme.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="NewsBlurTheme" parent="@android:style/Theme" >
|
||||
<item name="android:editTextStyle">@style/edittext</item>
|
||||
<item name="android:buttonStyle">@style/button</item>
|
||||
</style>
|
||||
</resources>
|
32
media/android/NewsBlur/src/com/newsblur/activity/Login.java
Normal file
|
@ -0,0 +1,32 @@
|
|||
package com.newsblur.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.view.Window;
|
||||
|
||||
import com.newsblur.R;
|
||||
import com.newsblur.fragment.LoginFragment;
|
||||
|
||||
public class Login extends FragmentActivity {
|
||||
|
||||
private FragmentManager fragmentManager;
|
||||
private final static String currentTag = "currentFragment";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
setContentView(R.layout.login);
|
||||
|
||||
fragmentManager = getSupportFragmentManager();
|
||||
if (fragmentManager.findFragmentByTag(currentTag) == null) {
|
||||
FragmentTransaction transaction = fragmentManager.beginTransaction();
|
||||
transaction.add(R.id.login_container, new LoginFragment(), currentTag);
|
||||
transaction.commit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.newsblur.fragment;
|
||||
|
||||
import com.newsblur.R;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
public class LoginFragment extends Fragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_login, container, false);
|
||||
}
|
||||
}
|