Browse Source

修改部分问题

Pq 1 year ago
parent
commit
67ace649e0

+ 23 - 28
student/src/main/java/com/cooleshow/student/ui/web/HtmlActivity.java

@@ -961,7 +961,7 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
         JSONObject contentJson = jsonObject.optJSONObject("content");
         if (contentJson != null) {
             String videoUrl = contentJson.optString("url");
-            if(!TextUtils.isEmpty(videoUrl)){
+            if (!TextUtils.isEmpty(videoUrl)) {
                 ARouter.getInstance().build(RouterPath.MusicTuner.MUSIC_SELECT_VIDEO_FRAME)
                         .withString("videoFilePath", videoUrl)
                         .withBoolean("isLocalFile", false)
@@ -1039,10 +1039,10 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
                                 if (isVideo) {
                                     ToastUtil.getInstance().showShort("视频已保存到相册");
                                     FileUtils.saveVideoToGallery(HtmlActivity.this, filePath);
-                                }else{
-                                    FileUtils.saveAudioToMusic(HtmlActivity.this,filePath);
+                                } else {
+                                    FileUtils.saveAudioToMusic(HtmlActivity.this, filePath);
                                     String fileName = FileUtils.getFileName(filePath);
-                                    ToastUtil.getInstance().showShort("保存成功,文件存储路径: 手机存储/Music/yyszkt/"+fileName);
+                                    ToastUtil.getInstance().showShort("保存成功,文件存储路径: 手机存储/Music/yyszkt/" + fileName);
                                 }
                             }
                         });
@@ -1288,6 +1288,20 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
             } catch (JSONException e) {
                 e.printStackTrace();
             }
+        } else if (requestCode == PictureConfig.CHOOSE_REQUEST && mUploadCallbackAboveL != null) {
+            // 图片、视频、音频选择结果回调
+            List<LocalMedia> selectList = PictureSelector.obtainMultipleResult(data);
+            String avatar = null;
+            if (selectList != null && selectList.size() > 0) {
+                avatar = selectList.get(0).getCompressPath();
+            }
+            LOG.i("pq", "avatar:" + avatar);
+            if (avatar != null) {
+                mUploadCallbackAboveL.onReceiveValue(new Uri[]{PictureFileUtils.parUri(getApplicationContext(), new File(avatar))});
+            } else {
+                mUploadCallbackAboveL.onReceiveValue(new Uri[]{});
+            }
+            mUploadCallbackAboveL = null;
         } else if (requestCode == 1000) {
             if (data != null) {
                 try {
@@ -1307,25 +1321,6 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
                     e.printStackTrace();
                 }
             }
-            if (requestCode == PictureConfig.CHOOSE_REQUEST && mUploadCallbackAboveL != null) {
-                // 图片、视频、音频选择结果回调
-                List<LocalMedia> selectList = PictureSelector.obtainMultipleResult(data);
-                String avatar = null;
-                if (selectList != null && selectList.size() > 0) {
-                    avatar = selectList.get(0).getCompressPath();
-                }
-                LOG.i("pq","avatar:"+avatar);
-                if (avatar != null) {
-                    mUploadCallbackAboveL.onReceiveValue(new Uri[]{PictureFileUtils.parUri(getApplicationContext(), new File(avatar))});
-                } else {
-                    mUploadCallbackAboveL.onReceiveValue(new Uri[]{});
-                }
-                mUploadCallbackAboveL = null;
-
-            } else {
-                if (mUploadCallbackAboveL != null)
-                    mUploadCallbackAboveL.onReceiveValue(new Uri[]{});
-            }
         } else if (requestCode == REQUEST_CODE_FILE_CHOOSER) {
             Uri result = data == null || resultCode != RESULT_OK ? null : data.getData();
             if (result == null) {
@@ -1386,7 +1381,7 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
             }
             clearUploadMessage();
             return;
-        } else if(requestCode == REQUEST_CODE_VIDEO_COVER){
+        } else if (requestCode == REQUEST_CODE_VIDEO_COVER) {
             if (data != null) {
                 String videoPath = data.getStringExtra(Constants.COMMON_EXTRA_KEY);
                 uploadVideoCoverFile(videoPath);
@@ -1398,16 +1393,16 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
             }
             String selectAddress = data.getStringExtra("selectAddress");
             selectAddress(selectAddress);
-        }else {
+        } else {
             if (mUploadCallbackAboveL != null)
                 mUploadCallbackAboveL.onReceiveValue(new Uri[]{});
         }
 
     }
 
-    private void uploadVideoCoverFile(String filePath){
-        File file =new File(filePath);
-        if(!file.exists()){
+    private void uploadVideoCoverFile(String filePath) {
+        File file = new File(filePath);
+        if (!file.exists()) {
             return;
         }
         UploadHelper uploadHelper = new UploadHelper(HtmlActivity.this, UploadConstants.UPLOAD_TYPE_OTHER);

+ 8 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/mine/AboutActivity.java

@@ -9,6 +9,7 @@ import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
 import com.cooleshow.base.utils.AppUtils;
 import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
+import com.cooleshow.base.utils.helper.WebStartHelper;
 import com.cooleshow.teacher.contract.AboutContract;
 import com.cooleshow.teacher.databinding.ActivityAboutBinding;
 import com.cooleshow.teacher.presenter.mine.AboutPresenter;
@@ -39,6 +40,13 @@ public class AboutActivity extends BaseMVPActivity<ActivityAboutBinding, AboutPr
     protected void initView() {
         initMidTitleToolBar(viewBinding.toolbarInclude.toolbar, "关于我们");
         viewBinding.tvVersion.setText("版本号:"+ AppUtils.getAppVersionName());
+
+        viewBinding.tvIcp.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                WebStartHelper.startICP();
+            }
+        });
     }
 
     @Override

+ 14 - 0
teacher/src/main/res/layout/activity_about.xml

@@ -103,6 +103,20 @@
     </androidx.constraintlayout.widget.ConstraintLayout>
 
     <TextView
+        android:id="@+id/tv_icp"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="33dp"
+        android:gravity="center"
+        android:includeFontPadding="false"
+        android:drawablePadding="4dp"
+        android:drawableRight="@drawable/icon_arrow_right"
+        android:text="ICP备案号:鄂ICP备2021020787号-5A"
+        android:layout_gravity="center_horizontal"
+        android:textColor="@color/color_999999"
+        android:textSize="@dimen/sp_13"/>
+
+    <TextView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="33dp"