From 8e124496c7db1c65bc3934f4e00978a1e4d8697a Mon Sep 17 00:00:00 2001 From: Justwen Date: Sat, 17 Feb 2024 13:36:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=A0=E6=B3=95=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=9B=BE=E7=89=87=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../androidnga/gallery/ImageZoomActivity.java | 18 ++++-------------- .../mvp/presenter/TopicPostPresenter.java | 15 +-------------- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/nga_phone_base_3.0/src/main/java/gov/anzong/androidnga/gallery/ImageZoomActivity.java b/nga_phone_base_3.0/src/main/java/gov/anzong/androidnga/gallery/ImageZoomActivity.java index 2c1413f32..4fc302b79 100644 --- a/nga_phone_base_3.0/src/main/java/gov/anzong/androidnga/gallery/ImageZoomActivity.java +++ b/nga_phone_base_3.0/src/main/java/gov/anzong/androidnga/gallery/ImageZoomActivity.java @@ -1,6 +1,5 @@ package gov.anzong.androidnga.gallery; -import android.Manifest; import android.content.ActivityNotFoundException; import android.content.DialogInterface; import android.content.Intent; @@ -18,7 +17,6 @@ import androidx.viewpager.widget.ViewPager; import com.justwen.androidnga.cloud.CloudServerManager; -import com.tbruyelle.rxpermissions2.RxPermissions; import java.io.File; import java.util.Arrays; @@ -119,18 +117,10 @@ private void initBottomView() { } private void saveBitmap(OnSimpleHttpCallBack callBack, String... urls) { - new RxPermissions(this) - .request(Manifest.permission.WRITE_EXTERNAL_STORAGE) - .subscribe(granted -> { - if (granted) { // Always true pre-M - if (mSaveImageTask == null) { - mSaveImageTask = new SaveImageTask(); - } - mSaveImageTask.execute(callBack, urls); - } else { - // Oups permission denied - } - }); + if (mSaveImageTask == null) { + mSaveImageTask = new SaveImageTask(); + } + mSaveImageTask.execute(callBack, urls); } private void saveBitmap(String... urls) { diff --git a/nga_phone_base_3.0/src/main/java/sp/phone/mvp/presenter/TopicPostPresenter.java b/nga_phone_base_3.0/src/main/java/sp/phone/mvp/presenter/TopicPostPresenter.java index 5e327bedc..24776f8d8 100644 --- a/nga_phone_base_3.0/src/main/java/sp/phone/mvp/presenter/TopicPostPresenter.java +++ b/nga_phone_base_3.0/src/main/java/sp/phone/mvp/presenter/TopicPostPresenter.java @@ -1,6 +1,5 @@ package sp.phone.mvp.presenter; -import android.Manifest; import android.app.Activity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; @@ -19,11 +18,8 @@ import gov.anzong.androidnga.R; import gov.anzong.androidnga.base.util.ContextUtils; -import gov.anzong.androidnga.base.util.PermissionUtils; import gov.anzong.androidnga.base.util.ToastUtils; -import gov.anzong.androidnga.common.util.EmoticonUtils; import gov.anzong.androidnga.http.OnHttpCallBack; -import gov.anzong.androidnga.rxjava.BaseSubscriber; import sp.phone.mvp.contract.TopicPostContract; import sp.phone.mvp.model.TopicPostModel; import sp.phone.param.PostParam; @@ -109,16 +105,7 @@ public void post(String title, String body, boolean isAnony) { @Override public void showFilePicker() { - PermissionUtils.request(mBaseView, new BaseSubscriber() { - - @Override - public void onNext(Boolean aBoolean) { - if (aBoolean != null && aBoolean) { - mBaseView.showFilePicker(); - } - - } - }, Manifest.permission.WRITE_EXTERNAL_STORAGE); + mBaseView.showFilePicker(); } @Override