version:1.0.4
fix: update:增加下载
This commit is contained in:
@@ -16,7 +16,7 @@ import com.xwad.os.R;
|
||||
import com.xwad.os.base.mvvm.fragment.BaseMvvmFragment;
|
||||
import com.xwad.os.config.CommonConfig;
|
||||
import com.xwad.os.databinding.FragmentAiBinding;
|
||||
import com.xwad.os.jxw.Util;
|
||||
import com.xwad.os.jxw.util.Util;
|
||||
import com.youth.banner.adapter.BannerAdapter;
|
||||
import com.youth.banner.listener.OnBannerListener;
|
||||
import com.youth.banner.transformer.ZoomOutPageTransformer;
|
||||
|
||||
@@ -25,7 +25,7 @@ import com.xwad.os.bean.jxw.ItemsBean;
|
||||
import com.xwad.os.databinding.FragmentChineseBinding;
|
||||
import com.xwad.os.jxw.AssertUtils;
|
||||
import com.xwad.os.jxw.SPUtils;
|
||||
import com.xwad.os.jxw.Util;
|
||||
import com.xwad.os.jxw.util.Util;
|
||||
import com.xwad.os.manager.AmapManager;
|
||||
import com.xwad.os.utils.OpenApkUtils;
|
||||
import com.xwad.os.view.jxw.widget.AppsDialog;
|
||||
@@ -51,7 +51,7 @@ public class ChineseFragment extends BaseMvvmFragment<ChineseViewModel, Fragment
|
||||
|
||||
|
||||
private Activity mContext;
|
||||
private List<ItemsBean> appList = new ArrayList();
|
||||
private List<ItemsBean> appList = new ArrayList<>();
|
||||
private BaseQuickAdapter<ItemsBean, BaseViewHolder> contentAdapter = new BaseQuickAdapter<ItemsBean, BaseViewHolder>(R.layout.item_yw_app) {
|
||||
@Override
|
||||
public void convert(BaseViewHolder baseViewHolder, final ItemsBean itemsBean) {
|
||||
@@ -226,7 +226,7 @@ public class ChineseFragment extends BaseMvvmFragment<ChineseViewModel, Fragment
|
||||
private void setTag(View view) {
|
||||
String str;
|
||||
String checkGrade = Util.checkGrade(SPUtils.getGrade());
|
||||
if (checkGrade.equals("小学")) {
|
||||
if ("小学".equals(checkGrade)) {
|
||||
str = "tag_args_new_ztsp_xxyw";
|
||||
} else {
|
||||
str = checkGrade.equals("初中") ? "tag_args_new_ztsp_czyw" : "tag_args_new_ztsp_gzyw";
|
||||
@@ -294,7 +294,7 @@ public class ChineseFragment extends BaseMvvmFragment<ChineseViewModel, Fragment
|
||||
contentAdapter.notifyDataSetChanged();
|
||||
// MyApp.getInstance().mBottomBtnOnClickListener.setContext(getActivity());
|
||||
// MyApp.getInstance().mBottomBtnOnClickListener.onClick(obj);
|
||||
OpenApkUtils.getInstance().openJxwApp(obj);
|
||||
OpenApkUtils.getInstance().openJxwApp(mContext, obj);
|
||||
}
|
||||
|
||||
private void saveTag(ItemsBean itemsBean) {
|
||||
|
||||
@@ -23,6 +23,8 @@ import com.xwad.os.bean.jxw.TabBean;
|
||||
import com.xwad.os.databinding.FragmentComplexBinding;
|
||||
import com.xwad.os.jxw.AssertUtils;
|
||||
import com.xwad.os.jxw.LearnStageBean;
|
||||
import com.xwad.os.jxw.SPUtils;
|
||||
import com.xwad.os.jxw.util.Util;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
@@ -109,15 +111,16 @@ public class ComplexFragment extends BaseMvvmFragment<ComplexViewModel, Fragment
|
||||
mViewDataBinding.rvTitle.setLayoutManager(linearLayoutManager);
|
||||
|
||||
|
||||
// if (Util.checkGrade(SPUtils.getGrade()).equals("小学")) {
|
||||
// xxPage.setVisibility(View.VISIBLE);
|
||||
// subject_viewPager.setVisibility(View.GONE);
|
||||
// rv_title.setVisibility(View.GONE);
|
||||
// } else {
|
||||
// xxPage.setVisibility(View.GONE);
|
||||
// subject_viewPager.setVisibility(View.VISIBLE);
|
||||
// rv_title.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
if ("小学".equals(Util.checkGrade(SPUtils.getGrade()))) {
|
||||
mViewDataBinding.rlXx.setVisibility(View.VISIBLE);
|
||||
mViewDataBinding.subjectViewPager.setVisibility(View.GONE);
|
||||
mViewDataBinding.rvTitle.setVisibility(View.GONE);
|
||||
} else {
|
||||
mViewDataBinding.rlXx.setVisibility(View.GONE);
|
||||
mViewDataBinding.subjectViewPager.setVisibility(View.VISIBLE);
|
||||
mViewDataBinding.rvTitle.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
tabBeanList.clear();
|
||||
mFragment.clear();
|
||||
for (LearnStageBean learnStageBean : getLearnStage()) {
|
||||
|
||||
@@ -25,7 +25,7 @@ import com.xwad.os.databinding.FragmentEnglishBinding;
|
||||
import com.xwad.os.jxw.AssertUtils;
|
||||
import com.xwad.os.jxw.SPUtils;
|
||||
import com.xwad.os.jxw.TbddProviderUtil;
|
||||
import com.xwad.os.jxw.Util;
|
||||
import com.xwad.os.jxw.util.Util;
|
||||
import com.xwad.os.utils.OpenApkUtils;
|
||||
import com.xwad.os.view.jxw.widget.AppsDialog;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class EnglishFragment extends BaseMvvmFragment<EnglishViewModel, Fragment
|
||||
private static final String type = "yy";
|
||||
|
||||
private Activity mContext;
|
||||
private List<ItemsBean> appList = new ArrayList();
|
||||
private List<ItemsBean> appList = new ArrayList<>();
|
||||
private BaseQuickAdapter<ItemsBean, BaseViewHolder> contentAdapter = new BaseQuickAdapter<ItemsBean, BaseViewHolder>(R.layout.item_yw_app) {
|
||||
@Override
|
||||
public void convert(BaseViewHolder baseViewHolder, final ItemsBean itemsBean) {
|
||||
@@ -124,7 +124,7 @@ public class EnglishFragment extends BaseMvvmFragment<EnglishViewModel, Fragment
|
||||
mViewModel.setCtx(getCtx());
|
||||
mViewModel.setLifecycle(getLifecycleSubject());
|
||||
mViewModel.setVDBinding(mViewDataBinding);
|
||||
// mViewDataBinding.setClick(new BtnClick());
|
||||
mViewDataBinding.setClick(new BtnClick());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -190,7 +190,7 @@ public class EnglishFragment extends BaseMvvmFragment<EnglishViewModel, Fragment
|
||||
private void setTag(View view) {
|
||||
String str;
|
||||
String checkGrade = Util.checkGrade(SPUtils.getGrade());
|
||||
if (checkGrade.equals("小学")) {
|
||||
if ("小学".equals(checkGrade)) {
|
||||
str = "tag_args_new_ztsp_xxyy";
|
||||
} else {
|
||||
str = checkGrade.equals("初中") ? "tag_args_new_ztsp_czyy" : "tag_args_new_ztsp_gzyy";
|
||||
@@ -214,7 +214,6 @@ public class EnglishFragment extends BaseMvvmFragment<EnglishViewModel, Fragment
|
||||
|
||||
private void load() {
|
||||
TbddBookBean tbddData = TbddProviderUtil.getTbddData("英语", "", "");
|
||||
try {
|
||||
if (tbddData != null) {
|
||||
mViewDataBinding.ivZb.setVisibility(View.VISIBLE);
|
||||
Glide.with(mContext).load(tbddData.getCoverUrl()).into(mViewDataBinding.ivCover);
|
||||
@@ -222,8 +221,6 @@ public class EnglishFragment extends BaseMvvmFragment<EnglishViewModel, Fragment
|
||||
mViewDataBinding.ivZb.setVisibility(View.GONE);
|
||||
mViewDataBinding.ivCover.setBackgroundResource(R.drawable.icon_yw_tjsb);
|
||||
}
|
||||
} catch (Exception unused) {
|
||||
}
|
||||
}
|
||||
|
||||
public void getMyList() {
|
||||
@@ -272,7 +269,7 @@ public class EnglishFragment extends BaseMvvmFragment<EnglishViewModel, Fragment
|
||||
contentAdapter.notifyDataSetChanged();
|
||||
// MyApp.getInstance().mBottomBtnOnClickListener.setContext(getActivity());
|
||||
// MyApp.getInstance().mBottomBtnOnClickListener.onClick(obj);
|
||||
OpenApkUtils.getInstance().openJxwApp(obj);
|
||||
OpenApkUtils.getInstance().openJxwApp(mContext, obj);
|
||||
}
|
||||
|
||||
private void saveTag(ItemsBean itemsBean) {
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.xwad.os.bean.jxw.ItemsBean;
|
||||
import com.xwad.os.databinding.FragmentMathBinding;
|
||||
import com.xwad.os.jxw.AssertUtils;
|
||||
import com.xwad.os.jxw.SPUtils;
|
||||
import com.xwad.os.jxw.Util;
|
||||
import com.xwad.os.jxw.util.Util;
|
||||
import com.xwad.os.utils.OpenApkUtils;
|
||||
import com.xwad.os.view.jxw.widget.AppsDialog;
|
||||
|
||||
@@ -185,7 +185,7 @@ public class MathFragment extends BaseMvvmFragment<MathViewModel, FragmentMathBi
|
||||
private void setTag(View view) {
|
||||
String str;
|
||||
String checkGrade = Util.checkGrade(SPUtils.getGrade());
|
||||
if (checkGrade.equals("小学")) {
|
||||
if ("小学".equals(checkGrade)) {
|
||||
str = "tag_args_new_ztsp_xxsx";
|
||||
} else {
|
||||
str = checkGrade.equals("初中") ? "tag_args_new_ztsp_czsx" : "tag_args_new_ztsp_gzsx";
|
||||
@@ -253,7 +253,7 @@ public class MathFragment extends BaseMvvmFragment<MathViewModel, FragmentMathBi
|
||||
contentAdapter.notifyDataSetChanged();
|
||||
// MyApp.getInstance().mBottomBtnOnClickListener.setContext(getActivity());
|
||||
// MyApp.getInstance().mBottomBtnOnClickListener.onClick(obj);
|
||||
OpenApkUtils.getInstance().openJxwApp(obj);
|
||||
OpenApkUtils.getInstance().openJxwApp(mContext, obj);
|
||||
}
|
||||
|
||||
private void saveTag(ItemsBean itemsBean) {
|
||||
|
||||
@@ -18,11 +18,13 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.xwad.os.R;
|
||||
import com.xwad.os.activity.activation.ActivationActivity;
|
||||
import com.xwad.os.activity.home.HomeActivity;
|
||||
import com.xwad.os.activity.user.UserActivity;
|
||||
import com.xwad.os.base.mvvm.fragment.BaseMvvmFragment;
|
||||
import com.xwad.os.bean.jxw.AppInfo;
|
||||
import com.xwad.os.config.CommonConfig;
|
||||
import com.xwad.os.databinding.FragmentMineBinding;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.xwad.os.jxw.SPUtils;
|
||||
import com.xwad.os.jxw.StudyRecordMng;
|
||||
import com.xwad.os.jxw.ToastUtil;
|
||||
import com.xwad.os.jxw.adapter.ZhMenuAdapter;
|
||||
@@ -53,8 +55,8 @@ public class MineFragment extends BaseMvvmFragment<MineViewModel, FragmentMineBi
|
||||
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
private Activity mContext;
|
||||
private ZhMenuAdapter zhMenuAdapter;
|
||||
private List<AppInfo> mlistAppInfo = new ArrayList<>();
|
||||
// private ZhMenuAdapter zhMenuAdapter;
|
||||
// private List<AppInfo> mlistAppInfo = new ArrayList<>();
|
||||
private Handler mHandler = new Handler();
|
||||
public String file_name = "app_list_6.0";
|
||||
|
||||
@@ -111,78 +113,80 @@ public class MineFragment extends BaseMvvmFragment<MineViewModel, FragmentMineBi
|
||||
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||
}
|
||||
|
||||
mViewDataBinding.gridViewId.setLayoutManager(new GridLayoutManager(mContext, 8));
|
||||
zhMenuAdapter = new ZhMenuAdapter(mContext, mlistAppInfo);
|
||||
mViewDataBinding.gridViewId.setAdapter(zhMenuAdapter);
|
||||
// mViewDataBinding.relaRoot.setOnClickListener(new View.OnClickListener() {
|
||||
// mViewDataBinding.gridViewId.setLayoutManager(new GridLayoutManager(mContext, 8));
|
||||
// zhMenuAdapter = new ZhMenuAdapter(mContext, mlistAppInfo);
|
||||
// mViewDataBinding.gridViewId.setAdapter(zhMenuAdapter);
|
||||
//// mViewDataBinding.relaRoot.setOnClickListener(new View.OnClickListener() {
|
||||
//// @Override
|
||||
//// public void onClick(View view) {
|
||||
//// zhMenuAdapter.setToDelete(false);
|
||||
//// }
|
||||
//// });
|
||||
// RecyclerMarginClickHelper.setOnMarginClickListener(mViewDataBinding.gridViewId, new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
// zhMenuAdapter.setToDelete(false);
|
||||
// }
|
||||
// });
|
||||
RecyclerMarginClickHelper.setOnMarginClickListener(mViewDataBinding.gridViewId, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
zhMenuAdapter.setToDelete(false);
|
||||
}
|
||||
});
|
||||
zhMenuAdapter.setOnItemClickListener(new ZhMenuAdapter.RadiaoOnItemClickListener() {
|
||||
@Override
|
||||
public void onSelectClick(int i) {
|
||||
AppInfo appInfo;
|
||||
if (mlistAppInfo == null || mlistAppInfo.size() <= 0 || (appInfo = mlistAppInfo.get(i)) == null) {
|
||||
return;
|
||||
}
|
||||
if (appInfo.appName.equals("切换壁纸")) {
|
||||
QhbzDialog qhbzDialog = new QhbzDialog(mContext);
|
||||
qhbzDialog.show();
|
||||
qhbzDialog.setOnCallback(new QhbzDialog.Callback() {
|
||||
@Override
|
||||
public void onCallback(int i2) {
|
||||
EventBus.getDefault().postSticky(new UpdateColorEvent());
|
||||
}
|
||||
});
|
||||
} else if (!TextUtils.isEmpty(appInfo.getPkgName())) {
|
||||
Log.e(TAG, "onSelectClick: onItemClick 11");
|
||||
startApkByPackName(mContext, appInfo.getPkgName());
|
||||
} else if (TextUtils.isEmpty(appInfo.mStargss)) {
|
||||
// zhMenuAdapter.setOnItemClickListener(new ZhMenuAdapter.RadiaoOnItemClickListener() {
|
||||
// @Override
|
||||
// public void onSelectClick(int i) {
|
||||
// AppInfo appInfo;
|
||||
// if (mlistAppInfo == null || mlistAppInfo.size() <= 0 || (appInfo = mlistAppInfo.get(i)) == null) {
|
||||
// return;
|
||||
// }
|
||||
// if (appInfo.appName.equals("切换壁纸")) {
|
||||
// QhbzDialog qhbzDialog = new QhbzDialog(mContext);
|
||||
// qhbzDialog.show();
|
||||
// qhbzDialog.setOnCallback(new QhbzDialog.Callback() {
|
||||
// @Override
|
||||
// public void onCallback(int i2) {
|
||||
// EventBus.getDefault().postSticky(new UpdateColorEvent());
|
||||
// }
|
||||
// });
|
||||
// } else if (!TextUtils.isEmpty(appInfo.getPkgName())) {
|
||||
// Log.e(TAG, "onSelectClick: onItemClick 11");
|
||||
// startApkByPackName(mContext, appInfo.getPkgName());
|
||||
// } else if (TextUtils.isEmpty(appInfo.mStargss)) {
|
||||
//
|
||||
// } else {
|
||||
// Log.e(TAG, "onItemClick66 " + appInfo.mStargss);
|
||||
//// MyApp.getInstance().mBottomBtnOnClickListener.setContext(mContext);
|
||||
//// MyApp.getInstance().mBottomBtnOnClickListener.onClick(appInfo.mStargss);
|
||||
// OpenApkUtils.getInstance().openJxwApp(appInfo.mStargss);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onDeleteClick(final String str, final int i, String str2) {
|
||||
// RemoveAppDialog removeAppDialog = new RemoveAppDialog(mContext, str2);
|
||||
// removeAppDialog.show();
|
||||
// removeAppDialog.setOnCallback(new RemoveAppDialog.Callback() {
|
||||
// @Override
|
||||
// public void onCallback() {
|
||||
// readContent(str, i);
|
||||
// if (mlistAppInfo != null) {
|
||||
// mlistAppInfo.clear();
|
||||
// }
|
||||
// initAppData();
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// zhMenuAdapter.setOnItemChildLongClickListener(new BaseQuickAdapter.OnItemChildLongClickListener() {
|
||||
// @Override
|
||||
// public boolean onItemChildLongClick(BaseQuickAdapter baseQuickAdapter, View view, int i) {
|
||||
// zhMenuAdapter.setToDelete(true);
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
|
||||
} else {
|
||||
Log.e(TAG, "onItemClick66 " + appInfo.mStargss);
|
||||
// MyApp.getInstance().mBottomBtnOnClickListener.setContext(mContext);
|
||||
// MyApp.getInstance().mBottomBtnOnClickListener.onClick(appInfo.mStargss);
|
||||
OpenApkUtils.getInstance().openJxwApp(appInfo.mStargss);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeleteClick(final String str, final int i, String str2) {
|
||||
RemoveAppDialog removeAppDialog = new RemoveAppDialog(mContext, str2);
|
||||
removeAppDialog.show();
|
||||
removeAppDialog.setOnCallback(new RemoveAppDialog.Callback() {
|
||||
@Override
|
||||
public void onCallback() {
|
||||
readContent(str, i);
|
||||
if (mlistAppInfo != null) {
|
||||
mlistAppInfo.clear();
|
||||
}
|
||||
initAppData();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
zhMenuAdapter.setOnItemChildLongClickListener(new BaseQuickAdapter.OnItemChildLongClickListener() {
|
||||
@Override
|
||||
public boolean onItemChildLongClick(BaseQuickAdapter baseQuickAdapter, View view, int i) {
|
||||
zhMenuAdapter.setToDelete(true);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData(Bundle savedInstanceState) {
|
||||
initAppData();
|
||||
// initAppData();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -193,7 +197,19 @@ public class MineFragment extends BaseMvvmFragment<MineViewModel, FragmentMineBi
|
||||
|
||||
@Override
|
||||
public void fetchData() {
|
||||
initAppData();
|
||||
String nickName = mMMKV.decodeString(CommonConfig.UIUI_USER_NAME_KEY, "");
|
||||
if (TextUtils.isEmpty(nickName)) {
|
||||
mViewDataBinding.tvName.setText(getString(R.string.default_nickname));
|
||||
} else {
|
||||
mViewDataBinding.tvName.setText(nickName);
|
||||
}
|
||||
String sn_grade = mMMKV.decodeString(CommonConfig.UIUI_USER_GRADE_KEY, "");
|
||||
if (TextUtils.isEmpty(sn_grade)) {
|
||||
mViewDataBinding.tvGrade.setText(getString(R.string.default_grade));
|
||||
} else {
|
||||
mViewDataBinding.tvGrade.setText(sn_grade);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -208,63 +224,65 @@ public class MineFragment extends BaseMvvmFragment<MineViewModel, FragmentMineBi
|
||||
|
||||
}
|
||||
|
||||
public void initAppData() {
|
||||
AppInfo build = new AppInfo.Builder().appLabel("课程表").appStargs(getResources().getString(R.string.tag_args_new_kcb)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_kcb)).build();
|
||||
AppInfo build2 = new AppInfo.Builder().appLabel("语音翻译").appStargs(getResources().getString(R.string.tag_args_new_zyhy)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_yyfy)).build();
|
||||
// AppInfo build3 = new AppInfo.Builder().appLabel("使用助手").appStargs(getResources().getString(R.string.tag_args_new_sysmx)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_syzs)).build();
|
||||
AppInfo build4 = new AppInfo.Builder().appLabel("资源更新").appStargs(getResources().getString(R.string.tag_args_updae)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_yygx)).build();
|
||||
AppInfo build5 = new AppInfo.Builder().appLabel("一键加速").appStargs(getResources().getString(R.string.tag_args_new_yjjs)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_yjjs)).build();
|
||||
AppInfo build6 = new AppInfo.Builder().appLabel("下载中心").appStargs(getResources().getString(R.string.tag_args_new_download)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_xzzx)).build();
|
||||
AppInfo build7 = new AppInfo.Builder().appLabel("切换壁纸").appStargs(getResources().getString(R.string.tag_args_launcher)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_qhbz)).build();
|
||||
AppInfo build8 = new AppInfo.Builder().appLabel("回到安卓").appStargs(getResources().getString(R.string.tag_args_launcher)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_azpt)).build();
|
||||
AppInfo build9 = new AppInfo.Builder().appLabel("设置").appStargs(getResources().getString(R.string.tag_args_new_jxwSettings)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_sz)).build();
|
||||
mlistAppInfo.add(build);
|
||||
mlistAppInfo.add(build2);
|
||||
// mlistAppInfo.add(build3);
|
||||
mlistAppInfo.add(build4);
|
||||
mlistAppInfo.add(build5);
|
||||
mlistAppInfo.add(build6);
|
||||
mlistAppInfo.add(build7);
|
||||
mlistAppInfo.add(build8);
|
||||
mlistAppInfo.add(build9);
|
||||
getAppData();
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
zhMenuAdapter.setData(mlistAppInfo);
|
||||
zhMenuAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
// public void initAppData() {
|
||||
// mlistAppInfo.clear();
|
||||
// AppInfo build = new AppInfo.Builder().appLabel("课程表").appStargs(getResources().getString(R.string.tag_args_new_kcb)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_kcb)).build();
|
||||
// AppInfo build2 = new AppInfo.Builder().appLabel("语音翻译").appStargs(getResources().getString(R.string.tag_args_new_zyhy)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_yyfy)).build();
|
||||
//// AppInfo build3 = new AppInfo.Builder().appLabel("使用助手").appStargs(getResources().getString(R.string.tag_args_new_sysmx)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_syzs)).build();
|
||||
// AppInfo build4 = new AppInfo.Builder().appLabel("资源更新").appStargs(getResources().getString(R.string.tag_args_updae)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_yygx)).build();
|
||||
// AppInfo build5 = new AppInfo.Builder().appLabel("一键加速").appStargs(getResources().getString(R.string.tag_args_new_yjjs)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_yjjs)).build();
|
||||
// AppInfo build6 = new AppInfo.Builder().appLabel("下载中心").appStargs(getResources().getString(R.string.tag_args_new_download)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_xzzx)).build();
|
||||
// AppInfo build7 = new AppInfo.Builder().appLabel("切换壁纸").appStargs(getResources().getString(R.string.tag_args_launcher)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_qhbz)).build();
|
||||
// AppInfo build8 = new AppInfo.Builder().appLabel("回到安卓").appStargs(getResources().getString(R.string.tag_args_launcher)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_azpt)).build();
|
||||
// AppInfo build9 = new AppInfo.Builder().appLabel("设置").appStargs(getResources().getString(R.string.tag_args_new_jxwSettings)).appIcon(mContext.getResources().getDrawable(R.drawable.icon_bbx_sz)).build();
|
||||
// mlistAppInfo.add(build);
|
||||
// mlistAppInfo.add(build2);
|
||||
//// mlistAppInfo.add(build3);
|
||||
// mlistAppInfo.add(build4);
|
||||
// mlistAppInfo.add(build5);
|
||||
// mlistAppInfo.add(build6);
|
||||
// mlistAppInfo.add(build7);
|
||||
// mlistAppInfo.add(build8);
|
||||
// mlistAppInfo.add(build9);
|
||||
//// getAppData();
|
||||
// mHandler.post(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// zhMenuAdapter.setData(mlistAppInfo);
|
||||
// zhMenuAdapter.notifyDataSetChanged();
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// }
|
||||
|
||||
private void getAppData() {
|
||||
File fileStreamPath = mContext.getFileStreamPath(file_name);
|
||||
if (!fileStreamPath.exists()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
BufferedReader bufferedReader = new BufferedReader(new FileReader(fileStreamPath));
|
||||
PackageManager packageManager = mContext.getPackageManager();
|
||||
while (true) {
|
||||
String readLine = bufferedReader.readLine();
|
||||
if (readLine != null) {
|
||||
try {
|
||||
ApplicationInfo applicationInfo = packageManager.getApplicationInfo(readLine, PackageManager.GET_META_DATA);
|
||||
mlistAppInfo.add(new AppInfo.Builder().appLabel((String) packageManager.getApplicationLabel(applicationInfo)).pkgName(readLine).appIcon(packageManager.getApplicationIcon(applicationInfo)).build());
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
bufferedReader.close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (FileNotFoundException e2) {
|
||||
e2.printStackTrace();
|
||||
} catch (IOException e3) {
|
||||
e3.printStackTrace();
|
||||
}
|
||||
}
|
||||
// private void getAppData() {
|
||||
// File fileStreamPath = mContext.getFileStreamPath(file_name);
|
||||
// if (!fileStreamPath.exists()) {
|
||||
// return;
|
||||
// }
|
||||
// try {
|
||||
// BufferedReader bufferedReader = new BufferedReader(new FileReader(fileStreamPath));
|
||||
// PackageManager packageManager = mContext.getPackageManager();
|
||||
// while (true) {
|
||||
// String readLine = bufferedReader.readLine();
|
||||
// if (readLine != null) {
|
||||
// try {
|
||||
// ApplicationInfo applicationInfo = packageManager.getApplicationInfo(readLine, PackageManager.GET_META_DATA);
|
||||
// mlistAppInfo.add(new AppInfo.Builder().appLabel((String) packageManager.getApplicationLabel(applicationInfo)).pkgName(readLine).appIcon(packageManager.getApplicationIcon(applicationInfo)).build());
|
||||
// } catch (PackageManager.NameNotFoundException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// } else {
|
||||
// bufferedReader.close();
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// } catch (FileNotFoundException e2) {
|
||||
// e2.printStackTrace();
|
||||
// } catch (IOException e3) {
|
||||
// e3.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
|
||||
void startApkByPackName(Context context, String str) {
|
||||
try {
|
||||
@@ -311,7 +329,18 @@ public class MineFragment extends BaseMvvmFragment<MineViewModel, FragmentMineBi
|
||||
|
||||
public class BtnClick {
|
||||
public void toLigin(View view) {
|
||||
startActivity(new Intent(mContext, ActivationActivity.class));
|
||||
startActivity(new Intent(mContext, UserActivity.class));
|
||||
}
|
||||
|
||||
public void setWallpaper(View view) {
|
||||
QhbzDialog qhbzDialog = new QhbzDialog(mContext);
|
||||
qhbzDialog.show();
|
||||
qhbzDialog.setOnCallback(new QhbzDialog.Callback() {
|
||||
@Override
|
||||
public void onCallback(int i2) {
|
||||
EventBus.getDefault().postSticky(new UpdateColorEvent());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,6 +113,10 @@ public class SafeFragment extends BaseMvvmFragment<SafeViewModel, FragmentSafeBi
|
||||
|
||||
@Override
|
||||
protected void initView(Bundle bundle) {
|
||||
if (!EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
if (getArguments() != null) {
|
||||
mParam1 = getArguments().getString(ARG_PARAM1);
|
||||
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||
@@ -158,7 +162,7 @@ public class SafeFragment extends BaseMvvmFragment<SafeViewModel, FragmentSafeBi
|
||||
Log.e(TAG, "onItemClick66 " + appInfo.mStargss);
|
||||
// MyApp.getInstance().mBottomBtnOnClickListener.setContext(mContext);
|
||||
// MyApp.getInstance().mBottomBtnOnClickListener.onClick(appInfo.mStargss);
|
||||
OpenApkUtils.getInstance().openJxwApp(appInfo.mStargss);
|
||||
OpenApkUtils.getInstance().openJxwApp(mContext, appInfo.mStargss);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,12 +205,6 @@ public class SafeFragment extends BaseMvvmFragment<SafeViewModel, FragmentSafeBi
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fetchData() {
|
||||
if (mlistAppInfo != null) {
|
||||
@@ -216,8 +214,9 @@ public class SafeFragment extends BaseMvvmFragment<SafeViewModel, FragmentSafeBi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user