浏览代码

增加机构端清除缓存逻辑

Pq 1 年之前
父节点
当前提交
64514b7eca

+ 14 - 5
institution/src/main/java/com/cooleshow/institution/stu/ui/setting/PersonalSettingActivity.java

@@ -31,6 +31,7 @@ import com.cooleshow.base.utils.UiUtils;
 import com.cooleshow.base.utils.helper.GlideEngine;
 import com.cooleshow.base.utils.helper.GlideEngine;
 import com.cooleshow.base.utils.helper.PermissionTipHelper;
 import com.cooleshow.base.utils.helper.PermissionTipHelper;
 import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
 import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
+import com.cooleshow.base.utils.helper.WebLoadFileHelper;
 import com.cooleshow.institution.stu.R;
 import com.cooleshow.institution.stu.R;
 import com.cooleshow.institution.stu.contract.PersonalSettingContract;
 import com.cooleshow.institution.stu.contract.PersonalSettingContract;
 import com.cooleshow.institution.stu.databinding.JgActivityPersonalSettingBinding;
 import com.cooleshow.institution.stu.databinding.JgActivityPersonalSettingBinding;
@@ -145,6 +146,13 @@ public class PersonalSettingActivity extends BaseMVPActivity<JgActivityPersonalS
                     .navigation();
                     .navigation();
             return;
             return;
         }
         }
+
+        if (id == R.id.cl_clear_cache) {
+            //清理缓存
+            boolean b = WebLoadFileHelper.getInstance().clearCache();
+            ToastUtil.getInstance().showShort("清理完成");
+            return;
+        }
     }
     }
 
 
     private TimePickerView pvTime;
     private TimePickerView pvTime;
@@ -200,7 +208,7 @@ public class PersonalSettingActivity extends BaseMVPActivity<JgActivityPersonalS
                 .isDialog(false)//是否显示为对话框样式
                 .isDialog(false)//是否显示为对话框样式
                 .setLabel("年", "月", "日", "", "", "")
                 .setLabel("年", "月", "日", "", "", "")
                 .build();
                 .build();
-        if(cBirthdate!=null){
+        if (cBirthdate != null) {
             Calendar calendar = Calendar.getInstance();
             Calendar calendar = Calendar.getInstance();
             calendar.setTime(cBirthdate);
             calendar.setTime(cBirthdate);
             pvTime.setDate(calendar);
             pvTime.setDate(calendar);
@@ -290,7 +298,7 @@ public class PersonalSettingActivity extends BaseMVPActivity<JgActivityPersonalS
                     if (granted) {
                     if (granted) {
                         goCamera();
                         goCamera();
                     } else {
                     } else {
-                        UiUtils.showPermissionTipDialog(getSupportFragmentManager(),this,"","请选择存储和相机权限!");
+                        UiUtils.showPermissionTipDialog(getSupportFragmentManager(), this, "", "请选择存储和相机权限!");
                     }
                     }
                 });
                 });
     }
     }
@@ -343,7 +351,7 @@ public class PersonalSettingActivity extends BaseMVPActivity<JgActivityPersonalS
                     if (granted) {
                     if (granted) {
                         goAlbum();
                         goAlbum();
                     } else {
                     } else {
-                        UiUtils.showPermissionTipDialog(getSupportFragmentManager(),this,"提示","请选择存储和相机权限!");
+                        UiUtils.showPermissionTipDialog(getSupportFragmentManager(), this, "提示", "请选择存储和相机权限!");
                     }
                     }
                 });
                 });
     }
     }
@@ -356,7 +364,7 @@ public class PersonalSettingActivity extends BaseMVPActivity<JgActivityPersonalS
                 .selectionMode(PictureConfig.SINGLE)// 多选 or 单选 PictureConfig.MULTIPLE or PictureConfig.SINGLE
                 .selectionMode(PictureConfig.SINGLE)// 多选 or 单选 PictureConfig.MULTIPLE or PictureConfig.SINGLE
                 .enableCrop(true)// 是否裁剪 true or false
                 .enableCrop(true)// 是否裁剪 true or false
                 .cutOutQuality(100)
                 .cutOutQuality(100)
-                .withAspectRatio(1,1)
+                .withAspectRatio(1, 1)
                 .showCropGrid(false)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false    true or false
                 .showCropGrid(false)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false    true or false
                 .compress(true)// 是否压缩 true or false
                 .compress(true)// 是否压缩 true or false
                 .circleDimmedLayer(false)// 是否圆形裁剪 true or false
                 .circleDimmedLayer(false)// 是否圆形裁剪 true or false
@@ -371,7 +379,7 @@ public class PersonalSettingActivity extends BaseMVPActivity<JgActivityPersonalS
                 .selectionMode(PictureConfig.SINGLE)// 多选 or 单选 PictureConfig.MULTIPLE or PictureConfig.SINGLE
                 .selectionMode(PictureConfig.SINGLE)// 多选 or 单选 PictureConfig.MULTIPLE or PictureConfig.SINGLE
                 .isEnableCrop(true)// 是否裁剪 true or false
                 .isEnableCrop(true)// 是否裁剪 true or false
                 .cutOutQuality(100)
                 .cutOutQuality(100)
-                .withAspectRatio(1,1)
+                .withAspectRatio(1, 1)
                 .showCropGrid(false)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false    true or false
                 .showCropGrid(false)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false    true or false
                 .isCompress(true)// 是否压缩 true or false
                 .isCompress(true)// 是否压缩 true or false
                 .circleDimmedLayer(false)// 是否圆形裁剪 true or false
                 .circleDimmedLayer(false)// 是否圆形裁剪 true or false
@@ -392,6 +400,7 @@ public class PersonalSettingActivity extends BaseMVPActivity<JgActivityPersonalS
         viewBinding.clScore.setOnClickListener(this);
         viewBinding.clScore.setOnClickListener(this);
         viewBinding.tvLogout.setOnClickListener(this);
         viewBinding.tvLogout.setOnClickListener(this);
         viewBinding.csSignOutAccout.setOnClickListener(this);
         viewBinding.csSignOutAccout.setOnClickListener(this);
+        viewBinding.clClearCache.setOnClickListener(this);
     }
     }
 
 
     @Override
     @Override

+ 64 - 24
institution/src/main/res/layout/jg_activity_personal_setting.xml

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 <LinearLayout 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"
     android:layout_width="match_parent"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_height="match_parent"
-    xmlns:tools="http://schemas.android.com/tools"
     android:background="@color/color_f6f8f9"
     android:background="@color/color_f6f8f9"
     android:orientation="vertical">
     android:orientation="vertical">
 
 
@@ -32,10 +32,10 @@
                 app:layout_constraintTop_toTopOf="parent">
                 app:layout_constraintTop_toTopOf="parent">
 
 
                 <androidx.constraintlayout.widget.ConstraintLayout
                 <androidx.constraintlayout.widget.ConstraintLayout
-                    android:background="@drawable/bg_white_10dp"
                     android:id="@+id/cl_header"
                     android:id="@+id/cl_header"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="@dimen/dp_80"
                     android:layout_height="@dimen/dp_80"
+                    android:background="@drawable/bg_white_10dp"
                     app:layout_constraintLeft_toLeftOf="parent"
                     app:layout_constraintLeft_toLeftOf="parent"
                     app:layout_constraintTop_toTopOf="parent">
                     app:layout_constraintTop_toTopOf="parent">
 
 
@@ -44,8 +44,8 @@
                         android:layout_width="@dimen/dp_54"
                         android:layout_width="@dimen/dp_54"
                         android:layout_height="@dimen/dp_54"
                         android:layout_height="@dimen/dp_54"
                         android:layout_marginLeft="12dp"
                         android:layout_marginLeft="12dp"
-                        app:layout_constraintBottom_toBottomOf="parent"
                         android:src="@drawable/icon_default_head"
                         android:src="@drawable/icon_default_head"
+                        app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintLeft_toLeftOf="parent"
                         app:layout_constraintLeft_toLeftOf="parent"
                         app:layout_constraintTop_toTopOf="parent" />
                         app:layout_constraintTop_toTopOf="parent" />
 
 
@@ -72,19 +72,19 @@
                 </androidx.constraintlayout.widget.ConstraintLayout>
                 </androidx.constraintlayout.widget.ConstraintLayout>
 
 
                 <View
                 <View
+                    android:layout_width="0dp"
+                    android:layout_height="0dp"
+                    android:background="@drawable/bg_white_10dp"
                     app:layout_constraintBottom_toBottomOf="@+id/cs_sign_out_accout"
                     app:layout_constraintBottom_toBottomOf="@+id/cs_sign_out_accout"
-                    app:layout_constraintRight_toRightOf="@+id/cl_name"
                     app:layout_constraintLeft_toLeftOf="@+id/cl_name"
                     app:layout_constraintLeft_toLeftOf="@+id/cl_name"
-                    app:layout_constraintTop_toTopOf="@+id/cl_name"
-                    android:background="@drawable/bg_white_10dp"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"/>
+                    app:layout_constraintRight_toRightOf="@+id/cl_name"
+                    app:layout_constraintTop_toTopOf="@+id/cl_name" />
 
 
                 <androidx.constraintlayout.widget.ConstraintLayout
                 <androidx.constraintlayout.widget.ConstraintLayout
                     android:id="@+id/cl_name"
                     android:id="@+id/cl_name"
-                    android:layout_marginTop="12dp"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="@dimen/dp_55"
                     android:layout_height="@dimen/dp_55"
+                    android:layout_marginTop="12dp"
                     app:layout_constraintLeft_toLeftOf="parent"
                     app:layout_constraintLeft_toLeftOf="parent"
                     app:layout_constraintTop_toBottomOf="@+id/cl_header">
                     app:layout_constraintTop_toBottomOf="@+id/cl_header">
 
 
@@ -124,7 +124,7 @@
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
                         android:layout_height="1dp"
                         android:layout_height="1dp"
                         android:layout_marginLeft="11dp"
                         android:layout_marginLeft="11dp"
-                        android:layout_marginRight="9dp"
+                        android:layout_marginRight="11dp"
                         android:background="@color/color_f2f2f2"
                         android:background="@color/color_f2f2f2"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintLeft_toLeftOf="parent" />
                         app:layout_constraintLeft_toLeftOf="parent" />
@@ -173,7 +173,7 @@
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
                         android:layout_height="1dp"
                         android:layout_height="1dp"
                         android:layout_marginLeft="11dp"
                         android:layout_marginLeft="11dp"
-                        android:layout_marginRight="9dp"
+                        android:layout_marginRight="11dp"
                         android:background="@color/color_f2f2f2"
                         android:background="@color/color_f2f2f2"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintLeft_toLeftOf="parent" />
                         app:layout_constraintLeft_toLeftOf="parent" />
@@ -210,11 +210,11 @@
                         app:layout_constraintTop_toTopOf="parent" />
                         app:layout_constraintTop_toTopOf="parent" />
 
 
                     <ImageView
                     <ImageView
-                        android:visibility="gone"
                         android:layout_width="@dimen/dp_6"
                         android:layout_width="@dimen/dp_6"
                         android:layout_height="@dimen/dp_11"
                         android:layout_height="@dimen/dp_11"
                         android:layout_marginRight="12dp"
                         android:layout_marginRight="12dp"
                         android:background="@drawable/icon_arrow_right"
                         android:background="@drawable/icon_arrow_right"
+                        android:visibility="gone"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintRight_toRightOf="parent"
                         app:layout_constraintRight_toRightOf="parent"
                         app:layout_constraintTop_toTopOf="parent" />
                         app:layout_constraintTop_toTopOf="parent" />
@@ -223,7 +223,7 @@
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
                         android:layout_height="1dp"
                         android:layout_height="1dp"
                         android:layout_marginLeft="11dp"
                         android:layout_marginLeft="11dp"
-                        android:layout_marginRight="9dp"
+                        android:layout_marginRight="11dp"
                         android:background="@color/color_f2f2f2"
                         android:background="@color/color_f2f2f2"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintLeft_toLeftOf="parent" />
                         app:layout_constraintLeft_toLeftOf="parent" />
@@ -273,7 +273,7 @@
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
                         android:layout_height="1dp"
                         android:layout_height="1dp"
                         android:layout_marginLeft="11dp"
                         android:layout_marginLeft="11dp"
-                        android:layout_marginRight="9dp"
+                        android:layout_marginRight="11dp"
                         android:background="@color/color_f2f2f2"
                         android:background="@color/color_f2f2f2"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintLeft_toLeftOf="parent" />
                         app:layout_constraintLeft_toLeftOf="parent" />
@@ -322,7 +322,7 @@
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
                         android:layout_height="1dp"
                         android:layout_height="1dp"
                         android:layout_marginLeft="11dp"
                         android:layout_marginLeft="11dp"
-                        android:layout_marginRight="9dp"
+                        android:layout_marginRight="11dp"
                         android:background="@color/color_f2f2f2"
                         android:background="@color/color_f2f2f2"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintLeft_toLeftOf="parent" />
                         app:layout_constraintLeft_toLeftOf="parent" />
@@ -355,17 +355,17 @@
                         android:text="--"
                         android:text="--"
                         android:textColor="@color/color_aaaaaa"
                         android:textColor="@color/color_aaaaaa"
                         android:textSize="@dimen/sp_16"
                         android:textSize="@dimen/sp_16"
-                        tools:text="武汉市梨花街道第二小学音乐小组"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintRight_toRightOf="parent"
                         app:layout_constraintRight_toRightOf="parent"
-                        app:layout_constraintTop_toTopOf="parent" />
+                        app:layout_constraintTop_toTopOf="parent"
+                        tools:text="武汉市梨花街道第二小学音乐小组" />
 
 
                     <ImageView
                     <ImageView
-                        android:visibility="gone"
                         android:layout_width="@dimen/dp_6"
                         android:layout_width="@dimen/dp_6"
                         android:layout_height="@dimen/dp_11"
                         android:layout_height="@dimen/dp_11"
                         android:layout_marginRight="12dp"
                         android:layout_marginRight="12dp"
                         android:background="@drawable/icon_arrow_right"
                         android:background="@drawable/icon_arrow_right"
+                        android:visibility="gone"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintRight_toRightOf="parent"
                         app:layout_constraintRight_toRightOf="parent"
                         app:layout_constraintTop_toTopOf="parent" />
                         app:layout_constraintTop_toTopOf="parent" />
@@ -374,7 +374,7 @@
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
                         android:layout_height="1dp"
                         android:layout_height="1dp"
                         android:layout_marginLeft="11dp"
                         android:layout_marginLeft="11dp"
-                        android:layout_marginRight="9dp"
+                        android:layout_marginRight="11dp"
                         android:background="@color/color_f2f2f2"
                         android:background="@color/color_f2f2f2"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintLeft_toLeftOf="parent" />
                         app:layout_constraintLeft_toLeftOf="parent" />
@@ -411,7 +411,7 @@
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
                         android:layout_height="1dp"
                         android:layout_height="1dp"
                         android:layout_marginLeft="11dp"
                         android:layout_marginLeft="11dp"
-                        android:layout_marginRight="9dp"
+                        android:layout_marginRight="11dp"
                         android:background="@color/color_f2f2f2"
                         android:background="@color/color_f2f2f2"
                         android:visibility="gone"
                         android:visibility="gone"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintBottom_toBottomOf="parent"
@@ -462,8 +462,8 @@
                 </androidx.constraintlayout.widget.ConstraintLayout>
                 </androidx.constraintlayout.widget.ConstraintLayout>
 
 
                 <androidx.constraintlayout.widget.ConstraintLayout
                 <androidx.constraintlayout.widget.ConstraintLayout
+                    android:id="@+id/cl_clear_cache"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
-                    android:id="@+id/cs_sign_out_accout"
                     android:layout_height="55dp"
                     android:layout_height="55dp"
                     app:layout_constraintLeft_toLeftOf="parent"
                     app:layout_constraintLeft_toLeftOf="parent"
                     app:layout_constraintTop_toBottomOf="@+id/cl_certification">
                     app:layout_constraintTop_toBottomOf="@+id/cl_certification">
@@ -472,10 +472,50 @@
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
                         android:layout_height="1dp"
                         android:layout_height="1dp"
                         android:layout_marginLeft="11dp"
                         android:layout_marginLeft="11dp"
-                        android:layout_marginRight="9dp"
+                        android:layout_marginRight="11dp"
                         android:background="@color/color_f2f2f2"
                         android:background="@color/color_f2f2f2"
-                        app:layout_constraintTop_toTopOf="parent"
-                        app:layout_constraintLeft_toLeftOf="parent" />
+                        app:layout_constraintLeft_toLeftOf="parent"
+                        app:layout_constraintTop_toTopOf="parent" />
+
+                    <TextView
+                        android:id="@+id/tv_clear_cache"
+                        android:layout_width="match_parent"
+                        android:layout_height="0dp"
+                        android:layout_marginLeft="12dp"
+                        android:gravity="center_vertical"
+                        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="12dp"
+                        android:background="@drawable/icon_arrow_right"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintRight_toRightOf="parent"
+                        app:layout_constraintTop_toTopOf="parent" />
+                </androidx.constraintlayout.widget.ConstraintLayout>
+
+                <androidx.constraintlayout.widget.ConstraintLayout
+                    android:id="@+id/cs_sign_out_accout"
+                    android:layout_width="match_parent"
+                    android:layout_height="55dp"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintTop_toBottomOf="@+id/cl_clear_cache">
+
+                    <View
+                        android:layout_width="match_parent"
+                        android:layout_height="1dp"
+                        android:layout_marginLeft="11dp"
+                        android:layout_marginRight="11dp"
+                        android:background="@color/color_f2f2f2"
+                        app:layout_constraintLeft_toLeftOf="parent"
+                        app:layout_constraintTop_toTopOf="parent" />
 
 
                     <TextView
                     <TextView
                         android:id="@+id/tv_sign_out_account"
                         android:id="@+id/tv_sign_out_account"