Selaa lähdekoodia

增加老师端清除缓存逻辑

Pq 1 vuosi sitten
vanhempi
commit
4814a458f8

+ 10 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/main/MallFragment.java

@@ -569,6 +569,16 @@ public class MallFragment extends BaseMVPFragment<FragmentMallBinding, ShopMallP
 
     }
 
+    @Override
+    public void checkCoursewareCache(JSONObject jsonObject) {
+
+    }
+
+    @Override
+    public void downloadCourseware(String toString) {
+
+    }
+
     private boolean goPay = false;
 
     @Subscribe(threadMode = ThreadMode.MAIN)

+ 7 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/mine/SettingActivity.java

@@ -15,7 +15,9 @@ import com.cooleshow.base.constanst.EventConstants;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
 import com.cooleshow.base.utils.SPUtils;
+import com.cooleshow.base.utils.ToastUtil;
 import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
+import com.cooleshow.base.utils.helper.WebLoadFileHelper;
 import com.cooleshow.base.utils.helper.WebStartHelper;
 import com.cooleshow.teacher.R;
 import com.cooleshow.teacher.contract.SettingContract;
@@ -73,6 +75,10 @@ public class SettingActivity extends BaseMVPActivity<ActivitySettingBinding, Set
         } else if (id == R.id.cl_unbind_tenant) {
             ARouter.getInstance().build(RouterPath.MineCenter.UNBIND_TENANT)
                     .navigation();
+        }else if(id == R.id.cl_clear_cache){
+            //清理缓存
+            boolean b = WebLoadFileHelper.getInstance().clearCache();
+            ToastUtil.getInstance().showShort("清理完成");
         }
     }
 
@@ -107,6 +113,7 @@ public class SettingActivity extends BaseMVPActivity<ActivitySettingBinding, Set
         viewBinding.clUserPrivate.setOnClickListener(this);
         viewBinding.tvSignOutAccount.setOnClickListener(this);
         viewBinding.clUnbindTenant.setOnClickListener(this);
+        viewBinding.clClearCache.setOnClickListener(this);
     }
 
     @Override

+ 10 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/web/HtmlHorizontalScreenActivity.java

@@ -695,6 +695,16 @@ public class HtmlHorizontalScreenActivity extends BaseActivity<ActivityHtml1Bind
 
     }
 
+    @Override
+    public void checkCoursewareCache(JSONObject jsonObject) {
+
+    }
+
+    @Override
+    public void downloadCourseware(String toString) {
+
+    }
+
     private boolean goPay = false;
 
     @Subscribe(threadMode = ThreadMode.MAIN)

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

@@ -250,10 +250,10 @@
             </androidx.constraintlayout.widget.ConstraintLayout>
 
             <androidx.constraintlayout.widget.ConstraintLayout
-                android:visibility="gone"
                 android:id="@+id/cl_unbind_tenant"
                 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_about">
 
@@ -263,8 +263,8 @@
                     android:layout_marginLeft="11dp"
                     android:layout_marginRight="9dp"
                     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:layout_width="wrap_content"
@@ -290,6 +290,47 @@
 
             </androidx.constraintlayout.widget.ConstraintLayout>
 
+
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/cl_clear_cache"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/dp_50"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/cl_unbind_tenant">
+
+                <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_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+                <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_go_right"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintRight_toRightOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+
+            </androidx.constraintlayout.widget.ConstraintLayout>
+
             <View
                 android:layout_width="match_parent"
                 android:layout_height="1px"
@@ -297,6 +338,7 @@
                 app:layout_constraintTop_toBottomOf="@+id/cl_unbind_tenant" />
         </androidx.constraintlayout.widget.ConstraintLayout>
 
+
         <androidx.constraintlayout.widget.ConstraintLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"