Kaynağa Gözat

个人设置动态切换

everywindchase 4 ay önce
ebeveyn
işleme
4d4095331f

+ 33 - 1
app/src/main/java/jx/cn/escort/ui/activity/SysSettingActivity.kt

@@ -62,6 +62,7 @@ class SysSettingActivity : AppCompatActivity(), KoinComponent {
         val doc = TabSegment.Tab("基本资料")
         doc.setTextColor(unCkColor,ckColor)
 
+
         val doc1 = TabSegment.Tab("修改密码")
         doc1.setTextColor(unCkColor,ckColor)
 
@@ -70,7 +71,38 @@ class SysSettingActivity : AppCompatActivity(), KoinComponent {
         tabSegment.setupWithViewPager(ViewPager(this@SysSettingActivity), false);
         tabSegment.setMode(TabSegment.MODE_FIXED);
         tabSegment.notifyDataChanged();
-        tabSegment.selectTab(0);
+        tabSegment.selectTab(0)
+
+        tabSegment.addOnTabSelectedListener(object :TabSegment.OnTabSelectedListener{
+            override fun onTabSelected(index: Int) {
+              if(index != 0){
+                  val setsUserInfo = mBinding.setsUserInfo
+                  setsUserInfo.visibility= View.VISIBLE
+
+                  val setUserPass = mBinding.setsUserPass
+                  setUserPass.visibility= View.GONE
+
+              }else{
+                  val setsUserInfo = mBinding.setsUserInfo
+                  setsUserInfo.visibility= View.GONE
+
+                  val setUserPass = mBinding.setsUserPass
+                  setUserPass.visibility= View.VISIBLE
+              }
+            }
+
+            override fun onTabUnselected(index: Int) {
+                //ignore
+            }
+
+            override fun onTabReselected(index: Int) {
+                //ignore
+            }
+
+            override fun onDoubleTap(index: Int) {
+                //ignore
+            }
+        })
 
     }
 

+ 117 - 7
app/src/main/res/layout/activity_sys_setting.xml

@@ -56,6 +56,8 @@
         <androidx.constraintlayout.widget.ConstraintLayout
                 android:layout_width="match_parent"
                 android:layout_height="250dp"
+                android:id="@+id/sets_user_info"
+                android:visibility="gone"
         >
         <androidx.appcompat.widget.LinearLayoutCompat
                 android:id="@+id/sets_username"
@@ -72,7 +74,7 @@
                         android:layout_height="42dp"
                         app:sLeftTextString="用户昵称:"
                         app:sLeftTextIsBold="true"
-                        app:sLeftTextSize="20sp"
+                        app:sLeftTextSize="16sp"
                />
 
         <com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
@@ -99,7 +101,7 @@
                     android:layout_height="42dp"
                     app:sLeftTextString="手机号码:"
                     app:sLeftTextIsBold="true"
-                    app:sLeftTextSize="20sp"
+                    app:sLeftTextSize="16sp"
             />
 
             <com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
@@ -127,7 +129,7 @@
                     android:layout_height="42dp"
                     app:sLeftTextString="用户邮箱:"
                     app:sLeftTextIsBold="true"
-                    app:sLeftTextSize="20sp"
+                    app:sLeftTextSize="16sp"
             />
 
             <com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
@@ -155,7 +157,7 @@
                     android:layout_height="42dp"
                     app:sLeftTextString="性别"
                     app:sLeftTextIsBold="true"
-                    app:sLeftTextSize="20sp"
+                    app:sLeftTextSize="16sp"
             />
 
             <com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
@@ -169,16 +171,119 @@
         </androidx.constraintlayout.widget.ConstraintLayout>
 
 
+
+
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+                android:layout_width="match_parent"
+                android:layout_height="250dp"
+                android:id="@+id/sets_user_pass"
+                android:visibility="gone"
+        >
+
+            <androidx.appcompat.widget.LinearLayoutCompat
+                    android:id="@+id/sets_user_old_pass"
+                    android:layout_width="match_parent"
+                    android:layout_height="50dp"
+                    android:layout_marginTop="60dp"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintTop_toTopOf="parent"
+                    app:layout_constraintBottom_toTopOf="@+id/sets_user_renew_pass"
+            >
+                <com.xuexiang.xui.widget.textview.supertextview.SuperTextView
+                        android:layout_width="140dp"
+                        android:layout_height="42dp"
+                        app:sLeftTextString="旧密码:"
+                        app:sLeftTextIsBold="true"
+                        app:sLeftTextSize="16sp"
+                />
+
+                <com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
+                        android:layout_width="200dp"
+                        android:layout_height="42dp"
+                        app:met_floatingLabel="normal"/>
+
+
+            </androidx.appcompat.widget.LinearLayoutCompat>
+
+
+            <androidx.appcompat.widget.LinearLayoutCompat
+                    android:id="@+id/sets_user_renew_pass"
+                    android:layout_width="match_parent"
+                    android:layout_height="50dp"
+                    android:layout_marginTop="230dp"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintTop_toTopOf="parent"
+                    app:layout_constraintBottom_toTopOf="@+id/sets_user_old_pass"
+            >
+                <com.xuexiang.xui.widget.textview.supertextview.SuperTextView
+                        android:layout_width="140dp"
+                        android:layout_height="42dp"
+                        app:sLeftTextString="新密码:"
+                        app:sLeftTextIsBold="true"
+                        app:sLeftTextSize="16sp"
+                />
+
+                <com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
+                        android:layout_width="200dp"
+                        android:layout_height="42dp"
+                        app:met_floatingLabel="normal"/>
+
+
+            </androidx.appcompat.widget.LinearLayoutCompat>
+
+
+
+
+
+
+            <androidx.appcompat.widget.LinearLayoutCompat
+                    android:id="@+id/sets_user_renew_pass_confirm"
+                    android:layout_width="match_parent"
+                    android:layout_height="50dp"
+                    android:layout_marginTop="280dp"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintTop_toTopOf="parent"
+                    app:layout_constraintBottom_toTopOf="@+id/sets_user_renew_pass"
+            >
+                <com.xuexiang.xui.widget.textview.supertextview.SuperTextView
+                        android:layout_width="140dp"
+                        android:layout_height="42dp"
+                        app:sLeftTextString="确认密码:"
+                        app:sLeftTextIsBold="true"
+                        app:sLeftTextSize="16sp"
+                />
+
+                <com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
+                        android:layout_width="200dp"
+                        android:layout_height="42dp"
+                        app:met_floatingLabel="normal"/>
+
+
+            </androidx.appcompat.widget.LinearLayoutCompat>
+
+
+        </androidx.constraintlayout.widget.ConstraintLayout>
+
+
+
+
+
+
+
         <androidx.appcompat.widget.LinearLayoutCompat
                 android:layout_width="match_parent"
-                android:layout_height="50dp"
+                android:layout_height="40dp"
                 android:layout_marginTop="260dp"
                 android:gravity="center"
                 >
         >
 
             <com.xuexiang.xui.widget.button.ButtonView
-                    android:layout_width="90dp"
+                    android:layout_width="75dp"
                     android:layout_height="match_parent"
                     style="@style/ButtonView.Green"
                     app:textRadius="5dp"
@@ -186,7 +291,7 @@
             />
 
             <com.xuexiang.xui.widget.button.ButtonView
-                    android:layout_width="90dp"
+                    android:layout_width="75dp"
                     android:layout_height="match_parent"
                     android:layout_marginLeft="60dp"
                     style="@style/ButtonView.Gray"
@@ -196,6 +301,11 @@
         </androidx.appcompat.widget.LinearLayoutCompat>
 
 
+
+
+
+
+
     </androidx.cardview.widget.CardView>