fix: user register; update dependencies

This commit is contained in:
hyb1996
2017-10-26 17:01:29 +08:00
parent 1e5c05efb9
commit f55593a7a2
30 changed files with 630 additions and 239 deletions

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="25dp"/>
<size
android:width="50dp"
android:height="50dp"/>
<solid android:color="#d56"/>
</shape>

View File

@@ -0,0 +1,10 @@
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>
<gradient
android:angle="270"
android:endColor="#7d000000"
android:startColor="#27ffffff"/>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -1,158 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
android:orientation="vertical">
<com.stardust.theme.widget.ThemeColorToolbar
android:id="@+id/toolbar"
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:title="@string/text_login"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.CardView
android:id="@+id/cv"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="64dp"
app:cardCornerRadius="6dp"
app:cardElevation="3dp"
app:cardUseCompatPadding="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="10dp">
<View
android:layout_width="8dp"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:background="#2fa881"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="50dp"
android:text="@string/text_login"
android:textColor="#FFCC00"
android:textSize="18sp"
android:textStyle="bold"
/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:paddingEnd="30dp"
android:paddingStart="50dp">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/text_username"
android:inputType="textPersonName"
android:textSize="16sp"/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingEnd="30dp"
android:paddingStart="50dp">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/text_password"
android:inputType="textPassword"
android:textSize="16sp"
/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="25dp"
android:gravity="center">
<Button
android:id="@+id/login"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="150dp"
android:layout_height="50dp"
android:text="@string/text_login"
>
</Button>
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:text="@string/text_forgot_password"
android:textColor="#9a9a9a"
android:textSize="12sp"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@id/cv"
android:layout_alignTop="@id/cv"
android:layout_marginEnd="-20dp"
android:layout_marginTop="25dp"
android:src="@drawable/ic_add_white_48dp"
android:transitionName="loginFab"
app:fabSize="normal"
/>
</RelativeLayout>
android:theme="@style/AppTheme.AppBarOverlay">
<com.stardust.theme.widget.ThemeColorToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:title="@string/text_login"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="12dp">
<android.support.design.widget.TextInputEditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/text_username"
android:textColor="#dd000000"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp">
<android.support.design.widget.TextInputEditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/text_password"
android:inputType="textPassword"
android:textColor="#dd000000"/>
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:id="@+id/forgot_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:orientation="horizontal"
android:padding="4dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/text_forgot_password"
android:textColor="#929397"
android:textSize="12sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/text_reset_password"
android:textColor="@color/colorAccent"
android:textSize="12sp"/>
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@color/colorPrimary"
android:foreground="?selectableItemBackground"
android:gravity="center"
android:padding="12dp"
android:text="@string/text_login"
android:textColor="@android:color/white"
android:textSize="15sp"/>
</FrameLayout>

View File

@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<com.stardust.theme.widget.ThemeColorToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:title="@string/text_login"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="12dp">
<android.support.design.widget.TextInputEditText
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/text_email"
android:inputType="textEmailAddress"
android:textColor="#dd000000"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp">
<android.support.design.widget.TextInputEditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/text_username"
android:textColor="#dd000000"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp">
<android.support.design.widget.TextInputEditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/text_password"
android:inputType="textPassword"
android:textColor="#dd000000"/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<TextView
android:id="@+id/register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@color/colorPrimary"
android:foreground="?selectableItemBackground"
android:gravity="center"
android:padding="12dp"
android:text="@string/text_register"
android:textColor="@android:color/white"
android:textSize="15sp"/>
</FrameLayout>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/icon_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/avatar_view_bg"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="20sp"
android:visibility="gone"
tools:text="A"/>
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/icon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitCenter"
android:src="@drawable/profile_avatar_placeholder"
app:riv_mutate_background="true"
app:riv_oval="true"/>
</FrameLayout>

View File

@@ -16,18 +16,21 @@
android:layout_height="170dp"
android:layout_marginBottom="5dp">
<com.makeramen.roundedimageview.RoundedImageView
<View
android:id="@+id/shadow"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/drawer_header_shadow"
android:visibility="gone"/>
<com.stardust.scriptdroid.ui.widget.AvatarView
android:id="@+id/avatar"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_above="@+id/username"
android:layout_marginBottom="16dp"
android:layout_marginLeft="8dp"
android:scaleType="fitXY"
android:src="@drawable/profile_avatar_placeholder"
app:riv_border_color="#77f2f3f5"
app:riv_border_width="0.5dp"
app:riv_corner_radius="40dp"/>
android:layout_marginBottom="8dp"
android:layout_marginLeft="12dp"
android:scaleType="fitXY"/>
<TextView
android:id="@+id/username"
@@ -35,24 +38,23 @@
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="16dp"
android:layout_marginLeft="12dp"
android:layout_marginBottom="12dp"
android:layout_marginLeft="20dp"
android:gravity="center"
android:text="@string/not_login"
android:textColor="@android:color/white"
android:textSize="14sp"/>
android:textSize="16sp"/>
<ImageView
android:id="@+id/default_cover"
android:layout_width="match_parent"
android:layout_height="118dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="-12dp"
android:layout_toRightOf="@+id/avatar"
android:alpha="0.08"
android:src="@drawable/android_eating_half"
android:tint="#000000"/>
</RelativeLayout>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_register"
android:icon="@drawable/ic_ali_register"
android:title="@string/text_register"
app:showAsAction="always"/>
</menu>

View File

@@ -200,7 +200,7 @@
<string name="text_username">用户名</string>
<string name="text_password">密码</string>
<string name="text_login">登录</string>
<string name="text_forgot_password">忘记密码</string>
<string name="text_forgot_password">忘记密码?</string>
<string name="text_username_cannot_be_empty">用户名不能为空</string>
<string name="text_password_cannot_be_empty">密码不能为空</string>
<string name="text_time">时间</string>
@@ -266,6 +266,15 @@
<string name="text_use_android_n_shortcut">添加到图标快捷方式</string>
<string name="text_login_succeed">登录成功</string>
<string name="text_login_fail">登录失败</string>
<string name="text_reset_password">重置密码</string>
<string name="text_logining">登录中</string>
<string name="text_register">注册</string>
<string name="text_email">邮箱</string>
<string name="text_email_cannot_be_empty">邮箱不能为空</string>
<string name="text_email_format_error">邮箱格式错误</string>
<string name="text_registering">注册中</string>
<string name="text_register_fail">注册失败</string>
<string name="text_register_succeed">注册成功</string>
<string-array name="ad_showing_mode_keys">