Initial commit
This commit is contained in:
213
sources/com/ubt/jimu/main/fragment/CommunityFragment.java
Normal file
213
sources/com/ubt/jimu/main/fragment/CommunityFragment.java
Normal file
@@ -0,0 +1,213 @@
|
||||
package com.ubt.jimu.main.fragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.alibaba.android.arouter.facade.Postcard;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.cache.Cache;
|
||||
import com.ubt.jimu.base.entities.CommunityReturnBean;
|
||||
import com.ubt.jimu.base.entities.Constant;
|
||||
import com.ubt.jimu.base.entities.DraftsListBean;
|
||||
import com.ubt.jimu.community.activity.JimuActActivity;
|
||||
import com.ubt.jimu.community.contract.CommunityContract$Presenter;
|
||||
import com.ubt.jimu.community.contract.CommunityContract$View;
|
||||
import com.ubt.jimu.community.presenter.CommunityPresenter;
|
||||
import com.ubt.jimu.community.view.CommunityHomeMoreActivity;
|
||||
import com.ubt.jimu.community.view.MyDraftsActivity;
|
||||
import com.ubt.jimu.community.view.PublishCommunityActivity;
|
||||
import com.ubt.jimu.community.view.PublishDetailActivity;
|
||||
import com.ubt.jimu.community.view.adapter.CommunityListAdapter;
|
||||
import com.ubt.jimu.user.view.LoginActivity;
|
||||
import com.ubt.jimu.utils.LogUtils;
|
||||
import com.ubt.jimu.utils.SPUtils;
|
||||
import com.ubtech.utils.XLog;
|
||||
import com.ubtech.view.fragment.BaseFragment;
|
||||
import com.ubtrobot.ubtlib.analytics.JimuAnalytics;
|
||||
import com.youth.banner.listener.OnBannerListener;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class CommunityFragment extends BaseFragment implements CommunityContract$View, View.OnClickListener, OnBannerListener, CommunityListAdapter.HeadOnClickLisenter, CommunityListAdapter.OnClickItemLisenter, CommunityListAdapter.OnClickMoreListener, CommunityListAdapter.BannerItemOnClickListener {
|
||||
private CommunityListAdapter a;
|
||||
private CommunityContract$Presenter b;
|
||||
private Unbinder c;
|
||||
ImageView mIvInspire;
|
||||
RecyclerView mRvCommunity;
|
||||
|
||||
private void a(RecyclerView recyclerView) {
|
||||
this.a.a(LayoutInflater.from(getContext()).inflate(R.layout.comm_foot, (ViewGroup) recyclerView, false));
|
||||
}
|
||||
|
||||
public static CommunityFragment o() {
|
||||
return new CommunityFragment();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.view.adapter.CommunityListAdapter.HeadOnClickLisenter
|
||||
public void L() {
|
||||
ARouter.b().a("/community/favorite").t();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.view.adapter.CommunityListAdapter.HeadOnClickLisenter
|
||||
public void N() {
|
||||
ARouter.b().a("/community/inspire").t();
|
||||
}
|
||||
|
||||
@Override // com.youth.banner.listener.OnBannerListener
|
||||
public void OnBannerClick(int i) {
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.view.adapter.CommunityListAdapter.HeadOnClickLisenter
|
||||
public void P() {
|
||||
ARouter.b().a("/community/hot").t();
|
||||
}
|
||||
|
||||
protected void b() {
|
||||
this.a.a((CommunityListAdapter.HeadOnClickLisenter) this);
|
||||
this.a.a((CommunityListAdapter.OnClickItemLisenter) this);
|
||||
this.a.a((CommunityListAdapter.OnClickMoreListener) this);
|
||||
this.a.a((CommunityListAdapter.BannerItemOnClickListener) this);
|
||||
this.mIvInspire.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.contract.CommunityContract$View
|
||||
public void c() {
|
||||
}
|
||||
|
||||
protected void initData() {
|
||||
this.a = new CommunityListAdapter(getContext());
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
||||
linearLayoutManager.k(1);
|
||||
this.mRvCommunity.setLayoutManager(linearLayoutManager);
|
||||
new CommunityPresenter(getContext(), this);
|
||||
this.b.e();
|
||||
this.mRvCommunity.setAdapter(this.a);
|
||||
a(this.mRvCommunity);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.contract.CommunityContract$View
|
||||
public void j() {
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onActivityCreated(Bundle bundle) {
|
||||
super.onActivityCreated(bundle);
|
||||
initData();
|
||||
b();
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
if (view.getId() != R.id.im_inspire_publish) {
|
||||
return;
|
||||
}
|
||||
String userId = Cache.getInstance().getUserId();
|
||||
DraftsListBean draftsListBean = (DraftsListBean) SPUtils.b(Constant.Publish.DRAFTS, Constant.Publish.DRAFTS_KEY + Cache.getInstance().getUserId());
|
||||
startActivity((TextUtils.isEmpty(userId) || "local".equals(userId)) ? new Intent(getContext(), (Class<?>) LoginActivity.class) : (draftsListBean == null || draftsListBean.getLinkedHashMap().size() == 0) ? new Intent(getContext(), (Class<?>) PublishCommunityActivity.class) : new Intent(getContext(), (Class<?>) MyDraftsActivity.class));
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
View inflate = layoutInflater.inflate(R.layout.activity_community_home, (ViewGroup) null);
|
||||
this.c = ButterKnife.a(this, inflate);
|
||||
return inflate;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroyView() {
|
||||
this.c.unbind();
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment
|
||||
protected void onPagePause() {
|
||||
super.onPagePause();
|
||||
JimuAnalytics.b().b(getActivity(), "P4");
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment
|
||||
protected void onPageResume() {
|
||||
super.onPageResume();
|
||||
JimuAnalytics.b().a(getActivity(), "P4");
|
||||
CommunityContract$Presenter communityContract$Presenter = this.b;
|
||||
if (communityContract$Presenter != null) {
|
||||
communityContract$Presenter.e();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.BaseView
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void setPresenter(CommunityContract$Presenter communityContract$Presenter) {
|
||||
this.b = communityContract$Presenter;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.contract.CommunityContract$View
|
||||
public void a(CommunityReturnBean communityReturnBean) {
|
||||
CommunityListAdapter communityListAdapter;
|
||||
if (communityReturnBean == null || (communityListAdapter = this.a) == null || this.mRvCommunity == null) {
|
||||
return;
|
||||
}
|
||||
communityListAdapter.a(communityReturnBean);
|
||||
this.mRvCommunity.setAdapter(this.a);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.view.adapter.CommunityListAdapter.OnClickItemLisenter
|
||||
public void b(int i) {
|
||||
PublishDetailActivity.start(getContext(), i);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.view.adapter.CommunityListAdapter.OnClickMoreListener
|
||||
public void a(ArrayList<CommunityReturnBean.SectionsBean.ContentsBean> arrayList, String str) {
|
||||
LogUtils.c("position:" + arrayList.size());
|
||||
CommunityHomeMoreActivity.a(getContext(), arrayList, str);
|
||||
}
|
||||
|
||||
public void b(CommunityReturnBean.ScrollbarBean scrollbarBean) {
|
||||
String sourceType = scrollbarBean.getSourceType();
|
||||
if (sourceType == null) {
|
||||
XLog.b(this.TAG, "Banner type is null!");
|
||||
return;
|
||||
}
|
||||
char c = 65535;
|
||||
int hashCode = sourceType.hashCode();
|
||||
if (hashCode != -1655966961) {
|
||||
if (hashCode != 3321850) {
|
||||
if (hashCode == 3446944 && sourceType.equals("post")) {
|
||||
c = 1;
|
||||
}
|
||||
} else if (sourceType.equals(Constant.Community.SOURCE_LINK_TYPE)) {
|
||||
c = 0;
|
||||
}
|
||||
} else if (sourceType.equals("activity")) {
|
||||
c = 2;
|
||||
}
|
||||
if (c == 0) {
|
||||
Postcard a = ARouter.b().a("/page/web");
|
||||
a.a("title", scrollbarBean.getName());
|
||||
a.a("url", scrollbarBean.getLink());
|
||||
a.t();
|
||||
return;
|
||||
}
|
||||
if (c == 1) {
|
||||
PublishDetailActivity.start(getContext(), scrollbarBean.getSourceId());
|
||||
} else if (c != 2) {
|
||||
XLog.b(this.TAG, "Unknown source type!");
|
||||
} else {
|
||||
JimuActActivity.start(getContext(), scrollbarBean.getSourceId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.view.adapter.CommunityListAdapter.BannerItemOnClickListener
|
||||
public void a(CommunityReturnBean.ScrollbarBean scrollbarBean) {
|
||||
b(scrollbarBean);
|
||||
}
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
package com.ubt.jimu.main.fragment;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.Unbinder;
|
||||
import butterknife.internal.Utils;
|
||||
import com.ubt.jimu.R;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class CommunityFragment_ViewBinding implements Unbinder {
|
||||
private CommunityFragment b;
|
||||
|
||||
public CommunityFragment_ViewBinding(CommunityFragment communityFragment, View view) {
|
||||
this.b = communityFragment;
|
||||
communityFragment.mIvInspire = (ImageView) Utils.b(view, R.id.im_inspire_publish, "field 'mIvInspire'", ImageView.class);
|
||||
communityFragment.mRvCommunity = (RecyclerView) Utils.b(view, R.id.rlv_community_home, "field 'mRvCommunity'", RecyclerView.class);
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
CommunityFragment communityFragment = this.b;
|
||||
if (communityFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.b = null;
|
||||
communityFragment.mIvInspire = null;
|
||||
communityFragment.mRvCommunity = null;
|
||||
}
|
||||
}
|
189
sources/com/ubt/jimu/main/fragment/DiyFragment.java
Normal file
189
sources/com/ubt/jimu/main/fragment/DiyFragment.java
Normal file
@@ -0,0 +1,189 @@
|
||||
package com.ubt.jimu.main.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import com.alibaba.android.arouter.facade.Postcard;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.recyclelib.URecyclerView;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.entities.Constant;
|
||||
import com.ubt.jimu.diy.contract.OfficialDiyContract;
|
||||
import com.ubt.jimu.diy.model.DiyModel;
|
||||
import com.ubt.jimu.diy.presenter.OfficialDiyPresenter;
|
||||
import com.ubt.jimu.diy.view.adapter.OfficialDiyAdapter;
|
||||
import com.ubt.jimu.utils.SPUtils;
|
||||
import com.ubt.jimu.utils.smartScaleTool.ScreenUtils;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
import com.ubt.jimu.widgets.SpaceGridItemDecoration;
|
||||
import com.ubtech.utils.DisplayUtil;
|
||||
import com.ubtech.utils.XLog;
|
||||
import com.ubtech.view.fragment.BaseFragment;
|
||||
import com.ubtrobot.log.ALog;
|
||||
import com.ubtrobot.ubtlib.analytics.JimuAnalytics;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyFragment extends BaseFragment implements OfficialDiyContract.View, OfficialDiyAdapter.OnOfficialDiyItemClickListener, URecyclerView.LoadingListener {
|
||||
private ImageView a;
|
||||
private LoadingView b;
|
||||
private URecyclerView c;
|
||||
private OfficialDiyAdapter e;
|
||||
private OfficialDiyContract.Presenter f;
|
||||
private List<DiyModel> d = new ArrayList();
|
||||
private int g = 1;
|
||||
|
||||
private void initData() {
|
||||
this.f.queryOfficialDiy(false, this.g, 20);
|
||||
}
|
||||
|
||||
private void initView(View view) {
|
||||
this.a = (ImageView) view.findViewById(R.id.iv_create);
|
||||
this.a.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.main.fragment.DiyFragment.1
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view2) {
|
||||
SPUtils.b(Constant.Black.BLACK_MODEL_TYPE_KEY, 1);
|
||||
DiyFragment.this.q();
|
||||
JimuAnalytics.b().a("click_P5_1");
|
||||
}
|
||||
});
|
||||
this.b = (LoadingView) view.findViewById(R.id.official_diy_loading);
|
||||
this.b.setOnRetryListener(new LoadingView.RetryRequest() { // from class: com.ubt.jimu.main.fragment.DiyFragment.2
|
||||
@Override // com.ubt.jimu.widgets.LoadingView.RetryRequest
|
||||
public void OnRetryListener() {
|
||||
if (DiyFragment.this.f != null) {
|
||||
DiyFragment.this.f.queryOfficialDiy(false, 1, 20);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.c = (URecyclerView) view.findViewById(R.id.official_diy_recycleView);
|
||||
}
|
||||
|
||||
public static DiyFragment o() {
|
||||
return new DiyFragment();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void q() {
|
||||
ARouter.b().a("/diy/usercreatives").t();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.contract.OfficialDiyContract.View
|
||||
public void loadCompleted() {
|
||||
this.c.y();
|
||||
this.c.z();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.contract.OfficialDiyContract.View
|
||||
public void loadError() {
|
||||
this.d.clear();
|
||||
this.e.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onActivityCreated(Bundle bundle) {
|
||||
super.onActivityCreated(bundle);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
View inflate = layoutInflater.inflate(R.layout.frag_diy_tab, (ViewGroup) null);
|
||||
initView(inflate);
|
||||
this.f = new OfficialDiyPresenter(getContext(), this, this.b);
|
||||
this.c.post(new Runnable() { // from class: com.ubt.jimu.main.fragment.a
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
DiyFragment.this.b();
|
||||
}
|
||||
});
|
||||
return inflate;
|
||||
}
|
||||
|
||||
@Override // com.recyclelib.URecyclerView.LoadingListener
|
||||
public void onLoadingMore() {
|
||||
a(this.g, 20);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.adapter.OfficialDiyAdapter.OnOfficialDiyItemClickListener
|
||||
public void onOfficialDiyItemClick(DiyModel diyModel, int i) {
|
||||
XLog.b("DiyFragment", "onOfficialDiyItemClick position: " + i + " robot: " + diyModel);
|
||||
Postcard a = ARouter.b().a("/diy/detail");
|
||||
a.a("modelId", diyModel.getId().longValue());
|
||||
a.a("customModelId", diyModel.getCustomModelId());
|
||||
a.t();
|
||||
String str = "click_P5_2_" + String.valueOf(i + 1);
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("model_id", String.valueOf(diyModel.getId()));
|
||||
ALog.a(this.TAG).d("onOfficialDiyItemClick model_id:" + diyModel.getId());
|
||||
JimuAnalytics.b().a(str, hashMap);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment
|
||||
protected void onPagePause() {
|
||||
super.onPagePause();
|
||||
JimuAnalytics.b().b(getActivity(), "P5");
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment
|
||||
protected void onPageResume() {
|
||||
super.onPageResume();
|
||||
JimuAnalytics.b().a(getActivity(), "P5");
|
||||
}
|
||||
|
||||
@Override // com.recyclelib.URecyclerView.LoadingListener
|
||||
public void onRefreshing() {
|
||||
a(1, 20);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
SPUtils.b(Constant.Black.BLACK_MODEL_TYPE_KEY, 0);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.contract.OfficialDiyContract.View
|
||||
public void showOfficialDiy(List<DiyModel> list, int i) {
|
||||
if (list == null || list.size() == 0) {
|
||||
return;
|
||||
}
|
||||
this.g = i + 1;
|
||||
if (i == 1) {
|
||||
this.d.clear();
|
||||
this.d.addAll(list);
|
||||
} else {
|
||||
this.d.addAll(list);
|
||||
}
|
||||
this.e.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void a(int i, int i2) {
|
||||
OfficialDiyContract.Presenter presenter = this.f;
|
||||
if (presenter != null) {
|
||||
presenter.queryOfficialDiy(true, i, i2);
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ void b() {
|
||||
Activity activity = this.mActivity;
|
||||
if (activity == null) {
|
||||
return;
|
||||
}
|
||||
int[] a = ScreenUtils.a(0.6666667f, this.c, activity.getResources().getDimension(R.dimen.diy_list_left), 3);
|
||||
this.e = new OfficialDiyAdapter(this.mActivity, this.d, a[1], a[0]);
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager((Context) this.mActivity, 3, 1, false);
|
||||
this.e.setListener(this);
|
||||
this.c.setLayoutManager(gridLayoutManager);
|
||||
this.c.setAdapter(this.e);
|
||||
Activity activity2 = this.mActivity;
|
||||
this.c.a(new SpaceGridItemDecoration(DisplayUtil.a(activity2, activity2.getResources().getDimension(R.dimen.diy_item_space)), 0, 3, true));
|
||||
this.c.setLoadingListener(this);
|
||||
initData();
|
||||
}
|
||||
}
|
149
sources/com/ubt/jimu/main/fragment/HomeFragment.java
Normal file
149
sources/com/ubt/jimu/main/fragment/HomeFragment.java
Normal file
@@ -0,0 +1,149 @@
|
||||
package com.ubt.jimu.main.fragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import com.alibaba.android.arouter.facade.Postcard;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.ubt.jimu.JimuApplication;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.cache.Cache;
|
||||
import com.ubt.jimu.base.entities.Constant;
|
||||
import com.ubt.jimu.base.entities.Robot;
|
||||
import com.ubt.jimu.main.utils.CardActionUtils;
|
||||
import com.ubt.jimu.main.widget.CardLayout;
|
||||
import com.ubt.jimu.utils.SPUtils;
|
||||
import com.ubtech.utils.XLog;
|
||||
import com.ubtech.view.fragment.BaseFragment;
|
||||
import com.ubtrobot.jimu.robotapi.JimuManager;
|
||||
import com.ubtrobot.ubtlib.analytics.JimuAnalytics;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class HomeFragment extends BaseFragment {
|
||||
private FrameLayout a;
|
||||
private CardLayout b;
|
||||
private CardLayout.OnItemClickListener c = new CardLayout.OnItemClickListener() { // from class: com.ubt.jimu.main.fragment.b
|
||||
@Override // com.ubt.jimu.main.widget.CardLayout.OnItemClickListener
|
||||
public final void onClick(View view) {
|
||||
HomeFragment.this.a(view);
|
||||
}
|
||||
};
|
||||
|
||||
public static HomeFragment b() {
|
||||
return new HomeFragment();
|
||||
}
|
||||
|
||||
private void o() {
|
||||
recordEvent("click_P1_4");
|
||||
CardActionUtils.a(getActivity(), 2);
|
||||
}
|
||||
|
||||
private void q() {
|
||||
recordEvent("click_P1_2");
|
||||
CardActionUtils.a(getActivity(), 1);
|
||||
}
|
||||
|
||||
private void v() {
|
||||
recordEvent("click_P1_5");
|
||||
CardActionUtils.a(getActivity(), 3);
|
||||
}
|
||||
|
||||
private void x() {
|
||||
recordEvent("click_P1_3");
|
||||
Robot robot = Cache.getInstance().getRobot();
|
||||
if (robot == null) {
|
||||
CardActionUtils.b(getActivity(), 8);
|
||||
return;
|
||||
}
|
||||
if (robot.isAllDownloaded()) {
|
||||
Postcard a = ARouter.b().a("/controller/control");
|
||||
a.a("robotLite", robot.getRobotLite());
|
||||
a.t();
|
||||
} else {
|
||||
Postcard a2 = ARouter.b().a("/robot/download");
|
||||
a2.a(Constant.SelectRobot.DOWNLAOD_ROBOT_DATA_KEY, robot);
|
||||
a2.a(Constant.Base.ACTIVITY_START_PACKAGE, Cache.getInstance().getPackageId());
|
||||
a2.a(Constant.SelectRobot.PACKAGE_NAME_KEY, Cache.getInstance().getPackageName());
|
||||
a2.a(getActivity(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ void a(View view) {
|
||||
int id = view.getId();
|
||||
JimuManager f = JimuApplication.l().f();
|
||||
if (f.g()) {
|
||||
String e = f.e();
|
||||
Robot robot = Cache.getInstance().getRobot();
|
||||
if (robot != null && robot.getModelName() != null && !robot.getModelName().equals(e)) {
|
||||
XLog.c(this.TAG, "Connected robot is not selected offical model, disconnect");
|
||||
f.c();
|
||||
}
|
||||
}
|
||||
if (id == R.id.card_build) {
|
||||
SPUtils.b(Constant.Black.BLACK_MODEL_TYPE_KEY, 0);
|
||||
q();
|
||||
return;
|
||||
}
|
||||
if (id == R.id.card_control) {
|
||||
x();
|
||||
return;
|
||||
}
|
||||
if (id == R.id.card_action) {
|
||||
SPUtils.b(Constant.Black.BLACK_MODEL_TYPE_KEY, 0);
|
||||
o();
|
||||
} else if (id == R.id.card_code) {
|
||||
SPUtils.b(Constant.Black.BLACK_MODEL_TYPE_KEY, 0);
|
||||
v();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onActivityCreated(Bundle bundle) {
|
||||
super.onActivityCreated(bundle);
|
||||
this.b = (CardLayout) getView().findViewById(R.id.card_layout);
|
||||
this.b.setListener(this.c);
|
||||
this.a = (FrameLayout) getView().findViewById(R.id.robot_switch);
|
||||
this.a.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.main.fragment.c
|
||||
@Override // android.view.View.OnClickListener
|
||||
public final void onClick(View view) {
|
||||
HomeFragment.this.b(view);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onActivityResult(int i, int i2, Intent intent) {
|
||||
Robot robot;
|
||||
super.onActivityResult(i, i2, intent);
|
||||
if (i2 == 8 && i == 1 && (robot = Cache.getInstance().getRobot()) != null) {
|
||||
Postcard a = ARouter.b().a("/controller/control");
|
||||
a.a("robotLite", robot.getRobotLite());
|
||||
a.t();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
return layoutInflater.inflate(R.layout.frag_home_tab, (ViewGroup) null);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment
|
||||
protected void onPagePause() {
|
||||
super.onPagePause();
|
||||
JimuAnalytics.b().b(getActivity(), "P1");
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment
|
||||
protected void onPageResume() {
|
||||
super.onPageResume();
|
||||
JimuAnalytics.b().a(getActivity(), "P1");
|
||||
}
|
||||
|
||||
public /* synthetic */ void b(View view) {
|
||||
recordEvent("click_P1_8");
|
||||
CardActionUtils.b(getActivity(), 5);
|
||||
}
|
||||
}
|
487
sources/com/ubt/jimu/main/fragment/TrainingFragment.java
Normal file
487
sources/com/ubt/jimu/main/fragment/TrainingFragment.java
Normal file
@@ -0,0 +1,487 @@
|
||||
package com.ubt.jimu.main.fragment;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import com.alibaba.android.arouter.facade.Postcard;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.ubt.jimu.JimuApplication;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.cache.Cache;
|
||||
import com.ubt.jimu.base.dialog.JimuSimpleDialog;
|
||||
import com.ubt.jimu.base.dialog.LoadingDialog;
|
||||
import com.ubt.jimu.base.download.DownloadTask;
|
||||
import com.ubt.jimu.base.entities.Constant;
|
||||
import com.ubt.jimu.base.entities.Package;
|
||||
import com.ubt.jimu.base.entities.Robot;
|
||||
import com.ubt.jimu.base.entities.Story;
|
||||
import com.ubt.jimu.course.contract.CourseListContract;
|
||||
import com.ubt.jimu.course.presenter.CourseListPresenter;
|
||||
import com.ubt.jimu.course.repository.JimuCourse;
|
||||
import com.ubt.jimu.course.view.JimuTaskListActivity;
|
||||
import com.ubt.jimu.discover.view.CourseListActivity;
|
||||
import com.ubt.jimu.main.utils.CardActionUtils;
|
||||
import com.ubt.jimu.main.widget.CardLayout;
|
||||
import com.ubt.jimu.pack.view.DownloadRobotActivity;
|
||||
import com.ubt.jimu.pack.view.PackSelectActivity;
|
||||
import com.ubt.jimu.unity.bluetooth.ConnectionStatus;
|
||||
import com.ubt.jimu.utils.DeviceUtils;
|
||||
import com.ubt.jimu.utils.SPUtils;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
import com.ubtech.utils.DisplayUtil;
|
||||
import com.ubtech.utils.XLog;
|
||||
import com.ubtech.view.dialog.BigDialog$Builder;
|
||||
import com.ubtech.view.dialog.SimpleDialog;
|
||||
import com.ubtech.view.fragment.BaseFragment;
|
||||
import com.ubtech.view.widget.ToastView;
|
||||
import com.ubtrobot.jimu.robotapi.JimuManager;
|
||||
import com.ubtrobot.ubtlib.analytics.JimuAnalytics;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class TrainingFragment extends BaseFragment implements CourseListContract.View, LoadingView.RetryRequest {
|
||||
private FrameLayout a;
|
||||
private CardLayout b;
|
||||
private LoadingView c;
|
||||
private CourseListContract.Presenter d;
|
||||
private Dialog f;
|
||||
private boolean g;
|
||||
private DownloadTask i;
|
||||
private LoadingDialog j;
|
||||
private List<JimuCourse> e = new ArrayList();
|
||||
private CardLayout.OnItemClickListener h = new CardLayout.OnItemClickListener() { // from class: com.ubt.jimu.main.fragment.g
|
||||
@Override // com.ubt.jimu.main.widget.CardLayout.OnItemClickListener
|
||||
public final void onClick(View view) {
|
||||
TrainingFragment.this.b(view);
|
||||
}
|
||||
};
|
||||
|
||||
private boolean A() {
|
||||
return Cache.getInstance().getRobot() != null;
|
||||
}
|
||||
|
||||
private void B() {
|
||||
JimuSimpleDialog.showWifiOnlyDialog(getActivity(), new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.main.fragment.f
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public final void onClick(DialogInterface dialogInterface, int i) {
|
||||
TrainingFragment.c(dialogInterface, i);
|
||||
}
|
||||
}, new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.main.fragment.e
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public final void onClick(DialogInterface dialogInterface, int i) {
|
||||
TrainingFragment.this.a(dialogInterface, i);
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
private void C() {
|
||||
if (v()) {
|
||||
if (!A()) {
|
||||
CardActionUtils.b(getActivity(), 5);
|
||||
return;
|
||||
}
|
||||
Robot robot = Cache.getInstance().getRobot();
|
||||
if (robot != null) {
|
||||
if (!robot.getHasMission()) {
|
||||
D();
|
||||
return;
|
||||
} else if (!robot.isAllDownloaded()) {
|
||||
DownloadRobotActivity.a(getContext(), Cache.getInstance().getRobot(), Cache.getInstance().getPackageName(), Cache.getInstance().getPackageId(), 7);
|
||||
return;
|
||||
}
|
||||
}
|
||||
OnRetryListener();
|
||||
}
|
||||
}
|
||||
|
||||
private void D() {
|
||||
this.g = true;
|
||||
getActivity().getWindow().getDecorView().getRootView();
|
||||
int a = DisplayUtil.a(getContext(), R.dimen.dp120);
|
||||
int a2 = DisplayUtil.a(getContext(), R.dimen.dp120);
|
||||
BigDialog$Builder bigDialog$Builder = new BigDialog$Builder(getActivity());
|
||||
bigDialog$Builder.a(R.string.setting_cancel);
|
||||
bigDialog$Builder.a(new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.main.fragment.TrainingFragment.2
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
TrainingFragment.this.b();
|
||||
dialogInterface.dismiss();
|
||||
}
|
||||
});
|
||||
bigDialog$Builder.d(R.string.switch_robot);
|
||||
bigDialog$Builder.b(new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.main.fragment.TrainingFragment.1
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
TrainingFragment.this.o();
|
||||
dialogInterface.dismiss();
|
||||
}
|
||||
});
|
||||
bigDialog$Builder.b(R.string.course_popu_content);
|
||||
bigDialog$Builder.a(Cache.getInstance().getRobot().getFilePath(), a, a2);
|
||||
this.f = bigDialog$Builder.a();
|
||||
this.f.show();
|
||||
}
|
||||
|
||||
static /* synthetic */ void b(DialogInterface dialogInterface, int i) {
|
||||
}
|
||||
|
||||
static /* synthetic */ void c(DialogInterface dialogInterface, int i) {
|
||||
}
|
||||
|
||||
private void hideLoading() {
|
||||
LoadingDialog loadingDialog = this.j;
|
||||
if (loadingDialog != null) {
|
||||
if (loadingDialog.isShowing()) {
|
||||
this.j.dismiss();
|
||||
}
|
||||
this.j = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
this.b = (CardLayout) getView().findViewById(R.id.card_layout);
|
||||
this.b.setListener(this.h);
|
||||
this.a = (FrameLayout) getView().findViewById(R.id.robot_switch);
|
||||
this.a.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.main.fragment.h
|
||||
@Override // android.view.View.OnClickListener
|
||||
public final void onClick(View view) {
|
||||
TrainingFragment.this.a(view);
|
||||
}
|
||||
});
|
||||
this.c = (LoadingView) getView().findViewById(R.id.loadingView);
|
||||
this.c.setOnRetryListener(this);
|
||||
}
|
||||
|
||||
public static TrainingFragment q() {
|
||||
return new TrainingFragment();
|
||||
}
|
||||
|
||||
private void showLoading(String str) {
|
||||
LoadingDialog loadingDialog = this.j;
|
||||
if (loadingDialog != null) {
|
||||
loadingDialog.dismiss();
|
||||
}
|
||||
this.j = new LoadingDialog(getActivity());
|
||||
this.j.updateProgress(str);
|
||||
this.j.show();
|
||||
}
|
||||
|
||||
private void updateProgress(int i) {
|
||||
LoadingDialog loadingDialog = this.j;
|
||||
if (loadingDialog != null) {
|
||||
loadingDialog.updateProgress(i + "%");
|
||||
}
|
||||
}
|
||||
|
||||
private boolean v() {
|
||||
if (y()) {
|
||||
return true;
|
||||
}
|
||||
this.g = false;
|
||||
this.f = new SimpleDialog.Builder(getContext()).a(R.string.i_got_it).a(new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.main.fragment.TrainingFragment.4
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
TrainingFragment.this.b();
|
||||
dialogInterface.dismiss();
|
||||
}
|
||||
}).d(R.string.now_login).b(new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.main.fragment.TrainingFragment.3
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
TrainingFragment.this.o();
|
||||
dialogInterface.dismiss();
|
||||
}
|
||||
}).b(R.string.course_login_hint).a();
|
||||
this.f.show();
|
||||
return false;
|
||||
}
|
||||
|
||||
private void x() {
|
||||
this.d = new CourseListPresenter(this, this.c);
|
||||
}
|
||||
|
||||
private boolean y() {
|
||||
String userId = Cache.getInstance().getUserId();
|
||||
return !(TextUtils.isEmpty(userId) || "local".equals(userId)) || SPUtils.a(Constant.Course.ONCLICK_IGETIT_KEY);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.LoadingView.RetryRequest
|
||||
public void OnRetryListener() {
|
||||
if (A()) {
|
||||
String a = DeviceUtils.a(getContext());
|
||||
long loginUserIntId = Cache.getInstance().getLoginUserIntId();
|
||||
this.d.getCourse("level", 1 > loginUserIntId ? "" : String.valueOf(loginUserIntId), a, Cache.getInstance().getPackageId(), Cache.getInstance().getRobot().getModelId());
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ void a(View view) {
|
||||
recordEvent("click_P1_8");
|
||||
CardActionUtils.b(getActivity(), 5);
|
||||
}
|
||||
|
||||
public /* synthetic */ void b(View view) {
|
||||
JimuManager f = JimuApplication.l().f();
|
||||
if (f.g()) {
|
||||
String e = f.e();
|
||||
Robot robot = Cache.getInstance().getRobot();
|
||||
if (robot != null && robot.getModelName() != null && !robot.getModelName().equals(e)) {
|
||||
XLog.c("TrainingFragment", "Connected robot is not selected offical model, disconnect");
|
||||
f.c();
|
||||
}
|
||||
}
|
||||
int id = view.getId();
|
||||
if (id == R.id.lessons) {
|
||||
SPUtils.b(Constant.Black.BLACK_MODEL_TYPE_KEY, 0);
|
||||
C();
|
||||
recordEvent("click_P3_1");
|
||||
} else if (id == R.id.adventure) {
|
||||
SPUtils.b(Constant.Black.BLACK_MODEL_TYPE_KEY, 0);
|
||||
long packageId = Cache.getInstance().getPackageId();
|
||||
if (TextUtils.isEmpty(Cache.getInstance().getPackageName())) {
|
||||
PackSelectActivity.a(getActivity(), 10, packageId);
|
||||
} else {
|
||||
this.d.getExpeditionPack();
|
||||
}
|
||||
recordEvent("click_P3_2");
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void downloadCourseFailed(JimuCourse jimuCourse) {
|
||||
hideLoading();
|
||||
if (getContext() == null) {
|
||||
return;
|
||||
}
|
||||
ToastView.a(getContext(), getString(R.string.tips_download_failed), ToastView.Type.ERROR).a();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void downloadCourseProgress(int i, int i2, int i3) {
|
||||
updateProgress(i3);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void downloadCourseStart() {
|
||||
showLoading(getString(R.string.loading_text));
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void downloadCourseSuccess(JimuCourse jimuCourse) {
|
||||
hideLoading();
|
||||
if (getContext() != null) {
|
||||
JimuTaskListActivity.start(getContext(), Cache.getInstance().getPackageId(), Cache.getInstance().getRobot().getModelId(), jimuCourse.getId());
|
||||
}
|
||||
Cache.getInstance().setJimuCourse(jimuCourse);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void expeditionListFail() {
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void expeditionListStart() {
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void expeditionListSuccess(List<Package> list) {
|
||||
String packageName = Cache.getInstance().getPackageName();
|
||||
long packageId = Cache.getInstance().getPackageId();
|
||||
if (list != null && list.size() > 0) {
|
||||
Iterator<Package> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
String packageName2 = it.next().getPackageName();
|
||||
if (!TextUtils.isEmpty(packageName2) && packageName2.equals(packageName)) {
|
||||
B();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
PackSelectActivity.a(getActivity(), 10, packageId);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void loadArListFail() {
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void loadArListStart() {
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void loadArListSuccess(List<Package> list) {
|
||||
String packageName = Cache.getInstance().getPackageName();
|
||||
long packageId = Cache.getInstance().getPackageId();
|
||||
if (list != null && list.size() > 0) {
|
||||
for (Package r3 : list) {
|
||||
String packageName2 = r3.getPackageName();
|
||||
if (!TextUtils.isEmpty(packageName2) && packageName2.equals(packageName)) {
|
||||
Postcard a = ARouter.b().a("/game/list");
|
||||
a.a("PACKAGE", r3);
|
||||
a.t();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
PackSelectActivity.a(getActivity(), 11, packageId);
|
||||
}
|
||||
|
||||
public void o() {
|
||||
SPUtils.a(Constant.Course.ONCLICK_IGETIT_KEY, true);
|
||||
if (this.g) {
|
||||
CardActionUtils.b(getActivity(), 7);
|
||||
} else {
|
||||
ARouter.b().a("/account/login").t();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onActivityCreated(Bundle bundle) {
|
||||
super.onActivityCreated(bundle);
|
||||
initView();
|
||||
x();
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment
|
||||
public boolean onBackPressed() {
|
||||
Dialog dialog = this.f;
|
||||
if (dialog == null || !dialog.isShowing()) {
|
||||
return super.onBackPressed();
|
||||
}
|
||||
this.f.dismiss();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void onConnectionStatusChange(ConnectionStatus connectionStatus) {
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
return layoutInflater.inflate(R.layout.frag_training_tab, (ViewGroup) null);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
CourseListContract.Presenter presenter = this.d;
|
||||
if (presenter != null) {
|
||||
presenter.unSubscribe();
|
||||
}
|
||||
Cache.getInstance().setJimuCourse(null);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void onDownloadFail() {
|
||||
hideLoading();
|
||||
this.i = null;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void onDownloadStart() {
|
||||
showLoading("");
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void onDownloadSuccess(Story story) {
|
||||
hideLoading();
|
||||
this.i = null;
|
||||
if (getContext() == null) {
|
||||
return;
|
||||
}
|
||||
Package r0 = new Package();
|
||||
r0.setPackageName(Cache.getInstance().getPackageName());
|
||||
r0.setPackageImage(Cache.getInstance().getPackageImagePath());
|
||||
r0.setId(Cache.getInstance().getPackageId());
|
||||
CourseListActivity.a(getContext(), "AstroBot", story.getStoryIntroVideo(), r0);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment
|
||||
protected void onPagePause() {
|
||||
super.onPagePause();
|
||||
JimuAnalytics.b().b(getActivity(), "P3");
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment
|
||||
protected void onPageResume() {
|
||||
super.onPageResume();
|
||||
JimuAnalytics.b().a(getActivity(), "P3");
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onPause() {
|
||||
this.d.cancelDownloadResource();
|
||||
DownloadTask downloadTask = this.i;
|
||||
if (downloadTask != null) {
|
||||
downloadTask.pause();
|
||||
}
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void onProgressChange(int i) {
|
||||
updateProgress(i);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void showCourseList(List<JimuCourse> list) {
|
||||
if (list == null || list.size() == 0) {
|
||||
return;
|
||||
}
|
||||
this.e.addAll(list);
|
||||
a(this.e.get(0));
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void showCurrentTask(DownloadTask downloadTask) {
|
||||
this.i = downloadTask;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.course.contract.CourseListContract.View
|
||||
public void showException(Throwable th) {
|
||||
}
|
||||
|
||||
public /* synthetic */ void a(DialogInterface dialogInterface, int i) {
|
||||
this.d.downloadStory();
|
||||
}
|
||||
|
||||
private void a(final JimuCourse jimuCourse) {
|
||||
if (jimuCourse.isDownloaded()) {
|
||||
downloadCourseSuccess(jimuCourse);
|
||||
} else {
|
||||
JimuSimpleDialog.showWifiOnlyDialog(getContext(), new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.main.fragment.d
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public final void onClick(DialogInterface dialogInterface, int i) {
|
||||
TrainingFragment.b(dialogInterface, i);
|
||||
}
|
||||
}, new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.main.fragment.i
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public final void onClick(DialogInterface dialogInterface, int i) {
|
||||
TrainingFragment.this.a(jimuCourse, dialogInterface, i);
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ void a(JimuCourse jimuCourse, DialogInterface dialogInterface, int i) {
|
||||
this.d.downloadJimuCourse(jimuCourse);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.BaseView
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void setPresenter(CourseListContract.Presenter presenter) {
|
||||
this.d = presenter;
|
||||
}
|
||||
|
||||
public void b() {
|
||||
if (this.g) {
|
||||
return;
|
||||
}
|
||||
SPUtils.a(Constant.Course.ONCLICK_IGETIT_KEY, true);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user