Android: login activity design

This commit is contained in:
jendib 2015-05-04 20:51:32 +02:00
parent 1f092f7d93
commit f1eb3795d9
6 changed files with 83 additions and 95 deletions

View File

@ -75,6 +75,12 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/22.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.shamanland/fab/0.0.6/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/it.sephiroth.android.library.easing/android-easing/1.0.3/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/it.sephiroth.android.library.imagezoom/imagezoom/1.0.5/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />

View File

@ -3,7 +3,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
classpath 'com.android.tools.build:gradle:1.2.2'
}
}
apply plugin: 'com.android.application'

View File

@ -16,7 +16,8 @@
android:theme="@style/AppTheme" >
<activity
android:name=".activity.LoginActivity"
android:label="@string/app_name" >
android:label="@string/app_name"
android:theme="@style/AppThemeDark">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

View File

@ -2,110 +2,80 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="top|center_horizontal"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical" >
android:orientation="vertical"
android:background="@color/colorPrimaryDark">
<ScrollView
<LinearLayout
android:id="@+id/loginForm"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="20dp"
android:scrollbarStyle="insideOverlay"
android:visibility="gone" >
android:visibility="visible"
android:padding="40dp"
android:orientation="vertical">
<LinearLayout
<ImageView
android:contentDescription="@string/app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:layout_marginBottom="20dp" />
<TextView
android:id="@+id/loginExplain"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/txtServer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:hint="@string/server"
android:inputType="textNoSuggestions">
</EditText>
<EditText
android:id="@+id/txtUsername"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:hint="@string/username"
android:inputType="textNoSuggestions">
<requestFocus />
</EditText>
<EditText
android:id="@+id/txtPassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:hint="@string/password"
android:inputType="textPassword">
</EditText>
<Button
android:id="@+id/btnConnect"
android:layout_width="fill_parent"
android:layout_height="50dip"
android:layout_marginTop="20dip"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:id="@+id/loginExplain"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="@string/server" />
<EditText
android:id="@+id/txtServer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:inputType="textNoSuggestions">
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="@string/username" />
<EditText
android:id="@+id/txtUsername"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:inputType="textNoSuggestions" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="@string/password" />
<EditText
android:id="@+id/txtPassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:inputType="textPassword" >
</EditText>
</LinearLayout>
<Button
android:id="@+id/btnConnect"
android:layout_width="fill_parent"
android:layout_height="50dip"
android:layout_marginTop="20dip"
android:gravity="center"
android:text="@string/login"
android:textColor="@android:color/black" />
</LinearLayout>
</ScrollView>
android:text="@string/login" />
</LinearLayout>
<LinearLayout
android:id="@+id/progressBar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:visibility="visible" >
android:visibility="gone">
<ProgressBar
style="?android:attr/progressBarStyleLarge"

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#263238</color>
<color name="colorPrimaryDark">#21272b</color>
<color name="colorAccent">#009688</color>
</resources>

View File

@ -1,10 +1,15 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">#263238</item>
<item name="colorPrimaryDark">#21272b</item>
<item name="colorAccent">#009688</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppThemeDark" parent="Theme.AppCompat.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>