9 changed files with 313 additions and 198 deletions
-
2app/src/main/AndroidManifest.xml
-
48app/src/main/java/com/ouxuan/oxface/MainActivity.java
-
20app/src/main/res/drawable/gradient_button_selector.xml
-
10app/src/main/res/drawable/ic_eye_closed.xml
-
10app/src/main/res/drawable/ic_eye_open.xml
-
20app/src/main/res/drawable/splash_background.xml
-
386app/src/main/res/layout/activity_main.xml
-
6app/src/main/res/values/strings.xml
-
9app/src/main/res/values/themes.xml
@ -0,0 +1,10 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
android:width="24dp" |
||||
|
android:height="24dp" |
||||
|
android:viewportWidth="24" |
||||
|
android:viewportHeight="24"> |
||||
|
<path |
||||
|
android:fillColor="@color/secondary_text_color" |
||||
|
android:pathData="M12,7c2.76,0 5,2.24 5,5 0,0.65 -0.13,1.26 -0.36,1.83l2.92,2.92c1.51,-1.26 2.7,-2.89 3.43,-4.75 -1.73,-4.39 -6,-7.5 -11,-7.5 -1.4,0 -2.74,0.25 -3.98,0.7l2.16,2.16C10.74,7.13 11.35,7 12,7zM2,4.27l2.28,2.28 0.46,0.46C3.08,8.3 1.78,10.02 1,12c1.73,4.39 6,7.5 11,7.5 1.55,0 3.03,-0.3 4.38,-0.84l0.42,0.42L19.73,22 21,20.73 3.27,3 2,4.27zM7.53,9.8l1.55,1.55c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.66 1.34,3 3,3 0.22,0 0.44,-0.03 0.65,-0.08l1.55,1.55c-0.67,0.33 -1.41,0.53 -2.2,0.53 -2.76,0 -5,-2.24 -5,-5 0,-0.79 0.2,-1.53 0.53,-2.2zM11.84,9.02l3.15,3.15 0.02,-0.16c0,-1.66 -1.34,-3 -3,-3l-0.17,0.01z"/> |
||||
|
</vector> |
@ -0,0 +1,10 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
android:width="24dp" |
||||
|
android:height="24dp" |
||||
|
android:viewportWidth="24" |
||||
|
android:viewportHeight="24"> |
||||
|
<path |
||||
|
android:fillColor="@color/secondary_text_color" |
||||
|
android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/> |
||||
|
</vector> |
@ -0,0 +1,20 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
|
<!-- 渐变背景 --> |
||||
|
<item> |
||||
|
<shape> |
||||
|
<gradient |
||||
|
android:startColor="#E8F5E8" |
||||
|
android:centerColor="#F0F9F0" |
||||
|
android:endColor="#FAFEFB" |
||||
|
android:angle="135" |
||||
|
android:type="linear" /> |
||||
|
</shape> |
||||
|
</item> |
||||
|
|
||||
|
<!-- 可选:添加Logo居中显示 --> |
||||
|
<item android:gravity="center"> |
||||
|
<bitmap android:src="@mipmap/ic_launcher" |
||||
|
android:gravity="center" /> |
||||
|
</item> |
||||
|
</layer-list> |
@ -1,218 +1,242 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" |
|
||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
xmlns:tools="http://schemas.android.com/tools" |
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
android:layout_height="match_parent" |
||||
android:background="@drawable/gradient_background" |
android:background="@drawable/gradient_background" |
||||
android:fillViewport="true"> |
|
||||
|
|
||||
<androidx.constraintlayout.widget.ConstraintLayout |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:minHeight="@dimen/min_screen_height" |
|
||||
android:paddingStart="32dp" |
android:paddingStart="32dp" |
||||
android:paddingEnd="32dp" |
android:paddingEnd="32dp" |
||||
tools:context=".MainActivity"> |
tools:context=".MainActivity"> |
||||
|
|
||||
<!-- Logo容器 --> |
|
||||
<androidx.cardview.widget.CardView |
|
||||
android:id="@+id/logoContainer" |
|
||||
android:layout_width="120dp" |
|
||||
android:layout_height="120dp" |
|
||||
android:layout_marginTop="80dp" |
|
||||
app:cardCornerRadius="60dp" |
|
||||
app:cardElevation="12dp" |
|
||||
app:cardBackgroundColor="@color/white" |
|
||||
app:layout_constraintEnd_toEndOf="parent" |
|
||||
app:layout_constraintStart_toStartOf="parent" |
|
||||
app:layout_constraintTop_toTopOf="parent"> |
|
||||
|
|
||||
<ImageView |
|
||||
android:id="@+id/imageViewLogo" |
|
||||
android:layout_width="60dp" |
|
||||
android:layout_height="60dp" |
|
||||
android:layout_gravity="center" |
|
||||
android:src="@drawable/ic_login_logo" |
|
||||
android:contentDescription="@string/app_logo" /> |
|
||||
|
|
||||
</androidx.cardview.widget.CardView> |
|
||||
|
|
||||
<!-- 用户名输入框 --> |
|
||||
<androidx.cardview.widget.CardView |
|
||||
android:id="@+id/usernameCard" |
|
||||
|
<!-- 登录内容容器 - 垂直居中 --> |
||||
|
<LinearLayout |
||||
|
android:id="@+id/loginContentContainer" |
||||
android:layout_width="0dp" |
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
android:layout_height="wrap_content" |
||||
android:layout_marginTop="80dp" |
|
||||
app:cardCornerRadius="25dp" |
|
||||
app:cardElevation="4dp" |
|
||||
app:cardBackgroundColor="@color/white" |
|
||||
app:layout_constraintEnd_toEndOf="parent" |
|
||||
|
android:orientation="vertical" |
||||
|
android:gravity="center_horizontal" |
||||
|
app:layout_constraintTop_toTopOf="parent" |
||||
|
app:layout_constraintBottom_toTopOf="@+id/bottomInfoLayout" |
||||
app:layout_constraintStart_toStartOf="parent" |
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@+id/logoContainer"> |
|
||||
|
|
||||
<LinearLayout |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="50dp" |
|
||||
android:orientation="horizontal" |
|
||||
android:gravity="center_vertical" |
|
||||
android:paddingStart="16dp" |
|
||||
android:paddingEnd="16dp"> |
|
||||
|
app:layout_constraintEnd_toEndOf="parent"> |
||||
|
|
||||
|
<!-- Logo容器 --> |
||||
|
<androidx.cardview.widget.CardView |
||||
|
android:id="@+id/logoContainer" |
||||
|
android:layout_width="80dp" |
||||
|
android:layout_height="80dp" |
||||
|
android:layout_marginBottom="40dp" |
||||
|
app:cardCornerRadius="40dp" |
||||
|
app:cardElevation="8dp" |
||||
|
app:cardBackgroundColor="@color/white"> |
||||
|
|
||||
<ImageView |
<ImageView |
||||
android:layout_width="24dp" |
|
||||
android:layout_height="24dp" |
|
||||
android:src="@drawable/ic_person" |
|
||||
android:layout_marginEnd="12dp" |
|
||||
android:contentDescription="用户图标" /> |
|
||||
|
|
||||
<EditText |
|
||||
android:id="@+id/editTextUsername" |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="match_parent" |
|
||||
android:layout_weight="1" |
|
||||
android:hint="@string/hint_username" |
|
||||
android:inputType="text" |
|
||||
android:maxLines="1" |
|
||||
android:background="@android:color/transparent" |
|
||||
android:textColor="@color/primary_text_color" |
|
||||
android:textColorHint="@color/secondary_text_color" |
|
||||
android:textSize="16sp" /> |
|
||||
|
|
||||
</LinearLayout> |
|
||||
|
|
||||
</androidx.cardview.widget.CardView> |
|
||||
|
|
||||
<!-- 密码输入框 --> |
|
||||
<androidx.cardview.widget.CardView |
|
||||
android:id="@+id/passwordCard" |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_marginTop="16dp" |
|
||||
app:cardCornerRadius="25dp" |
|
||||
app:cardElevation="4dp" |
|
||||
app:cardBackgroundColor="@color/white" |
|
||||
app:layout_constraintEnd_toEndOf="parent" |
|
||||
app:layout_constraintStart_toStartOf="parent" |
|
||||
app:layout_constraintTop_toBottomOf="@+id/usernameCard"> |
|
||||
|
|
||||
<LinearLayout |
|
||||
|
android:id="@+id/imageViewLogo" |
||||
|
android:layout_width="40dp" |
||||
|
android:layout_height="40dp" |
||||
|
android:layout_gravity="center" |
||||
|
android:src="@drawable/ic_login_logo" |
||||
|
android:contentDescription="@string/app_logo" /> |
||||
|
|
||||
|
</androidx.cardview.widget.CardView> |
||||
|
|
||||
|
<!-- 用户名输入框 --> |
||||
|
<androidx.cardview.widget.CardView |
||||
|
android:id="@+id/usernameCard" |
||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||
android:layout_height="50dp" |
|
||||
android:orientation="horizontal" |
|
||||
android:gravity="center_vertical" |
|
||||
android:paddingStart="16dp" |
|
||||
android:paddingEnd="16dp"> |
|
||||
|
|
||||
<ImageView |
|
||||
android:layout_width="24dp" |
|
||||
android:layout_height="24dp" |
|
||||
android:src="@drawable/ic_lock" |
|
||||
android:layout_marginEnd="12dp" |
|
||||
android:contentDescription="密码图标" /> |
|
||||
|
|
||||
<EditText |
|
||||
android:id="@+id/editTextPassword" |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="match_parent" |
|
||||
android:layout_weight="1" |
|
||||
android:hint="@string/hint_password" |
|
||||
android:inputType="textPassword" |
|
||||
android:maxLines="1" |
|
||||
android:background="@android:color/transparent" |
|
||||
android:textColor="@color/primary_text_color" |
|
||||
android:textColorHint="@color/secondary_text_color" |
|
||||
android:textSize="16sp" /> |
|
||||
|
|
||||
</LinearLayout> |
|
||||
|
|
||||
</androidx.cardview.widget.CardView> |
|
||||
|
|
||||
<!-- 提示文字 --> |
|
||||
<TextView |
|
||||
android:id="@+id/textViewHint" |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_marginTop="16dp" |
|
||||
android:text="登录账号密码请从PC端后台管理【设备运营管理平台管理】里获取" |
|
||||
android:textColor="@color/white" |
|
||||
android:textSize="12sp" |
|
||||
android:gravity="center" |
|
||||
android:alpha="0.8" |
|
||||
app:layout_constraintEnd_toEndOf="parent" |
|
||||
app:layout_constraintStart_toStartOf="parent" |
|
||||
app:layout_constraintTop_toBottomOf="@+id/passwordCard" /> |
|
||||
|
|
||||
<!-- 登录按钮 --> |
|
||||
<androidx.cardview.widget.CardView |
|
||||
android:id="@+id/loginButtonCard" |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_marginTop="60dp" |
|
||||
app:cardCornerRadius="25dp" |
|
||||
app:cardElevation="0dp" |
|
||||
app:cardBackgroundColor="@android:color/transparent" |
|
||||
app:layout_constraintEnd_toEndOf="parent" |
|
||||
app:layout_constraintStart_toStartOf="parent" |
|
||||
app:layout_constraintTop_toBottomOf="@+id/textViewHint"> |
|
||||
|
|
||||
<Button |
|
||||
android:id="@+id/buttonLogin" |
|
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_marginBottom="16dp" |
||||
|
app:cardCornerRadius="25dp" |
||||
|
app:cardElevation="4dp" |
||||
|
app:cardBackgroundColor="@color/white"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="50dp" |
||||
|
android:orientation="horizontal" |
||||
|
android:gravity="center_vertical" |
||||
|
android:paddingStart="16dp" |
||||
|
android:paddingEnd="16dp"> |
||||
|
|
||||
|
<ImageView |
||||
|
android:layout_width="24dp" |
||||
|
android:layout_height="24dp" |
||||
|
android:src="@drawable/ic_person" |
||||
|
android:layout_marginEnd="12dp" |
||||
|
android:contentDescription="用户图标" /> |
||||
|
|
||||
|
<EditText |
||||
|
android:id="@+id/editTextUsername" |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_weight="1" |
||||
|
android:hint="@string/hint_username" |
||||
|
android:inputType="text" |
||||
|
android:maxLines="1" |
||||
|
android:background="@android:color/transparent" |
||||
|
android:textColor="@color/primary_text_color" |
||||
|
android:textColorHint="@color/secondary_text_color" |
||||
|
android:textSize="16sp" /> |
||||
|
|
||||
|
</LinearLayout> |
||||
|
|
||||
|
</androidx.cardview.widget.CardView> |
||||
|
|
||||
|
<!-- 密码输入框 --> |
||||
|
<androidx.cardview.widget.CardView |
||||
|
android:id="@+id/passwordCard" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_marginBottom="12dp" |
||||
|
app:cardCornerRadius="25dp" |
||||
|
app:cardElevation="4dp" |
||||
|
app:cardBackgroundColor="@color/white"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="50dp" |
||||
|
android:orientation="horizontal" |
||||
|
android:gravity="center_vertical" |
||||
|
android:paddingStart="16dp" |
||||
|
android:paddingEnd="16dp"> |
||||
|
|
||||
|
<ImageView |
||||
|
android:layout_width="24dp" |
||||
|
android:layout_height="24dp" |
||||
|
android:src="@drawable/ic_lock" |
||||
|
android:layout_marginEnd="12dp" |
||||
|
android:contentDescription="密码图标" /> |
||||
|
|
||||
|
<EditText |
||||
|
android:id="@+id/editTextPassword" |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_weight="1" |
||||
|
android:hint="@string/hint_password" |
||||
|
android:inputType="textPassword" |
||||
|
android:maxLines="1" |
||||
|
android:background="@android:color/transparent" |
||||
|
android:textColor="@color/primary_text_color" |
||||
|
android:textColorHint="@color/secondary_text_color" |
||||
|
android:textSize="16sp" /> |
||||
|
|
||||
|
<ImageView |
||||
|
android:id="@+id/imageViewPasswordToggle" |
||||
|
android:layout_width="24dp" |
||||
|
android:layout_height="24dp" |
||||
|
android:src="@drawable/ic_eye_closed" |
||||
|
android:layout_marginStart="8dp" |
||||
|
android:clickable="true" |
||||
|
android:focusable="true" |
||||
|
android:background="?android:attr/selectableItemBackgroundBorderless" |
||||
|
android:padding="4dp" |
||||
|
android:contentDescription="密码显示切换" /> |
||||
|
|
||||
|
</LinearLayout> |
||||
|
|
||||
|
</androidx.cardview.widget.CardView> |
||||
|
|
||||
|
<!-- 提示文字 --> |
||||
|
<TextView |
||||
|
android:id="@+id/textViewHint" |
||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||
android:layout_height="50dp" |
|
||||
android:text="@string/login_button" |
|
||||
android:textSize="18sp" |
|
||||
android:textStyle="bold" |
|
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_marginBottom="32dp" |
||||
|
android:text="登录账号密码请从PC端后台管理【设备运营管理平台管理】里获取" |
||||
android:textColor="@color/white" |
android:textColor="@color/white" |
||||
android:background="@drawable/gradient_button_selector" |
|
||||
android:elevation="0dp" |
|
||||
android:stateListAnimator="@null" /> |
|
||||
|
android:textSize="11sp" |
||||
|
android:gravity="center" |
||||
|
android:alpha="0.8" /> |
||||
|
|
||||
</androidx.cardview.widget.CardView> |
|
||||
|
<!-- 登录按钮 --> |
||||
|
<androidx.cardview.widget.CardView |
||||
|
android:id="@+id/loginButtonCard" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
app:cardCornerRadius="25dp" |
||||
|
app:cardElevation="0dp" |
||||
|
app:cardBackgroundColor="@android:color/transparent"> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/buttonLogin" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="50dp" |
||||
|
android:text="@string/login_button" |
||||
|
android:textSize="18sp" |
||||
|
android:textStyle="bold" |
||||
|
android:textColor="@color/white" |
||||
|
android:background="@drawable/gradient_button_selector" |
||||
|
android:gravity="center" |
||||
|
android:clickable="true" |
||||
|
android:focusable="true" |
||||
|
android:elevation="0dp" /> |
||||
|
|
||||
|
</androidx.cardview.widget.CardView> |
||||
|
|
||||
<!-- 版本信息 --> |
|
||||
|
</LinearLayout> |
||||
|
|
||||
|
<!-- 底部信息区域 --> |
||||
<LinearLayout |
<LinearLayout |
||||
|
android:id="@+id/bottomInfoLayout" |
||||
android:layout_width="0dp" |
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
android:layout_height="wrap_content" |
||||
android:layout_marginBottom="20dp" |
|
||||
android:orientation="horizontal" |
|
||||
|
android:layout_marginBottom="12dp" |
||||
|
android:orientation="vertical" |
||||
|
android:gravity="center" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintEnd_toEndOf="parent" |
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent"> |
app:layout_constraintStart_toStartOf="parent"> |
||||
|
|
||||
|
<!-- 设备ID --> |
||||
<TextView |
<TextView |
||||
android:layout_width="0dp" |
|
||||
|
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
|
||||
android:text="重启设备" |
|
||||
|
android:text="设备ID: c9cb00145a2ac56f" |
||||
android:textColor="@color/white" |
android:textColor="@color/white" |
||||
android:textSize="12sp" |
|
||||
android:alpha="0.7" /> |
|
||||
|
android:textSize="10sp" |
||||
|
android:alpha="1.0" |
||||
|
android:layout_marginBottom="4dp" /> |
||||
|
|
||||
<TextView |
|
||||
|
<!-- 版本和重启 --> |
||||
|
<LinearLayout |
||||
android:layout_width="wrap_content" |
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
android:layout_height="wrap_content" |
||||
android:text="Version 1.8.3.9" |
|
||||
android:textColor="@color/white" |
|
||||
android:textSize="12sp" |
|
||||
android:alpha="0.7" /> |
|
||||
|
android:orientation="horizontal" |
||||
|
android:gravity="center"> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/textRestart" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:text="重启设备" |
||||
|
android:textColor="@color/white" |
||||
|
android:textSize="10sp" |
||||
|
android:alpha="1.0" |
||||
|
android:clickable="true" |
||||
|
android:focusable="true" |
||||
|
android:background="?android:attr/selectableItemBackgroundBorderless" |
||||
|
android:padding="8dp" /> |
||||
|
|
||||
|
<View |
||||
|
android:layout_width="1dp" |
||||
|
android:layout_height="12dp" |
||||
|
android:layout_marginStart="8dp" |
||||
|
android:layout_marginEnd="8dp" |
||||
|
android:background="@color/white" |
||||
|
android:alpha="0.3" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:text="Version 1.8.3.9" |
||||
|
android:textColor="@color/white" |
||||
|
android:textSize="10sp" |
||||
|
android:alpha="1.0" /> |
||||
|
|
||||
</LinearLayout> |
|
||||
|
</LinearLayout> |
||||
|
|
||||
<TextView |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_marginBottom="4dp" |
|
||||
android:text="本机设备ID:c9cb00145a2ac56f" |
|
||||
android:textColor="@color/white" |
|
||||
android:textSize="12sp" |
|
||||
android:alpha="0.7" |
|
||||
android:gravity="end" |
|
||||
app:layout_constraintBottom_toTopOf="@+id/linearLayout" |
|
||||
app:layout_constraintEnd_toEndOf="parent" |
|
||||
app:layout_constraintStart_toStartOf="parent" |
|
||||
android:id="@+id/linearLayout" /> |
|
||||
|
</LinearLayout> |
||||
|
|
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
|
||||
|
|
||||
</ScrollView> |
|
||||
|
</androidx.constraintlayout.widget.ConstraintLayout> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue