瀏覽代碼

增加用户协议设置页面入口

Pq 3 年之前
父節點
當前提交
ee1727c455

+ 20 - 0
BaseLibrary/src/main/java/com/cooleshow/base/utils/helper/WebStartHelper.java

@@ -40,4 +40,24 @@ public class WebStartHelper {
                 .withInt("orientation", 0)
                 .navigation();
     }
+
+    /**
+     * 打开用户协议页面
+     */
+    public static void startUserPrivacy(){
+        ARouter.getInstance()
+                .build(RouterPath.WebCenter.ACTIVITY_HTML)
+                .withString(WebConstants.WEB_URL, WebConstants.REGISTRATION_AGREEMENT)
+                .navigation();
+    }
+
+    /**
+     * 打开隐私协议页面
+     */
+    public static void startPrivacy(){
+        ARouter.getInstance()
+                .build(RouterPath.WebCenter.ACTIVITY_HTML)
+                .withString(WebConstants.WEB_URL, WebConstants.PRIVACY_AGREEMENT)
+                .navigation();
+    }
 }

+ 7 - 5
student/src/main/java/com/cooleshow/student/ui/mine/SettingActivity.java

@@ -13,6 +13,7 @@ import com.cooleshow.base.common.WebConstants;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
 import com.cooleshow.base.utils.SPUtils;
+import com.cooleshow.base.utils.helper.WebStartHelper;
 import com.cooleshow.student.R;
 import com.cooleshow.student.contract.SettingContract;
 import com.cooleshow.student.databinding.ActivitySettingBinding;
@@ -37,7 +38,7 @@ public class SettingActivity extends BaseMVPActivity<ActivitySettingBinding, Set
         switch (view.getId()) {
             case R.id.cl_address:
                 ARouter.getInstance().build(RouterPath.BaseCenter.MINE_ADDRESS_LIST)
-                        .withBoolean(BaseConstant.CHECK_ADDRESS,true)
+                        .withBoolean(BaseConstant.CHECK_ADDRESS, true)
                         .navigation();
                 break;
             case R.id.im_select:
@@ -49,12 +50,12 @@ public class SettingActivity extends BaseMVPActivity<ActivitySettingBinding, Set
                     viewBinding.imSelect.setImageResource(R.drawable.icon_switch_open);
                 }
                 break;
+            case R.id.cl_user_private:
+                WebStartHelper.startUserPrivacy();
+                break;
             case R.id.cl_private:
                 //跳转隐私协议
-                ARouter.getInstance()
-                        .build(RouterPath.WebCenter.ACTIVITY_HTML)
-                        .withString(WebConstants.WEB_URL, WebConstants.PRIVACY_AGREEMENT)
-                        .navigation();
+                WebStartHelper.startPrivacy();
                 break;
             case R.id.cl_about:
                 ARouter.getInstance().build(RouterPath.MineCenter.MINE_ABOUT)
@@ -90,6 +91,7 @@ public class SettingActivity extends BaseMVPActivity<ActivitySettingBinding, Set
         viewBinding.clAbout.setOnClickListener(this);
         viewBinding.tvLoginOut.setOnClickListener(this);
         viewBinding.clFeedback.setOnClickListener(this);
+        viewBinding.clUserPrivate.setOnClickListener(this);
 
         is_detection = SPUtils.getInstance().getBoolean("IS_DETECTION");
         if (is_detection) {

+ 41 - 3
student/src/main/res/layout/activity_setting.xml

@@ -103,19 +103,56 @@
                     app:layout_constraintLeft_toLeftOf="parent" />
             </androidx.constraintlayout.widget.ConstraintLayout>
 
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/cl_user_private"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/dp_50"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/cl_detection">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="12dp"
+                    android:text="用户协议"
+                    android:textColor="@color/color_1a1a1a"
+                    android:textSize="@dimen/sp_16"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+
+                <ImageView
+                    android:layout_width="@dimen/dp_6"
+                    android:layout_height="@dimen/dp_11"
+                    android:layout_marginRight="15dp"
+                    android:background="@drawable/icon_next_right"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintRight_toRightOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:layout_marginLeft="11dp"
+                    android:layout_marginRight="9dp"
+                    android:background="@color/color_f2f2f2"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintLeft_toLeftOf="parent" />
+            </androidx.constraintlayout.widget.ConstraintLayout>
 
             <androidx.constraintlayout.widget.ConstraintLayout
                 android:id="@+id/cl_private"
                 android:layout_width="match_parent"
                 android:layout_height="@dimen/dp_50"
                 app:layout_constraintLeft_toLeftOf="parent"
-                app:layout_constraintTop_toBottomOf="@+id/cl_detection">
+                app:layout_constraintTop_toBottomOf="@+id/cl_user_private">
 
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_marginLeft="12dp"
-                    android:text="安全隐私"
+                    android:text="隐私协议"
                     android:textColor="@color/color_1a1a1a"
                     android:textSize="@dimen/sp_16"
                     app:layout_constraintBottom_toBottomOf="parent"
@@ -141,11 +178,12 @@
                     app:layout_constraintBottom_toBottomOf="parent"
                     app:layout_constraintLeft_toLeftOf="parent" />
             </androidx.constraintlayout.widget.ConstraintLayout>
+
             <androidx.constraintlayout.widget.ConstraintLayout
                 android:id="@+id/cl_feedback"
-                android:visibility="gone"
                 android:layout_width="match_parent"
                 android:layout_height="@dimen/dp_50"
+                android:visibility="gone"
                 app:layout_constraintLeft_toLeftOf="parent"
                 app:layout_constraintTop_toBottomOf="@+id/cl_private">
 

+ 6 - 4
teacher/src/main/java/com/cooleshow/teacher/ui/mine/SettingActivity.java

@@ -13,6 +13,7 @@ import com.cooleshow.base.common.WebConstants;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
 import com.cooleshow.base.utils.SPUtils;
+import com.cooleshow.base.utils.helper.WebStartHelper;
 import com.cooleshow.teacher.R;
 import com.cooleshow.teacher.contract.SettingContract;
 import com.cooleshow.teacher.databinding.ActivitySettingBinding;
@@ -49,12 +50,12 @@ public class SettingActivity extends BaseMVPActivity<ActivitySettingBinding, Set
                     viewBinding.imSelect.setImageResource(R.drawable.icon_switch_open);
                 }
                 break;
+            case R.id.cl_user_private:
+                WebStartHelper.startUserPrivacy();
+                break;
             case R.id.cl_private:
                 //跳转隐私协议
-                ARouter.getInstance()
-                        .build(RouterPath.WebCenter.ACTIVITY_HTML)
-                        .withString(WebConstants.WEB_URL, WebConstants.PRIVACY_AGREEMENT)
-                        .navigation();
+                WebStartHelper.startPrivacy();
                 break;
             case R.id.cl_about:
                 ARouter.getInstance().build(RouterPath.MineCenter.MINE_ABOUT)
@@ -91,6 +92,7 @@ public class SettingActivity extends BaseMVPActivity<ActivitySettingBinding, Set
         viewBinding.clAbout.setOnClickListener(this);
         viewBinding.tvLoginOut.setOnClickListener(this);
         viewBinding.clFeedback.setOnClickListener(this);
+        viewBinding.clUserPrivate.setOnClickListener(this);
 
         is_detection = SPUtils.getInstance().getBoolean("IS_DETECTION");
         if (is_detection) {

+ 41 - 3
teacher/src/main/res/layout/activity_setting.xml

@@ -104,7 +104,7 @@
 
 
             <androidx.constraintlayout.widget.ConstraintLayout
-                android:id="@+id/cl_private"
+                android:id="@+id/cl_user_private"
                 android:layout_width="match_parent"
                 android:layout_height="@dimen/dp_50"
                 app:layout_constraintLeft_toLeftOf="parent"
@@ -114,7 +114,45 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_marginLeft="12dp"
-                    android:text="安全隐私"
+                    android:text="用户协议"
+                    android:textColor="@color/color_1a1a1a"
+                    android:textSize="@dimen/sp_16"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+
+                <ImageView
+                    android:layout_width="@dimen/dp_6"
+                    android:layout_height="@dimen/dp_11"
+                    android:layout_marginRight="15dp"
+                    android:background="@drawable/icon_next_right"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintRight_toRightOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:layout_marginLeft="11dp"
+                    android:layout_marginRight="9dp"
+                    android:background="@color/color_f2f2f2"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintLeft_toLeftOf="parent" />
+            </androidx.constraintlayout.widget.ConstraintLayout>
+
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/cl_private"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/dp_50"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/cl_user_private">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="12dp"
+                    android:text="隐私协议"
                     android:textColor="@color/color_1a1a1a"
                     android:textSize="@dimen/sp_16"
                     app:layout_constraintBottom_toBottomOf="parent"
@@ -142,10 +180,10 @@
             </androidx.constraintlayout.widget.ConstraintLayout>
 
             <androidx.constraintlayout.widget.ConstraintLayout
-                android:visibility="gone"
                 android:id="@+id/cl_feedback"
                 android:layout_width="match_parent"
                 android:layout_height="@dimen/dp_50"
+                android:visibility="gone"
                 app:layout_constraintLeft_toLeftOf="parent"
                 app:layout_constraintTop_toBottomOf="@+id/cl_private">