整点视频 v3.3.0版本的 MD5 值为:cba0457dc37421eed445b30f92de25d3
以下内容为反编译后的 DownloadVideoActivity.java 源代码,内容仅作参考
package com.ys.resemble.ui.mine;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.SimpleItemAnimator;
import com.wholepoint.wpfilms.R;
import com.ys.resemble.app.AppApplication;
import com.ys.resemble.data.local.VideoDownloadDao;
import com.ys.resemble.databinding.ActivityDownloadVideoBinding;
import com.ys.resemble.entity.DownloadInfoEntry;
import com.ys.resemble.util.OkHttp3Util;
import com.ys.resemble.util.RxTimer;
import io.reactivex.functions.Consumer;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import me.goldze.mvvmhabit.base.BaseApplication;
import me.goldze.mvvmhabit.base.BaseFragment;
import okhttp3.Response;
public class DownloadVideoActivity extends BaseFragment<ActivityDownloadVideoBinding, DownloadVideoViewModel> {
private List<DownloadInfoEntry> OooO00o = new ArrayList();
private RxTimer OooO0O0 = new RxTimer();
private Handler OooO0OO = new Handler();
private String OooO0Oo;
private DownloadingAdapter OooO0o;
private OooO0O0 OooO0o0;
public class OooO00o implements OkHttp3Util.OkHttpCallBack {
OooO00o() {
}
@Override
public void onFailure(IOException iOException) {
me.goldze.mvvmhabit.utils.OooOO0.OooO0Oo("wangyi", "get失败:" + iOException.toString());
}
@Override
public void onSuccess(Response response) {
try {
DownloadVideoActivity.this.OooO0Oo = response.body().string();
if (DownloadVideoActivity.this.OooO0OO != null) {
DownloadVideoActivity.this.OooO0OO.removeCallbacks(DownloadVideoActivity.this.OooO0o0);
DownloadVideoActivity.this.OooO0OO.postDelayed(DownloadVideoActivity.this.OooO0o0, 500L);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
class OooO0O0 implements Runnable {
class OooO00o extends com.od.OooOOOO.OooO00o<List<DownloadInfoEntry>> {
OooO00o(OooO0O0 oooO0O0) {
}
}
class C0494OooO0O0 implements Comparator<DownloadInfoEntry> {
C0494OooO0O0(OooO0O0 oooO0O0) {
}
@Override
public int compare(DownloadInfoEntry downloadInfoEntry, DownloadInfoEntry downloadInfoEntry2) {
return downloadInfoEntry2.getDownload_time().compareTo(downloadInfoEntry.getDownload_time());
}
}
OooO0O0() {
}
@Override
public void run() {
me.goldze.mvvmhabit.utils.OooOO0.OooO0Oo("wangyi", "数局为:" + DownloadVideoActivity.this.OooO0Oo);
if (com.ys.resemble.util.Oooo0.OooO0Oo(DownloadVideoActivity.this.OooO0Oo, DownloadInfoEntry.class)) {
DownloadVideoActivity downloadVideoActivity = DownloadVideoActivity.this;
downloadVideoActivity.OooO00o = (List) com.ys.resemble.util.Oooo0.OooO0OO(downloadVideoActivity.OooO0Oo, new OooO00o(this).getType());
Collections.sort(DownloadVideoActivity.this.OooO00o, new C0494OooO0O0(this));
((DownloadVideoViewModel) ((BaseFragment) DownloadVideoActivity.this).viewModel).OooOO0(DownloadVideoActivity.this.OooO00o, DownloadVideoActivity.this.OooO0o);
}
}
}
public void OooOO0o(com.ys.resemble.event.Oooo000 oooo000) throws Exception {
((DownloadVideoViewModel) this.viewModel).OooO = true;
OooO("http://127.0.0.1:" + AppApplication.OooO0OO + "/control?msg=download_info");
}
public void OooOOO(com.ys.resemble.event.OooOo oooOo) throws Exception {
((DownloadVideoViewModel) this.viewModel).OooO0o = VideoDownloadDao.getInstance().queryHistory();
me.goldze.mvvmhabit.bus.OooO0O0.OooO00o().OooO0O0(new com.ys.resemble.event.OooOo00(((DownloadVideoViewModel) this.viewModel).OooO0o));
}
public void OooOOOo(com.ys.resemble.event.o0O0O00 o0o0o00) throws Exception {
if (o0o0o00.OooO00o == 0) {
if (((DownloadVideoViewModel) this.viewModel).OooOo00.size() > 0 && o0o0o00.OooO0O0.get()) {
((DownloadVideoViewModel) this.viewModel).OooO0Oo.set(true);
} else {
((DownloadVideoViewModel) this.viewModel).OooO0Oo.set(false);
}
}
}
public static DownloadVideoActivity OooOOo0(int i) {
DownloadVideoActivity downloadVideoActivity = new DownloadVideoActivity();
Bundle bundle = new Bundle();
bundle.putInt("resourceType", i);
downloadVideoActivity.setArguments(bundle);
return downloadVideoActivity;
}
public void OooO(String str) {
OkHttp3Util.OooO00o(str, new OooO00o());
}
@Override
public DownloadVideoViewModel initViewModel() {
return new DownloadVideoViewModel(BaseApplication.OooO00o(), com.ys.resemble.app.OooO0O0.OooO00o(), this.OooO0O0, this);
}
@Override
public int initContentView(LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, @Nullable Bundle bundle) {
return R.layout.activity_download_video;
}
@Override
public void initData() {
super.initData();
RecyclerView.RecycledViewPool recycledViewPool = new RecyclerView.RecycledViewPool();
recycledViewPool.setMaxRecycledViews(0, 10);
((ActivityDownloadVideoBinding) this.binding).rvDownloading.setRecycledViewPool(recycledViewPool);
((ActivityDownloadVideoBinding) this.binding).rvDownloading.getItemAnimator().setChangeDuration(0L);
((SimpleItemAnimator) ((ActivityDownloadVideoBinding) this.binding).rvDownloading.getItemAnimator()).setSupportsChangeAnimations(false);
DownloadingAdapter downloadingAdapter = new DownloadingAdapter();
this.OooO0o = downloadingAdapter;
((ActivityDownloadVideoBinding) this.binding).rvDownloading.setAdapter(downloadingAdapter);
this.OooO0o0 = new OooO0O0();
if (AppApplication.OooO0OO > 0) {
OooO("http://127.0.0.1:" + AppApplication.OooO0OO + "/control?msg=download_info");
}
}
@Override
public int initVariableId() {
return 12;
}
@Override
@RequiresApi(api = 24)
public void initViewObservable() {
super.initViewObservable();
addSubscribe(me.goldze.mvvmhabit.bus.OooO0O0.OooO00o().OooO0Oo(com.ys.resemble.event.Oooo000.class).subscribe(new Consumer() {
@Override
public final void accept(Object obj) {
DownloadVideoActivity.this.OooOO0o((com.ys.resemble.event.Oooo000) obj);
}
}));
addSubscribe(me.goldze.mvvmhabit.bus.OooO0O0.OooO00o().OooO0Oo(com.ys.resemble.event.OooOo.class).subscribe(new Consumer() {
@Override
public final void accept(Object obj) {
DownloadVideoActivity.this.OooOOO((com.ys.resemble.event.OooOo) obj);
}
}));
addSubscribe(me.goldze.mvvmhabit.bus.OooO0O0.OooO00o().OooO0Oo(com.ys.resemble.event.o0O0O00.class).subscribe(new Consumer() {
@Override
public final void accept(Object obj) {
DownloadVideoActivity.this.OooOOOo((com.ys.resemble.event.o0O0O00) obj);
}
}));
}
@Override
public void onDestroy() {
this.OooO0O0.OooO0O0();
if (((DownloadVideoViewModel) this.viewModel).OooOo00.size() > 0) {
for (int i = 0; i < ((DownloadVideoViewModel) this.viewModel).OooOo00.size(); i++) {
((DownloadVideoViewModel) this.viewModel).OooOo00.get(i).OooO0OO.OooO0O0();
((DownloadVideoViewModel) this.viewModel).OooOo00.get(i).OooO0Oo.removeCallbacks(((DownloadVideoViewModel) this.viewModel).OooOo00.get(i).OooO0oO);
}
}
super.onDestroy();
Handler handler = this.OooO0OO;
if (handler != null) {
handler.removeCallbacks(this.OooO0o0);
this.OooO0OO = null;
}
}
}