| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675 |
- package com.datarecovery.master.module.imgrecover;
- import android.content.ContentResolver;
- import android.content.ContentUris;
- import android.content.Context;
- import android.database.Cursor;
- import android.net.Uri;
- import android.os.Build;
- import android.provider.MediaStore;
- import android.text.TextUtils;
- import android.util.Pair;
- import androidx.lifecycle.LiveData;
- import androidx.lifecycle.MutableLiveData;
- import androidx.lifecycle.Transformations;
- import com.atmob.app.lib.base.BaseViewModel;
- import com.atmob.app.lib.livedata.SingleLiveEvent;
- import com.atmob.common.logging.AtmobLog;
- import com.atmob.common.runtime.ActivityUtil;
- import com.atmob.common.runtime.ContextUtil;
- import com.datarecovery.master.R;
- import com.datarecovery.master.data.consts.EventId;
- import com.datarecovery.master.data.repositories.DeviceFuncRepository;
- import com.datarecovery.master.handler.EventHelper;
- import com.datarecovery.master.module.member.MemberActivity;
- import com.datarecovery.master.module.member.MemberType;
- import com.datarecovery.master.sdk.bugly.BuglyHelper;
- import com.datarecovery.master.utils.BoxingUtil;
- import com.datarecovery.master.utils.FileUtil;
- import com.datarecovery.master.utils.ImageDeepDetector;
- import com.datarecovery.master.utils.Maps;
- import com.datarecovery.master.utils.MediaStoreHelper;
- import com.datarecovery.master.utils.ReportUtil;
- import com.datarecovery.master.utils.ToastUtil;
- import org.reactivestreams.Subscription;
- import java.io.File;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Objects;
- import java.util.concurrent.TimeUnit;
- import javax.inject.Inject;
- import atmob.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
- import atmob.reactivex.rxjava3.annotations.NonNull;
- import atmob.reactivex.rxjava3.core.FlowableSubscriber;
- import atmob.reactivex.rxjava3.core.Single;
- import atmob.reactivex.rxjava3.core.SingleObserver;
- import atmob.reactivex.rxjava3.core.SingleSource;
- import atmob.reactivex.rxjava3.disposables.Disposable;
- import atmob.rxjava.utils.RxJavaUtil;
- import dagger.hilt.android.lifecycle.HiltViewModel;
- @HiltViewModel
- public class ImageRecoverViewModel extends BaseViewModel {
- private final long SCANNING_COUNTDOWN = 1000 * 60 * 6;
- private final long SCANNING_IS_TRIAL_COUNTDOWN = 1000 * 5;
- private final List<ImageDeepDetector.ImageFile> detectedPhotoList = new ArrayList<>();
- private final List<ImageDeepDetector.ImageFile> detectedWxList = new ArrayList<>();
- private final List<ImageDeepDetector.ImageFile> detectedQQList = new ArrayList<>();
- private final List<ImageDeepDetector.ImageFile> detectedOtherList = new ArrayList<>();
- private final List<ImageDeepDetector.ImageFile> selectList = new ArrayList<>();
- private final MutableLiveData<List<ImageDeepDetector.ImageFile>> detectedPhotoImg = new MutableLiveData<>();
- private final MutableLiveData<List<ImageDeepDetector.ImageFile>> detectedWxImg = new MutableLiveData<>();
- private final MutableLiveData<List<ImageDeepDetector.ImageFile>> detectedQQImg = new MutableLiveData<>();
- private final MutableLiveData<List<ImageDeepDetector.ImageFile>> detectedOtherImg = new MutableLiveData<>();
- private final MutableLiveData<List<ImageDeepDetector.ImageFile>> selectedList = new MutableLiveData<>();
- private final SingleLiveEvent<List<Uri>> deleteUriListSdk11 = new SingleLiveEvent<>();
- private final SingleLiveEvent<?> showTrialFinishDialog = new SingleLiveEvent<>();
- private final SingleLiveEvent<?> showTrialExportFailDialog = new SingleLiveEvent<>();
- private final MutableLiveData<Boolean> showTrialView = new MutableLiveData<>();
- private final DeviceFuncRepository deviceFuncRepository;
- private LiveData<String> detectedPhotoTitle;
- private LiveData<String> detectedWxTitle;
- private LiveData<String> detectedQQTitle;
- private LiveData<String> detectedOtherTitle;
- private final SingleLiveEvent<Pair<List<ImageDeepDetector.ImageFile>, Integer>> previewEvent = new SingleLiveEvent<>();
- private final SingleLiveEvent<?> showClearDialog = new SingleLiveEvent<>();
- private final SingleLiveEvent<Boolean> showScanDialogEvent = new SingleLiveEvent<>();
- private final SingleLiveEvent<Boolean> showLoadingEvent = new SingleLiveEvent<>();
- private final SingleLiveEvent<?> scrollTop = new SingleLiveEvent<>();
- private final SingleLiveEvent<?> notifyList = new SingleLiveEvent<>();
- private final MutableLiveData<String> barTitle = new MutableLiveData<>();
- private final MutableLiveData<Boolean> checkAll = new MutableLiveData<>(false);
- //总探测到的图片数量
- private int totalCount = 0;
- private final MutableLiveData<Integer> totalDetectedCount = new MutableLiveData<>();
- private final MutableLiveData<String> detectedLastFileName = new MutableLiveData<>();
- private LiveData<String> selectedCountTxt;
- private Disposable scanDisposable;
- @MemberType
- private String type;
- private SingleObserver<? super Boolean> dealMediaObserver;
- //是否会员试用
- private boolean isTrial;
- private long detectTime;
- @Inject
- public ImageRecoverViewModel(DeviceFuncRepository deviceFuncRepository) {
- this.deviceFuncRepository = deviceFuncRepository;
- barTitle.setValue(ContextUtil.getContext().getString(R.string.iamge_recover_all));
- initLiveData();
- }
- public LiveData<?> getScrollTop() {
- return scrollTop;
- }
- public LiveData<?> getShowTrialFinishDialog() {
- return showTrialFinishDialog;
- }
- public LiveData<?> getShowTrialExportFailDialog() {
- return showTrialExportFailDialog;
- }
- public LiveData<String> getDetectedLastFileName() {
- return detectedLastFileName;
- }
- public LiveData<Boolean> getShowTrialView() {
- return showTrialView;
- }
- public boolean isTrial() {
- if (Objects.equals(type, MemberType.APP_IMAGE_CLEAN)) {
- return !deviceFuncRepository.isHaveAuth(type);
- } else {
- return isTrial;
- }
- }
- public LiveData<List<Uri>> getDeleteUriListSdk11() {
- return deleteUriListSdk11;
- }
- public LiveData<?> getShowClearDialog() {
- return showClearDialog;
- }
- public LiveData<?> getNotifyList() {
- return notifyList;
- }
- public LiveData<Boolean> getShowLoadingEvent() {
- return showLoadingEvent;
- }
- public LiveData<Pair<List<ImageDeepDetector.ImageFile>, Integer>> getPreviewEvent() {
- return previewEvent;
- }
- public LiveData<Integer> getTotalDetectedCount() {
- return totalDetectedCount;
- }
- public LiveData<String> getSelectedCountTxt() {
- return selectedCountTxt;
- }
- public LiveData<List<ImageDeepDetector.ImageFile>> getSelectedList() {
- return selectedList;
- }
- public LiveData<List<ImageDeepDetector.ImageFile>> getDetectedPhotoImg() {
- return detectedPhotoImg;
- }
- public LiveData<List<ImageDeepDetector.ImageFile>> getDetectedWxImg() {
- return detectedWxImg;
- }
- public LiveData<List<ImageDeepDetector.ImageFile>> getDetectedQQImg() {
- return detectedQQImg;
- }
- public LiveData<List<ImageDeepDetector.ImageFile>> getDetectedOtherImg() {
- return detectedOtherImg;
- }
- public LiveData<String> getDetectedPhotoTitle() {
- return detectedPhotoTitle;
- }
- public LiveData<String> getDetectedWxTitle() {
- return detectedWxTitle;
- }
- public LiveData<String> getDetectedQQTitle() {
- return detectedQQTitle;
- }
- public LiveData<String> getDetectedOtherTitle() {
- return detectedOtherTitle;
- }
- public LiveData<Boolean> getShowScanDialogEvent() {
- return showScanDialogEvent;
- }
- public LiveData<Boolean> getCheckAll() {
- return checkAll;
- }
- public LiveData<String> getBarTitle() {
- return barTitle;
- }
- public String getType() {
- return type;
- }
- private void initLiveData() {
- detectedPhotoTitle = Transformations.map(detectedPhotoImg, list ->
- ContextUtil.getContext().getString(R.string.photo_count, (list == null || list.isEmpty()) ? 0 : list.size()));
- detectedWxTitle = Transformations.map(detectedWxImg, list ->
- ContextUtil.getContext().getString(R.string.wx_count, (list == null || list.isEmpty()) ? 0 : list.size()));
- detectedQQTitle = Transformations.map(detectedQQImg, list ->
- ContextUtil.getContext().getString(R.string.qq_count, (list == null || list.isEmpty()) ? 0 : list.size()));
- detectedOtherTitle = Transformations.map(detectedOtherImg, list ->
- ContextUtil.getContext().getString(R.string.other_count, (list == null || list.isEmpty()) ? 0 : list.size()));
- }
- public void onCheckAllClick(boolean isCheck) {
- checkAll.setValue(isCheck);
- setListCheck(detectedPhotoList, isCheck);
- setListCheck(detectedWxList, isCheck);
- setListCheck(detectedQQList, isCheck);
- setListCheck(detectedOtherList, isCheck);
- if (isCheck) {
- selectList.clear();
- selectList.addAll(detectedPhotoList);
- selectList.addAll(detectedWxList);
- selectList.addAll(detectedQQList);
- selectList.addAll(detectedOtherList);
- } else {
- selectList.clear();
- }
- selectedList.setValue(selectList);
- }
- private void setListCheck(List<ImageDeepDetector.ImageFile> list, boolean isCheck) {
- if (list == null || list.isEmpty()) {
- return;
- }
- for (ImageDeepDetector.ImageFile imageFile : list) {
- imageFile.setCheck(isCheck);
- }
- }
- public void startImageScanning() {
- if (scanDisposable != null && !scanDisposable.isDisposed()) {
- return;
- }
- ImageDeepDetector.detect(ContextUtil.getContext())
- .take(isTrial ? SCANNING_IS_TRIAL_COUNTDOWN : SCANNING_COUNTDOWN, TimeUnit.MILLISECONDS)
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(new FlowableSubscriber<List<ImageDeepDetector.ImageFile>>() {
- @Override
- public void onSubscribe(@NonNull Subscription s) {
- s.request(Integer.MAX_VALUE);
- scanDisposable = Disposable.fromSubscription(s);
- addDisposable(scanDisposable);
- showScanDialogEvent.setValue(true);
- checkAll.setValue(false);
- totalCount = 0;
- totalDetectedCount.setValue(0);
- detectTime = System.currentTimeMillis();
- detectedPhotoList.clear();
- detectedWxList.clear();
- detectedQQList.clear();
- detectedOtherList.clear();
- selectList.clear();
- }
- @Override
- public void onNext(List<ImageDeepDetector.ImageFile> imageFiles) {
- if (imageFiles == null) {
- return;
- }
- totalCount += imageFiles.size();
- totalDetectedCount.setValue(totalCount);
- int photoCount = 0;
- int wxCount = 0;
- int qqCount = 0;
- int otherCount = 0;
- for (ImageDeepDetector.ImageFile imageFile : imageFiles) {
- if (imageFile.getCategory() == ImageDeepDetector.ImageFile.CATEGORY_GALLERY) {
- detectedPhotoList.add(imageFile);
- photoCount++;
- } else if (imageFile.getCategory() == ImageDeepDetector.ImageFile.CATEGORY_WECHAT) {
- detectedWxList.add(imageFile);
- wxCount++;
- } else if (imageFile.getCategory() == ImageDeepDetector.ImageFile.CATEGORY_QQ) {
- detectedQQList.add(imageFile);
- qqCount++;
- } else {
- detectedOtherList.add(imageFile);
- otherCount++;
- }
- detectedLastFileName.setValue(imageFile.getName());
- }
- if (photoCount > 0) {
- detectedPhotoImg.setValue(detectedPhotoList);
- }
- if (wxCount > 0) {
- detectedWxImg.setValue(detectedWxList);
- }
- if (qqCount > 0) {
- detectedQQImg.setValue(detectedQQList);
- }
- if (otherCount > 0) {
- detectedOtherImg.setValue(detectedOtherList);
- }
- scrollTop.call();
- }
- @Override
- public void onError(Throwable t) {
- showScanDialogEvent.setValue(false);
- }
- @Override
- public void onComplete() {
- setFreeExport();
- AtmobLog.d("ImageRecoverViewModel", System.currentTimeMillis() - detectTime + "ms - " + totalCount);
- if (isTrial) {
- showTrialFinishDialog.call();
- }
- showScanDialogEvent.setValue(false);
- }
- });
- }
- private void setFreeExport() {
- if (isTrial) {
- showTrialView.setValue(true);
- if (!detectedPhotoList.isEmpty()) {
- detectedPhotoList.get(0).setTrial(true);
- return;
- }
- if (!detectedWxList.isEmpty()) {
- detectedWxList.get(0).setTrial(true);
- return;
- }
- if (!detectedQQList.isEmpty()) {
- detectedQQList.get(0).setTrial(true);
- return;
- }
- if (!detectedOtherList.isEmpty()) {
- detectedOtherList.get(0).setTrial(true);
- return;
- }
- }
- }
- public void cancelScan() {
- if (scanDisposable != null) scanDisposable.dispose();
- showScanDialogEvent.setValue(false);
- setFreeExport();
- }
- public void setItemCheck(@NonNull ImageDeepDetector.ImageFile imageFile) {
- imageFile.setCheck(!imageFile.isCheck());
- if (imageFile.isCheck()) {
- selectList.add(imageFile);
- } else {
- selectList.remove(imageFile);
- }
- selectedList.setValue(selectList);
- }
- public void checkPreview(@NonNull ImageDeepDetector.ImageFile imageFile) {
- if (isTrial) {
- sendPreviewEvent(imageFile);
- return;
- }
- if (Objects.equals(type, MemberType.APP_IMAGE_CLEAN)) {
- return;
- }
- if (Objects.equals(type, MemberType.APP_IMAGE_RECOVER) && !deviceFuncRepository.isHaveAuth(type)) {
- return;
- } else if (Objects.equals(type, MemberType.APP_IMAGE_CLEAN) && !deviceFuncRepository.isHaveAuth(type)) {
- return;
- }
- sendPreviewEvent(imageFile);
- }
- public void sendPreviewEvent(@NonNull ImageDeepDetector.ImageFile imageFile) {
- List<ImageDeepDetector.ImageFile> allDetectedList = getAllDetectedList();
- int position = getPosition(allDetectedList, imageFile);
- previewEvent.setValue(new Pair<>(allDetectedList, position));
- }
- public void onOperationClick() {
- if (Objects.equals(type, MemberType.APP_IMAGE_CLEAN)) {
- if (deviceFuncRepository.isHaveAuth(type)) {
- showClearDialog.call();
- } else {
- MemberActivity.start(ActivityUtil.getTopActivity(), type);
- }
- } else {
- onExportClick();
- }
- }
- public void executeImageDelete() {
- if (selectList.isEmpty()) {
- return;
- }
- Single.just(Build.VERSION.SDK_INT)
- .map(sdkInt -> sdkInt >= Build.VERSION_CODES.R)
- .map(isSdk11 -> {
- List<ImageDeepDetector.ImageFile> safList = new ArrayList<>();
- List<Uri> uriList = new ArrayList<>();
- if (isSdk11) {
- for (ImageDeepDetector.ImageFile item : selectList) {
- File tempFile = new File(item.getPath());
- long mediaID = getFilePathToMediaID(tempFile.getAbsolutePath(), ContextUtil.getContext());
- if (mediaID > 0) {
- Uri Uri_one = ContentUris.withAppendedId(MediaStore.Images.Media.getContentUri("external"), mediaID);
- uriList.add(Uri_one);
- } else {
- safList.add(item);
- }
- }
- } else {
- safList.addAll(selectList);
- }
- return new Pair<>(safList, uriList);
- })
- .map(pair -> {
- if (pair.first != null && !pair.first.isEmpty()) {
- for (ImageDeepDetector.ImageFile item : pair.first) {
- try {
- item.delete();
- if (item.getCategory() == ImageDeepDetector.ImageFile.CATEGORY_GALLERY) {
- detectedPhotoList.remove(item);
- } else if (item.getCategory() == ImageDeepDetector.ImageFile.CATEGORY_WECHAT) {
- detectedWxList.remove(item);
- } else if (item.getCategory() == ImageDeepDetector.ImageFile.CATEGORY_QQ) {
- detectedQQList.remove(item);
- } else {
- detectedOtherList.remove(item);
- }
- } catch (Exception ignore) {
- }
- }
- selectList.removeAll(pair.first);
- selectedList.postValue(selectList);
- notifyList.postValue(null);
- }
- return pair.second;
- })
- .map(uriList -> {
- if (uriList != null && !uriList.isEmpty()) {
- deleteUriListSdk11.postValue(uriList);
- return false;
- } else {
- return true;
- }
- })
- .flatMap(aBoolean -> {
- if (BoxingUtil.boxing(aBoolean)) {
- return Single.just(true);
- } else {
- return (SingleSource<Boolean>) observer -> this.dealMediaObserver = observer;
- }
- })
- .compose(RxJavaUtil.SingleSchedule.io2Main())
- .subscribe(new SingleObserver<Boolean>() {
- @Override
- public void onSubscribe(@NonNull Disposable d) {
- showLoadingEvent.setValue(true);
- }
- @Override
- public void onSuccess(@NonNull Boolean result) {
- showLoadingEvent.setValue(false);
- if (result) {
- for (ImageDeepDetector.ImageFile item : selectList) {
- try {
- item.delete();
- if (item.getCategory() == ImageDeepDetector.ImageFile.CATEGORY_GALLERY) {
- detectedPhotoList.remove(item);
- } else if (item.getCategory() == ImageDeepDetector.ImageFile.CATEGORY_WECHAT) {
- detectedWxList.remove(item);
- } else if (item.getCategory() == ImageDeepDetector.ImageFile.CATEGORY_QQ) {
- detectedQQList.remove(item);
- } else {
- detectedOtherList.remove(item);
- }
- } catch (Exception ignore) {
- }
- }
- ToastUtil.show(R.string.delete_success, ToastUtil.LENGTH_SHORT);
- selectList.clear();
- selectedList.setValue(selectList);
- notifyList.call();
- }
- checkAll.setValue(false);
- }
- @Override
- public void onError(@NonNull Throwable throwable) {
- showLoadingEvent.setValue(false);
- ToastUtil.show(throwable.getMessage(), ToastUtil.LENGTH_SHORT);
- BuglyHelper.postCatchedException(new Exception("图片删除:", throwable));
- }
- });
- }
- public long getFilePathToMediaID(String songPath, Context context) {
- long id = 0;
- ContentResolver cr = context.getContentResolver();
- Uri uri = MediaStore.Files.getContentUri("external");
- String selection = MediaStore.Audio.Media.DATA;
- String[] selectionArgs = {songPath};
- String[] projection = {MediaStore.Audio.Media._ID};
- String sortOrder = MediaStore.Audio.Media.TITLE + " ASC";
- Cursor cursor = cr.query(uri, projection, selection + "=?", selectionArgs, null);
- if (cursor != null) {
- while (cursor.moveToNext()) {
- int idIndex = cursor.getColumnIndex(MediaStore.Audio.Media._ID);
- id = Long.parseLong(cursor.getString(idIndex));
- }
- }
- return id;
- }
- public void onExportClick() {
- if (selectList.isEmpty()) {
- return;
- }
- if (isTrial) {
- for (ImageDeepDetector.ImageFile imageFile : selectList) {
- if (!imageFile.isTrial()) {
- showTrialExportFailDialog.call();
- return;
- }
- }
- } else {
- if (Objects.equals(type, MemberType.APP_IMAGE_RECOVER) && !deviceFuncRepository.isHaveAuth(type)) {
- return;
- } else if (Objects.equals(type, MemberType.APP_IMAGE_CLEAN) && !deviceFuncRepository.isHaveAuth(type)) {
- return;
- }
- }
- showLoadingEvent.setValue(true);
- RxJavaUtil.doInBackground(() -> {
- for (ImageDeepDetector.ImageFile item : selectList) {
- MediaStoreHelper.saveToSharedStorage(MediaStoreHelper.TYPE_IMAGE, item.newInputStream(), FileUtil.getExportImageFileName(item.getName()));
- item.setCheck(false);
- }
- return true;
- }, o -> {
- checkAll.setValue(false);
- showLoadingEvent.setValue(false);
- ToastUtil.show(R.string.export_success, ToastUtil.LENGTH_SHORT);
- selectList.clear();
- selectedList.setValue(selectList);
- }, throwable -> {
- showLoadingEvent.setValue(false);
- ToastUtil.show(throwable.getMessage(), ToastUtil.LENGTH_SHORT);
- BuglyHelper.postCatchedException(new Exception("图片导出:", throwable));
- });
- }
- public List<ImageDeepDetector.ImageFile> getAllDetectedList() {
- ArrayList<ImageDeepDetector.ImageFile> allList = new ArrayList<>();
- allList.addAll(detectedPhotoList);
- allList.addAll(detectedWxList);
- allList.addAll(detectedQQList);
- allList.addAll(detectedOtherList);
- return allList;
- }
- public int getPosition(@NonNull List<ImageDeepDetector.ImageFile> list, ImageDeepDetector.ImageFile target) {
- return list.indexOf(target);
- }
- public void setType(@MemberType String type) {
- if (!TextUtils.isEmpty(this.type)) {
- return;
- }
- this.type = type;
- switch (type) {
- case MemberType.APP_IMAGE_CLEAN:
- EventHelper.report(EventId.hf1000514);
- EventHelper.timeEvent(EventId.hf1000529);
- selectedCountTxt = Transformations.map(selectedList, list -> {
- if (list == null || list.isEmpty()) {
- return ContextUtil.getContext().getString(R.string.delete);
- }
- return ContextUtil.getContext().getString(R.string.delete_count, list.size());
- });
- break;
- case MemberType.APP_IMAGE_RECOVER:
- EventHelper.report(EventId.hf1000506);
- EventHelper.timeEvent(EventId.hf1000521);
- selectedCountTxt = Transformations.map(selectedList, list -> {
- if (list == null || list.isEmpty()) {
- return ContextUtil.getContext().getString(R.string.export);
- }
- return ContextUtil.getContext().getString(R.string.export_count, list.size());
- });
- break;
- }
- }
- @Override
- protected void onCleared() {
- super.onCleared();
- switch (type) {
- case MemberType.APP_IMAGE_CLEAN:
- EventHelper.report(EventId.hf1000529);
- break;
- case MemberType.APP_IMAGE_RECOVER:
- EventHelper.report(EventId.hf1000521);
- break;
- }
- }
- public void callDealComplete(boolean isDelete) {
- if (dealMediaObserver != null) {
- dealMediaObserver.onSuccess(isDelete);
- }
- }
- public void setIsTrial(boolean isTrial) {
- this.isTrial = isTrial;
- }
- public void onTrialRecoverClick() {
- MemberActivity.start(ActivityUtil.getTopActivity(), type);
- }
- public void onViewTrialRecoverClick() {
- EventHelper.report(EventId.hf1001117, Maps.asMap(EventId.EVENT_ID, ReportUtil.getReportId(type)));
- MemberActivity.start(ActivityUtil.getTopActivity(), type);
- }
- public void scrollPosition(int lastCompletelyItemPosition, int itemCount) {
- if (scanDisposable == null || !scanDisposable.isDisposed()) {
- return;
- }
- if (lastCompletelyItemPosition == itemCount - 1 && !BoxingUtil.boxing(showScanDialogEvent.getValue())) {
- showTrialFinishDialog.call();
- EventHelper.report(EventId.hf1001119, Maps.asMap(EventId.EVENT_ID, ReportUtil.getReportId(type)));
- }
- }
- }
|