优化点击进入直播间的速度

This commit is contained in:
zlzw 2022-09-29 15:58:57 +08:00
parent 81f701e915
commit 1f0a95ad0f

View File

@ -90,10 +90,12 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
/**
* Created by cxf on 2018/10/7.
@ -152,11 +154,14 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
mIsAnchor = this instanceof LiveAnchorActivity;
mPageContainer = (ViewGroup) findViewById(R.id.page_container);
EventBus.getDefault().register(this);
mImageUtil = new ProcessImageUtil(this);
mDialogFragmentSet = new HashSet<>();
//解压 美颜模型
try {
CommonAppConfig.VIDEO_TIE_MODEl_PATH = getFilesDir().getAbsolutePath() + "/model";//app安装路径
File model = new File(CommonAppConfig.VIDEO_TIE_MODEl_PATH);
if(model.exists()&& Objects.requireNonNull(model.listFiles()).length>0){
return;
}
UnzipFromAssets.unZip(LiveActivity.this, "model-all.zip", CommonAppConfig.VIDEO_TIE_MODEl_PATH, false);
} catch (Exception e) {
e.printStackTrace();
@ -174,6 +179,9 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
}
public ProcessImageUtil getProcessImageUtil() {
if(mImageUtil==null){
mImageUtil = new ProcessImageUtil(this);
}
return mImageUtil;
}