Forráskód Böngészése

refactor(更新)
- 界面背景修改,以及个人信息界面新增

周文健 5 hónapja
szülő
commit
a1f6d24173

+ 18 - 0
app/src/main/java/com/grkj/iscs/features/main/fragment/user_info/UserInfoFragment.kt

@@ -0,0 +1,18 @@
+package com.grkj.iscs.features.main.fragment.user_info
+
+import com.grkj.iscs.R
+import com.grkj.iscs.databinding.FragmentUserInfoBinding
+import com.grkj.ui_base.base.BaseFragment
+
+/**
+ * 个人信息
+ */
+class UserInfoFragment : BaseFragment<FragmentUserInfoBinding>() {
+    override fun getLayoutId(): Int {
+        return R.layout.fragment_user_info
+    }
+
+    override fun initView() {
+        TODO("Not yet implemented")
+    }
+}

+ 4 - 5
app/src/main/res/drawable/bg_common_input.xml

@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <stroke
-        android:width="1dp"
-        android:color="@color/black" />
-</shape>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/bg_common_input_disable" android:state_enabled="false" />
+    <item android:drawable="@drawable/bg_common_input_normal" />
+</selector>

+ 7 - 0
app/src/main/res/drawable/bg_common_input_disable.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <stroke
+        android:width="1dp"
+        android:color="@color/black" />
+    <solid android:color="@color/common_light_gray" />
+</shape>

+ 7 - 0
app/src/main/res/drawable/bg_common_input_disable_land.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <stroke
+        android:width="0.5dp"
+        android:color="@color/black" />
+    <solid android:color="@color/common_light_gray" />
+</shape>

+ 4 - 5
app/src/main/res/drawable/bg_common_input_land.xml

@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <stroke
-        android:width="0.5dp"
-        android:color="@color/black" />
-</shape>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/bg_common_input_disable_land" android:state_enabled="false" />
+    <item android:drawable="@drawable/bg_common_input_normal_land" />
+</selector>

+ 6 - 0
app/src/main/res/drawable/bg_common_input_normal.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <stroke
+        android:width="1dp"
+        android:color="@color/black" />
+</shape>

+ 6 - 0
app/src/main/res/drawable/bg_common_input_normal_land.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <stroke
+        android:width="0.5dp"
+        android:color="@color/black" />
+</shape>

+ 5 - 5
app/src/main/res/layout-land/fragment_home.xml

@@ -86,7 +86,7 @@
                             android:layout_width="180dp"
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="5dp"
-                            android:background="@drawable/bg_common_input"
+                            android:background="@drawable/bg_common_input_land"
                             android:drawableRight="@drawable/icon_drop_down"
                             android:gravity="center_vertical"
                             android:paddingHorizontal="5dp"
@@ -113,7 +113,7 @@
                             android:layout_width="180dp"
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="10dp"
-                            android:background="@drawable/bg_common_input"
+                            android:background="@drawable/bg_common_input_land"
                             android:drawableRight="@drawable/icon_drop_down"
                             android:gravity="center_vertical"
                             android:paddingHorizontal="5dp"
@@ -274,7 +274,7 @@
                             android:layout_width="210dp"
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="5dp"
-                            android:background="@drawable/bg_common_input"
+                            android:background="@drawable/bg_common_input_land"
                             android:gravity="center_vertical"
                             android:paddingHorizontal="10dp"
                             android:paddingVertical="5dp"
@@ -294,7 +294,7 @@
                             android:layout_width="210dp"
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="5dp"
-                            android:background="@drawable/bg_common_input"
+                            android:background="@drawable/bg_common_input_land"
                             android:gravity="center_vertical"
                             android:paddingHorizontal="5dp"
                             android:paddingVertical="2.5dp"
@@ -321,7 +321,7 @@
                             android:layout_width="210dp"
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="5dp"
-                            android:background="@drawable/bg_common_input"
+                            android:background="@drawable/bg_common_input_land"
                             android:drawableRight="@drawable/icon_drop_down"
                             android:gravity="center_vertical"
                             android:paddingHorizontal="10dp"

+ 1 - 1
app/src/main/res/layout/dialog_add_user.xml

@@ -54,7 +54,7 @@
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:text="@string/user_manage_nickname"
+                    android:text="@string/nickname"
                     android:textColor="@color/black"
                     android:textSize="18sp" />
 

+ 1 - 1
app/src/main/res/layout/dialog_filter_user.xml

@@ -54,7 +54,7 @@
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:text="@string/user_manage_nickname"
+                    android:text="@string/nickname"
                     android:textColor="@color/black"
                     android:textSize="18sp" />
 

+ 1 - 1
app/src/main/res/layout/dialog_update_user.xml

@@ -54,7 +54,7 @@
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:text="@string/user_manage_nickname"
+                    android:text="@string/nickname"
                     android:textColor="@color/black"
                     android:textSize="18sp" />
 

+ 185 - 0
app/src/main/res/layout/fragment_user_info.xml

@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout 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">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_margin="20dp"
+        android:background="@drawable/home_card_bg"
+        android:orientation="vertical">
+
+        <LinearLayout
+            android:id="@+id/title_layout"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:paddingHorizontal="10dp"
+            android:paddingVertical="5dp">
+
+            <ImageView
+                android:layout_width="20dp"
+                android:layout_height="20dp"
+                android:src="@mipmap/icon_data_manage_menu_user_manage" />
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:layout_weight="1"
+                android:text="@string/user_info_title"
+                android:textColor="@color/black"
+                android:textSize="24sp" />
+
+            <TextView
+                android:id="@+id/back"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:background="@drawable/common_dialog_btn"
+                android:paddingHorizontal="20dp"
+                android:text="@string/back"
+                android:textColor="@color/black"
+                android:textSize="20sp" />
+        </LinearLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:background="@color/black" />
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="20dp"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:paddingHorizontal="100dp">
+
+            <TextView
+                android:id="@+id/username_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/user_name"
+                android:textColor="@color/black"
+                android:textSize="18sp"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <TextView
+                android:id="@+id/username"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:background="@drawable/bg_common_input"
+                android:enabled="false"
+                android:maxLines="1"
+                android:paddingHorizontal="10dp"
+                android:paddingVertical="2dp"
+                android:singleLine="true"
+                android:textColor="@color/black"
+                android:textSize="18sp"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toEndOf="@+id/username_tv"
+                app:layout_constraintTop_toTopOf="@+id/username_tv" />
+
+            <TextView
+                android:id="@+id/nickname_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:text="@string/nickname"
+                android:textColor="@color/black"
+                android:textSize="18sp"
+                app:layout_constraintEnd_toEndOf="@+id/username_tv"
+                app:layout_constraintTop_toBottomOf="@+id/username_tv" />
+
+            <EditText
+                android:id="@+id/nickname_et"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:background="@drawable/bg_common_input"
+                android:hint="@string/please_input_nickname"
+                android:maxLines="1"
+                android:paddingHorizontal="10dp"
+                android:paddingVertical="2dp"
+                android:singleLine="true"
+                android:textColor="@color/black"
+                android:textSize="18sp"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toEndOf="@+id/nickname_tv"
+                app:layout_constraintTop_toTopOf="@+id/nickname_tv" />
+
+
+            <TextView
+                android:id="@+id/phone_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:text="@string/phone"
+                android:textColor="@color/black"
+                android:textSize="18sp"
+                app:layout_constraintEnd_toEndOf="@+id/nickname_tv"
+                app:layout_constraintTop_toBottomOf="@+id/nickname_tv" />
+
+            <EditText
+                android:id="@+id/phone_et"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:background="@drawable/bg_common_input"
+                android:hint="@string/please_input_phone"
+                android:maxLines="1"
+                android:paddingHorizontal="10dp"
+                android:paddingVertical="2dp"
+                android:singleLine="true"
+                android:textColor="@color/black"
+                android:textSize="18sp"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toEndOf="@+id/phone_tv"
+                app:layout_constraintTop_toTopOf="@+id/phone_tv" />
+
+        </androidx.constraintlayout.widget.ConstraintLayout>
+
+        <View
+            android:layout_width="0dp"
+            android:layout_height="0dp"
+            android:layout_weight="1" />
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            android:padding="10dp">
+
+            <View
+                android:layout_width="0dp"
+                android:layout_height="1dp"
+                android:layout_weight="1" />
+
+            <TextView
+                android:id="@+id/confirm"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:background="@drawable/common_dialog_btn"
+                android:paddingHorizontal="20dp"
+                android:text="@string/confirm"
+                android:textColor="@color/black"
+                android:textSize="20sp" />
+
+            <TextView
+                android:id="@+id/cancel"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginHorizontal="10dp"
+                android:background="@drawable/common_dialog_btn"
+                android:paddingHorizontal="20dp"
+                android:text="@string/cancel"
+                android:textColor="@color/black"
+                android:textSize="20sp" />
+        </LinearLayout>
+    </LinearLayout>
+</layout>

+ 1 - 1
app/src/main/res/layout/fragment_user_manage.xml

@@ -118,7 +118,7 @@
                 android:layout_height="match_parent"
                 android:layout_weight="1"
                 android:gravity="center"
-                android:text="@string/user_manage_nickname"
+                android:text="@string/nickname"
                 android:textSize="18sp" />
 
             <TextView

+ 5 - 1
app/src/main/res/values-en/strings.xml

@@ -26,7 +26,7 @@
     <string name="user_manage_delete_succeed">user delete succeed</string>
     <string name="user_manage_delete_failed">user delete failed</string>
     <string name="user_manage_filter_title">Filter</string>
-    <string name="user_manage_nickname">nickname</string>
+    <string name="nickname">nickname</string>
     <string name="please_input_nickname">please input nickname</string>
     <string name="please_input_card_code">please input card code</string>
     <string name="user_manage_card_code">Card code</string>
@@ -170,4 +170,8 @@
     <string name="please_select_job">Please select job</string>
     <string name="check_delete_job">Do you want to delete selected job</string>
     <string name="please_wait_ticket_name_lock_complete">Please wait ticket [%1$d] locking complete</string>
+    <string name="user_info_title">User info</string>
+    <string name="user_name">Login name</string>
+    <string name="please_input_phone">please input phone</string>
+    <string name="phone">phone</string>
 </resources>

+ 5 - 1
app/src/main/res/values-zh/strings.xml

@@ -26,7 +26,7 @@
     <string name="user_manage_delete_succeed">用户已删除</string>
     <string name="user_manage_delete_failed">无法删除用户</string>
     <string name="user_manage_filter_title">筛选条件</string>
-    <string name="user_manage_nickname">姓名</string>
+    <string name="nickname">姓名</string>
     <string name="please_input_nickname">请输入姓名</string>
     <string name="please_input_card_code">请输入工卡</string>
     <string name="user_manage_card_code">工卡</string>
@@ -170,4 +170,8 @@
     <string name="please_select_job">请选择作业</string>
     <string name="check_delete_job">您确认要删除作业吗</string>
     <string name="please_wait_ticket_name_lock_complete">请等待[%1$d]上锁完成</string>
+    <string name="user_info_title">个人信息</string>
+    <string name="user_name">登录名</string>
+    <string name="please_input_phone">请输入电话</string>
+    <string name="phone">电话</string>
 </resources>

+ 5 - 1
app/src/main/res/values/strings.xml

@@ -25,7 +25,7 @@
     <string name="user_manage_delete_succeed">用户已删除</string>
     <string name="user_manage_delete_failed">无法删除用户</string>
     <string name="user_manage_filter_title">筛选条件</string>
-    <string name="user_manage_nickname">姓名</string>
+    <string name="nickname">姓名</string>
     <string name="please_input_nickname">请输入姓名</string>
     <string name="please_input_card_code">请输入工卡</string>
     <string name="user_manage_card_code">工卡</string>
@@ -169,4 +169,8 @@
     <string name="please_select_job">请选择作业</string>
     <string name="check_delete_job">您确认要删除作业吗</string>
     <string name="please_wait_ticket_name_lock_complete">请等待[%1$d]上锁完成</string>
+    <string name="user_info_title">个人信息</string>
+    <string name="user_name">登录名</string>
+    <string name="please_input_phone">请输入电话</string>
+    <string name="phone">电话</string>
 </resources>