Initial commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.ubt.jimu.diy.view.fragment.browse;
|
||||
|
||||
import com.ubt.jimu.community.activity.LazyLoadFragment;
|
||||
import com.ubt.jimu.diy.view.DiyBrowseActivity;
|
||||
import com.ubtech.utils.XLog;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public abstract class BrowseFragment extends LazyLoadFragment {
|
||||
public abstract int getIndex();
|
||||
|
||||
public abstract String getTitle();
|
||||
|
||||
@Override // com.ubt.jimu.community.activity.LazyLoadFragment
|
||||
protected void loadData() {
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment
|
||||
protected void onPageResume() {
|
||||
super.onPageResume();
|
||||
setTitle(getTitle());
|
||||
}
|
||||
|
||||
public void setTitle(String str) {
|
||||
boolean userVisibleHint = getUserVisibleHint();
|
||||
XLog.a("DiyBrowse", "visible %s", Boolean.valueOf(userVisibleHint));
|
||||
if (userVisibleHint && (getActivity() instanceof DiyBrowseActivity)) {
|
||||
((DiyBrowseActivity) getActivity()).setNavTitle(getIndex(), str);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,143 @@
|
||||
package com.ubt.jimu.diy.view.fragment.browse;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.RequestBuilder;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.http.ApiObserver;
|
||||
import com.ubt.jimu.base.http.manager.DiyManager;
|
||||
import com.ubt.jimu.diy.model.BuildCompletedImage;
|
||||
import com.ubt.jimu.diy.model.DiyDetailsModel;
|
||||
import com.ubt.jimu.picture.PictureScrollActivity;
|
||||
import com.ubt.jimu.picture.PictureShowModel;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class BuildCompletedFragment extends BrowseFragment {
|
||||
private static final String INDEX = "index";
|
||||
protected CardView cvVideo;
|
||||
private DiyDetailsModel diyDetailsModel;
|
||||
protected ImageView imgPlay;
|
||||
protected ImageView imgThumbnail;
|
||||
protected LoadingView loadingView;
|
||||
private Unbinder mBind;
|
||||
private int mIndex;
|
||||
private OnFragmentInteractionListener mListener;
|
||||
private ArrayList<PictureShowModel> showModels = new ArrayList<>();
|
||||
protected TextView tvImageCount;
|
||||
|
||||
public interface OnFragmentInteractionListener {
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void initView(List<BuildCompletedImage> list) {
|
||||
if (list == null || list.size() == 0) {
|
||||
return;
|
||||
}
|
||||
String format = String.format(getString(R.string.diy_complete_image), Integer.valueOf(list.size()));
|
||||
this.tvImageCount.setText(" " + format);
|
||||
RequestBuilder<Drawable> a = Glide.a(getActivity()).a(list.get(0).getImageUrl());
|
||||
a.a(new RequestOptions().b(R.drawable.diy_img_default).a(R.drawable.diy_img_default));
|
||||
a.a(this.imgThumbnail);
|
||||
for (BuildCompletedImage buildCompletedImage : list) {
|
||||
PictureShowModel pictureShowModel = new PictureShowModel();
|
||||
pictureShowModel.setText(buildCompletedImage.getImageName());
|
||||
pictureShowModel.setUrl(buildCompletedImage.getImageUrl());
|
||||
this.showModels.add(pictureShowModel);
|
||||
}
|
||||
}
|
||||
|
||||
public static BuildCompletedFragment newInstance(int i, DiyDetailsModel diyDetailsModel) {
|
||||
BuildCompletedFragment buildCompletedFragment = new BuildCompletedFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt(INDEX, i);
|
||||
bundle.putSerializable("details", diyDetailsModel);
|
||||
buildCompletedFragment.setArguments(bundle);
|
||||
return buildCompletedFragment;
|
||||
}
|
||||
|
||||
private void request() {
|
||||
DiyManager.getInstance().buildCompleted(this.diyDetailsModel.getId().longValue(), new ApiObserver<List<BuildCompletedImage>>(this.loadingView) { // from class: com.ubt.jimu.diy.view.fragment.browse.BuildCompletedFragment.1
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
super.onComplete();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
super.onError(th);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onNext(List<BuildCompletedImage> list) {
|
||||
super.onNext((AnonymousClass1) list);
|
||||
BuildCompletedFragment.this.initView(list);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.fragment.browse.BrowseFragment
|
||||
public int getIndex() {
|
||||
return this.mIndex;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.fragment.browse.BrowseFragment
|
||||
public String getTitle() {
|
||||
return isAdded() ? getString(R.string.diy_build_complete) : "";
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.fragment.browse.BrowseFragment, com.ubt.jimu.community.activity.LazyLoadFragment
|
||||
protected void loadData() {
|
||||
request();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.activity.LazyLoadFragment, com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
if (getArguments() != null) {
|
||||
this.mIndex = getArguments().getInt(INDEX);
|
||||
this.diyDetailsModel = (DiyDetailsModel) getArguments().getSerializable("details");
|
||||
}
|
||||
}
|
||||
|
||||
@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.fragment_build_completed, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
return inflate;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroyView() {
|
||||
this.mBind.unbind();
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
this.mListener = null;
|
||||
}
|
||||
|
||||
public void onThumbnailClick(View view) {
|
||||
PictureScrollActivity.a(getActivity(), this.showModels);
|
||||
}
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
package com.ubt.jimu.diy.view.fragment.browse;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import butterknife.Unbinder;
|
||||
import butterknife.internal.DebouncingOnClickListener;
|
||||
import butterknife.internal.Utils;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class BuildCompletedFragment_ViewBinding implements Unbinder {
|
||||
private BuildCompletedFragment target;
|
||||
private View view7f090262;
|
||||
private View view7f090278;
|
||||
|
||||
public BuildCompletedFragment_ViewBinding(final BuildCompletedFragment buildCompletedFragment, View view) {
|
||||
this.target = buildCompletedFragment;
|
||||
buildCompletedFragment.cvVideo = (CardView) Utils.b(view, R.id.cvVideo, "field 'cvVideo'", CardView.class);
|
||||
View a = Utils.a(view, R.id.imgThumbnail, "field 'imgThumbnail' and method 'onThumbnailClick'");
|
||||
buildCompletedFragment.imgThumbnail = (ImageView) Utils.a(a, R.id.imgThumbnail, "field 'imgThumbnail'", ImageView.class);
|
||||
this.view7f090278 = a;
|
||||
a.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.BuildCompletedFragment_ViewBinding.1
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
buildCompletedFragment.onThumbnailClick(view2);
|
||||
}
|
||||
});
|
||||
View a2 = Utils.a(view, R.id.imgPlay, "field 'imgPlay' and method 'onThumbnailClick'");
|
||||
buildCompletedFragment.imgPlay = (ImageView) Utils.a(a2, R.id.imgPlay, "field 'imgPlay'", ImageView.class);
|
||||
this.view7f090262 = a2;
|
||||
a2.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.BuildCompletedFragment_ViewBinding.2
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
buildCompletedFragment.onThumbnailClick(view2);
|
||||
}
|
||||
});
|
||||
buildCompletedFragment.tvImageCount = (TextView) Utils.b(view, R.id.tvImageCount, "field 'tvImageCount'", TextView.class);
|
||||
buildCompletedFragment.loadingView = (LoadingView) Utils.b(view, R.id.loadingView, "field 'loadingView'", LoadingView.class);
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
BuildCompletedFragment buildCompletedFragment = this.target;
|
||||
if (buildCompletedFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
buildCompletedFragment.cvVideo = null;
|
||||
buildCompletedFragment.imgThumbnail = null;
|
||||
buildCompletedFragment.imgPlay = null;
|
||||
buildCompletedFragment.tvImageCount = null;
|
||||
buildCompletedFragment.loadingView = null;
|
||||
this.view7f090278.setOnClickListener(null);
|
||||
this.view7f090278 = null;
|
||||
this.view7f090262.setOnClickListener(null);
|
||||
this.view7f090262 = null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,176 @@
|
||||
package com.ubt.jimu.diy.view.fragment.browse;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.recyclelib.URecyclerView;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.cache.Cache;
|
||||
import com.ubt.jimu.base.entities.ApiRecord;
|
||||
import com.ubt.jimu.base.http.ApiObserver;
|
||||
import com.ubt.jimu.base.http.manager.DiyManager;
|
||||
import com.ubt.jimu.diy.model.DiyCommentModel;
|
||||
import com.ubt.jimu.diy.model.DiyDetailsModel;
|
||||
import com.ubt.jimu.diy.view.adapter.CommentAdapter;
|
||||
import com.ubt.jimu.user.view.LoginActivity;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyCommentFragment extends Fragment implements URecyclerView.LoadingListener, CommentAdapter.InteractionListener {
|
||||
private static final String ARG_PARAM1 = "param1";
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
private static final int PAGE_SIZE = 20;
|
||||
private CommentAdapter commentAdapter;
|
||||
private DiyDetailsModel diyDetailsModel;
|
||||
private OnFragmentInteractionListener listener;
|
||||
protected LoadingView loadingView;
|
||||
private Unbinder mBind;
|
||||
private String mParam1;
|
||||
private String mParam2;
|
||||
protected URecyclerView recyclerView;
|
||||
private List<DiyCommentModel> diyCommentModels = new ArrayList();
|
||||
private int pageNumber = 1;
|
||||
private boolean init = false;
|
||||
|
||||
public interface OnFragmentInteractionListener {
|
||||
void onBackFromComment();
|
||||
}
|
||||
|
||||
private void initRecyclerView() {
|
||||
this.recyclerView.setLayoutManager(new LinearLayoutManager(getContext(), 1, false));
|
||||
this.recyclerView.setLoadingListener(this);
|
||||
this.commentAdapter = new CommentAdapter(getActivity(), this.diyDetailsModel, this.diyCommentModels, true, this);
|
||||
this.recyclerView.setAdapter(this.commentAdapter);
|
||||
loadComments(this.pageNumber);
|
||||
}
|
||||
|
||||
private void loadComments(final int i) {
|
||||
if (this.init) {
|
||||
this.loadingView.setIsRefresh(true);
|
||||
}
|
||||
DiyManager.getInstance().diyComments(i, 20, this.diyDetailsModel.getId().longValue(), new ApiObserver<ApiRecord<DiyCommentModel>>(this.loadingView) { // from class: com.ubt.jimu.diy.view.fragment.browse.DiyCommentFragment.1
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
super.onComplete();
|
||||
DiyCommentFragment.this.recyclerView.y();
|
||||
DiyCommentFragment.this.recyclerView.z();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
super.onError(th);
|
||||
DiyCommentFragment.this.recyclerView.y();
|
||||
DiyCommentFragment.this.recyclerView.z();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onNext(ApiRecord<DiyCommentModel> apiRecord) {
|
||||
super.onNext((AnonymousClass1) apiRecord);
|
||||
if (apiRecord == null || apiRecord.getRecords() == null) {
|
||||
return;
|
||||
}
|
||||
List<DiyCommentModel> records = apiRecord.getRecords();
|
||||
if (i == 1) {
|
||||
DiyCommentFragment.this.diyCommentModels.clear();
|
||||
DiyCommentFragment.this.diyCommentModels.add(new DiyCommentModel());
|
||||
}
|
||||
if (records.size() > 0) {
|
||||
DiyCommentFragment.this.diyCommentModels.addAll(records);
|
||||
DiyCommentFragment.this.pageNumber = i + 1;
|
||||
}
|
||||
DiyCommentFragment.this.commentAdapter.notifyDataSetChanged();
|
||||
DiyCommentFragment.this.init = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static DiyCommentFragment newInstance(String str, String str2) {
|
||||
DiyCommentFragment diyCommentFragment = new DiyCommentFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(ARG_PARAM1, str);
|
||||
bundle.putString(ARG_PARAM2, str2);
|
||||
diyCommentFragment.setArguments(bundle);
|
||||
return diyCommentFragment;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.adapter.CommentAdapter.InteractionListener
|
||||
public void onCommentClick(DiyDetailsModel diyDetailsModel, Map<String, Object> map) {
|
||||
if ("local".equals(Cache.getInstance().getUserId())) {
|
||||
LoginActivity.start(getActivity());
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
if (getArguments() != null) {
|
||||
this.mParam1 = getArguments().getString(ARG_PARAM1);
|
||||
this.mParam2 = getArguments().getString(ARG_PARAM2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
View inflate = layoutInflater.inflate(R.layout.fragment_diy_comment, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
initRecyclerView();
|
||||
return inflate;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroyView() {
|
||||
this.mBind.unbind();
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
this.listener = null;
|
||||
}
|
||||
|
||||
public void onImgBack(View view) {
|
||||
getFragmentManager().d();
|
||||
OnFragmentInteractionListener onFragmentInteractionListener = this.listener;
|
||||
if (onFragmentInteractionListener != null) {
|
||||
onFragmentInteractionListener.onBackFromComment();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.adapter.CommentAdapter.InteractionListener
|
||||
public void onLikeClick(DiyDetailsModel diyDetailsModel) {
|
||||
}
|
||||
|
||||
@Override // com.recyclelib.URecyclerView.LoadingListener
|
||||
public void onLoadingMore() {
|
||||
loadComments(this.pageNumber);
|
||||
}
|
||||
|
||||
@Override // com.recyclelib.URecyclerView.LoadingListener
|
||||
public void onRefreshing() {
|
||||
this.pageNumber = 1;
|
||||
loadComments(this.pageNumber);
|
||||
}
|
||||
|
||||
public void setDiyDetailsModel(DiyDetailsModel diyDetailsModel) {
|
||||
this.diyDetailsModel = diyDetailsModel;
|
||||
}
|
||||
|
||||
public void setListener(OnFragmentInteractionListener onFragmentInteractionListener) {
|
||||
this.listener = onFragmentInteractionListener;
|
||||
}
|
||||
}
|
@@ -0,0 +1,42 @@
|
||||
package com.ubt.jimu.diy.view.fragment.browse;
|
||||
|
||||
import android.view.View;
|
||||
import butterknife.Unbinder;
|
||||
import butterknife.internal.DebouncingOnClickListener;
|
||||
import butterknife.internal.Utils;
|
||||
import com.recyclelib.URecyclerView;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyCommentFragment_ViewBinding implements Unbinder {
|
||||
private DiyCommentFragment target;
|
||||
private View view7f090237;
|
||||
|
||||
public DiyCommentFragment_ViewBinding(final DiyCommentFragment diyCommentFragment, View view) {
|
||||
this.target = diyCommentFragment;
|
||||
diyCommentFragment.recyclerView = (URecyclerView) Utils.b(view, R.id.recycleView, "field 'recyclerView'", URecyclerView.class);
|
||||
diyCommentFragment.loadingView = (LoadingView) Utils.b(view, R.id.loadingView, "field 'loadingView'", LoadingView.class);
|
||||
View a = Utils.a(view, R.id.imgBack, "method 'onImgBack'");
|
||||
this.view7f090237 = a;
|
||||
a.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.DiyCommentFragment_ViewBinding.1
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyCommentFragment.onImgBack(view2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
DiyCommentFragment diyCommentFragment = this.target;
|
||||
if (diyCommentFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
diyCommentFragment.recyclerView = null;
|
||||
diyCommentFragment.loadingView = null;
|
||||
this.view7f090237.setOnClickListener(null);
|
||||
this.view7f090237 = null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,238 @@
|
||||
package com.ubt.jimu.diy.view.fragment.browse;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.recyclelib.URecyclerView;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.cache.Cache;
|
||||
import com.ubt.jimu.base.entities.ApiRecord;
|
||||
import com.ubt.jimu.base.http.ApiObserver;
|
||||
import com.ubt.jimu.base.http.manager.DiyManager;
|
||||
import com.ubt.jimu.diy.model.DiyCommentModel;
|
||||
import com.ubt.jimu.diy.model.DiyDetailsModel;
|
||||
import com.ubt.jimu.diy.view.adapter.CommentAdapter;
|
||||
import com.ubt.jimu.user.view.LoginActivity;
|
||||
import com.ubt.jimu.utils.SystemUtils;
|
||||
import com.ubt.jimu.widgets.CommentKeyBoard;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
import com.ubt.jimu.widgets.NavigationBarView;
|
||||
import com.ubtrobot.log.ALog;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyCommentListFragment extends Fragment implements URecyclerView.LoadingListener {
|
||||
private static final int PAGE_SIZE = 20;
|
||||
protected CommentKeyBoard cmkb;
|
||||
private CommentAdapter commentAdapter;
|
||||
private DiyDetailsModel diyDetailsModel;
|
||||
protected LoadingView loadingView;
|
||||
private Unbinder mBind;
|
||||
private OnFragmentInteractionListener mListener;
|
||||
protected NavigationBarView nbvComment;
|
||||
protected URecyclerView recyclerView;
|
||||
private CompositeDisposable disposables = new CompositeDisposable();
|
||||
private List<DiyCommentModel> diyCommentModels = new ArrayList();
|
||||
private int pageNumber = 1;
|
||||
private boolean init = false;
|
||||
|
||||
public interface OnFragmentInteractionListener {
|
||||
void onComment(DiyDetailsModel diyDetailsModel);
|
||||
|
||||
void onCommentListBack();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
this.cmkb.setonKeyBoardCommitListener(new CommentKeyBoard.KeyBoardCommentListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.DiyCommentListFragment.1
|
||||
@Override // com.ubt.jimu.widgets.CommentKeyBoard.KeyBoardCommentListener
|
||||
public void onHideView() {
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.CommentKeyBoard.KeyBoardCommentListener
|
||||
public void onKeyBoardCommitListener(final String str) {
|
||||
DiyManager.getInstance().addComment(str, DiyCommentListFragment.this.diyDetailsModel.getId() + "", new ApiObserver<Object>(null) { // from class: com.ubt.jimu.diy.view.fragment.browse.DiyCommentListFragment.1.1
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onNext(Object obj) {
|
||||
ALog.a((Object) obj.toString());
|
||||
DiyCommentModel diyCommentModel = new DiyCommentModel();
|
||||
diyCommentModel.setContent(str);
|
||||
diyCommentModel.setNickName(Cache.getInstance().getUser().getNickName());
|
||||
diyCommentModel.setUserImage(Cache.getInstance().getUser().getUserImage());
|
||||
diyCommentModel.setCreateTime(SystemUtils.a());
|
||||
DiyCommentListFragment.this.diyCommentModels.add(1, diyCommentModel);
|
||||
DiyCommentListFragment.this.commentAdapter.notifyItemChanged(1);
|
||||
DiyCommentListFragment.this.commentAdapter.notifyItemRangeChanged(1, DiyCommentListFragment.this.diyCommentModels.size());
|
||||
DiyCommentListFragment.this.cmkb.a();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initRecyclerView() {
|
||||
this.recyclerView.setLayoutManager(new LinearLayoutManager(getContext(), 1, false));
|
||||
this.recyclerView.setLoadingListener(this);
|
||||
this.commentAdapter = new CommentAdapter(getActivity(), this.diyDetailsModel, this.diyCommentModels, false, null);
|
||||
this.recyclerView.setAdapter(this.commentAdapter);
|
||||
loadComments(1);
|
||||
}
|
||||
|
||||
private void loadComments(final int i) {
|
||||
if (this.diyDetailsModel == null) {
|
||||
return;
|
||||
}
|
||||
if (this.init) {
|
||||
this.loadingView.setIsRefresh(true);
|
||||
}
|
||||
DiyManager.getInstance().diyComments(i, 20, this.diyDetailsModel.getId().longValue(), new ApiObserver<ApiRecord<DiyCommentModel>>(this.loadingView) { // from class: com.ubt.jimu.diy.view.fragment.browse.DiyCommentListFragment.2
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
super.onComplete();
|
||||
URecyclerView uRecyclerView = DiyCommentListFragment.this.recyclerView;
|
||||
if (uRecyclerView != null) {
|
||||
uRecyclerView.y();
|
||||
DiyCommentListFragment.this.recyclerView.z();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
super.onError(th);
|
||||
URecyclerView uRecyclerView = DiyCommentListFragment.this.recyclerView;
|
||||
if (uRecyclerView != null) {
|
||||
uRecyclerView.y();
|
||||
DiyCommentListFragment.this.recyclerView.z();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
DiyCommentListFragment.this.disposables.b(disposable);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onNext(ApiRecord<DiyCommentModel> apiRecord) {
|
||||
super.onNext((AnonymousClass2) apiRecord);
|
||||
if (apiRecord == null || apiRecord.getRecords() == null) {
|
||||
return;
|
||||
}
|
||||
List<DiyCommentModel> records = apiRecord.getRecords();
|
||||
if (i == 1) {
|
||||
DiyCommentListFragment.this.diyCommentModels.clear();
|
||||
DiyCommentListFragment.this.diyCommentModels.add(new DiyCommentModel());
|
||||
}
|
||||
if (records.size() > 0) {
|
||||
DiyCommentListFragment.this.diyCommentModels.addAll(records);
|
||||
DiyCommentListFragment.this.pageNumber = i + 1;
|
||||
}
|
||||
DiyCommentListFragment.this.commentAdapter.notifyDataSetChanged();
|
||||
DiyCommentListFragment.this.init = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static DiyCommentListFragment newInstance(DiyDetailsModel diyDetailsModel) {
|
||||
DiyCommentListFragment diyCommentListFragment = new DiyCommentListFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("diyDetailsModel", diyDetailsModel);
|
||||
diyCommentListFragment.setArguments(bundle);
|
||||
return diyCommentListFragment;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
if (getArguments() != null) {
|
||||
this.diyDetailsModel = (DiyDetailsModel) getArguments().getSerializable("diyDetailsModel");
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
View inflate = layoutInflater.inflate(R.layout.fragment_diy_comment_list, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
initRecyclerView();
|
||||
initData();
|
||||
return inflate;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroyView() {
|
||||
this.disposables.dispose();
|
||||
this.disposables.a();
|
||||
this.mBind.unbind();
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
this.mListener = null;
|
||||
}
|
||||
|
||||
public void onImgBack() {
|
||||
getFragmentManager().d();
|
||||
OnFragmentInteractionListener onFragmentInteractionListener = this.mListener;
|
||||
if (onFragmentInteractionListener != null) {
|
||||
onFragmentInteractionListener.onCommentListBack();
|
||||
}
|
||||
}
|
||||
|
||||
public void onImgComment(View view) {
|
||||
if ("local".equals(Cache.getInstance().getUserId())) {
|
||||
LoginActivity.start(getActivity());
|
||||
} else {
|
||||
this.cmkb.b();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.recyclelib.URecyclerView.LoadingListener
|
||||
public void onLoadingMore() {
|
||||
loadComments(this.pageNumber);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMessageEvent(String str) {
|
||||
loadComments(1);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
EventBus.b().d(this);
|
||||
}
|
||||
|
||||
@Override // com.recyclelib.URecyclerView.LoadingListener
|
||||
public void onRefreshing() {
|
||||
this.pageNumber = 1;
|
||||
loadComments(this.pageNumber);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
EventBus.b().c(this);
|
||||
}
|
||||
|
||||
public void setListener(OnFragmentInteractionListener onFragmentInteractionListener) {
|
||||
this.mListener = onFragmentInteractionListener;
|
||||
}
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
package com.ubt.jimu.diy.view.fragment.browse;
|
||||
|
||||
import android.view.View;
|
||||
import butterknife.Unbinder;
|
||||
import butterknife.internal.DebouncingOnClickListener;
|
||||
import butterknife.internal.Utils;
|
||||
import com.recyclelib.URecyclerView;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.widgets.CommentKeyBoard;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
import com.ubt.jimu.widgets.NavigationBarView;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyCommentListFragment_ViewBinding implements Unbinder {
|
||||
private DiyCommentListFragment target;
|
||||
private View view7f09023d;
|
||||
|
||||
public DiyCommentListFragment_ViewBinding(final DiyCommentListFragment diyCommentListFragment, View view) {
|
||||
this.target = diyCommentListFragment;
|
||||
diyCommentListFragment.nbvComment = (NavigationBarView) Utils.b(view, R.id.nbvComment, "field 'nbvComment'", NavigationBarView.class);
|
||||
diyCommentListFragment.recyclerView = (URecyclerView) Utils.b(view, R.id.recycleView, "field 'recyclerView'", URecyclerView.class);
|
||||
diyCommentListFragment.loadingView = (LoadingView) Utils.b(view, R.id.loadingView, "field 'loadingView'", LoadingView.class);
|
||||
diyCommentListFragment.cmkb = (CommentKeyBoard) Utils.b(view, R.id.cmkb, "field 'cmkb'", CommentKeyBoard.class);
|
||||
View a = Utils.a(view, R.id.imgComment, "method 'onImgComment'");
|
||||
this.view7f09023d = a;
|
||||
a.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.DiyCommentListFragment_ViewBinding.1
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyCommentListFragment.onImgComment(view2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
DiyCommentListFragment diyCommentListFragment = this.target;
|
||||
if (diyCommentListFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
diyCommentListFragment.nbvComment = null;
|
||||
diyCommentListFragment.recyclerView = null;
|
||||
diyCommentListFragment.loadingView = null;
|
||||
diyCommentListFragment.cmkb = null;
|
||||
this.view7f09023d.setOnClickListener(null);
|
||||
this.view7f09023d = null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,286 @@
|
||||
package com.ubt.jimu.diy.view.fragment.browse;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.method.ScrollingMovementMethod;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.RequestBuilder;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.cache.Cache;
|
||||
import com.ubt.jimu.base.dialog.JimuSimpleDialog;
|
||||
import com.ubt.jimu.base.entities.Constant;
|
||||
import com.ubt.jimu.base.entities.Robot;
|
||||
import com.ubt.jimu.base.http.ApiObserver;
|
||||
import com.ubt.jimu.base.http.manager.DiyManager;
|
||||
import com.ubt.jimu.community.activity.LazyLoadFragment;
|
||||
import com.ubt.jimu.diy.DiyRobotDbHandler;
|
||||
import com.ubt.jimu.diy.model.DiyDetailsModel;
|
||||
import com.ubt.jimu.diy.view.DiyBrowseActivity;
|
||||
import com.ubt.jimu.unity.bluetooth.UnityActivity;
|
||||
import com.ubt.jimu.utils.SPUtils;
|
||||
import com.ubt.jimu.utils.TextUtils;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
import com.ubt.jimu.widgets.NavigationBarView;
|
||||
import com.ubt.jimu.widgets.player.UbtPlayer;
|
||||
import com.ubtech.utils.StringUtils;
|
||||
import com.ubtech.view.dialog.SimpleDialog;
|
||||
import com.ubtrobot.log.ALog;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyDetailsFragment extends LazyLoadFragment {
|
||||
private String customModelId;
|
||||
protected CardView cvVideo;
|
||||
private DiyDetailsModel diyDetailsModel;
|
||||
protected ImageView imgDiyLogo;
|
||||
protected ImageView imgPlay;
|
||||
protected LoadingView loadingView;
|
||||
private Unbinder mBind;
|
||||
private OnInteractionListener mListener;
|
||||
private long modelId;
|
||||
protected NavigationBarView nbv_bar;
|
||||
protected TextView tvCreateDate;
|
||||
protected TextView tvDiyAuthor;
|
||||
protected TextView tvDiyDesc;
|
||||
protected TextView tvSeeComment;
|
||||
private SimpleDialog mResumeStepDialog = null;
|
||||
private int stepBrowse = -5;
|
||||
CompositeDisposable disposable = new CompositeDisposable();
|
||||
|
||||
public interface OnInteractionListener {
|
||||
void onCommentClick(DiyDetailsModel diyDetailsModel);
|
||||
}
|
||||
|
||||
static /* synthetic */ void d(DialogInterface dialogInterface, int i) {
|
||||
}
|
||||
|
||||
private void enterRecord() {
|
||||
this.stepBrowse = SPUtils.a(String.format(DiyBrowseActivity.DIYSTEP, this.diyDetailsModel.getCustomModelId()), -5);
|
||||
if (this.stepBrowse == -5) {
|
||||
DiyBrowseActivity.start(getActivity(), this.diyDetailsModel);
|
||||
return;
|
||||
}
|
||||
SimpleDialog.Builder builder = new SimpleDialog.Builder(this.mActivity);
|
||||
if (this.mResumeStepDialog == null) {
|
||||
this.mResumeStepDialog = builder.b(new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.c
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public final void onClick(DialogInterface dialogInterface, int i) {
|
||||
DiyDetailsFragment.this.a(dialogInterface, i);
|
||||
}
|
||||
}).b(this.mActivity.getResources().getString(R.string.key_continue)).a(new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.b
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public final void onClick(DialogInterface dialogInterface, int i) {
|
||||
DiyDetailsFragment.this.b(dialogInterface, i);
|
||||
}
|
||||
}).a(this.mActivity.getResources().getString(R.string.browse_again)).a((CharSequence) this.mActivity.getResources().getString(R.string.continue_browse)).a();
|
||||
}
|
||||
this.mResumeStepDialog.show();
|
||||
}
|
||||
|
||||
private void gotoUnity(DiyDetailsModel diyDetailsModel, int i, int i2, int i3, int i4) {
|
||||
UnityActivity.modelBrowse = diyDetailsModel;
|
||||
Robot robot = new Robot();
|
||||
robot.setModelName(diyDetailsModel.getCustomModelId());
|
||||
robot.setModelDescription(diyDetailsModel.getTitle());
|
||||
robot.setModelId(diyDetailsModel.getId().longValue());
|
||||
robot.setModelType("2");
|
||||
robot.setFilePath(DiyRobotDbHandler.getCustomModelPath() + diyDetailsModel.getCustomModelId() + File.separator + diyDetailsModel.getCustomModelId() + ".jpg");
|
||||
UnityActivity.startUnityActivity(this.mActivity, diyDetailsModel, robot, i, i2, i3, diyDetailsModel.getSteps().size() + 6, false, i4);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void initView(DiyDetailsModel diyDetailsModel) {
|
||||
FragmentActivity activity = getActivity();
|
||||
if (diyDetailsModel == null || activity == null) {
|
||||
return;
|
||||
}
|
||||
this.cvVideo.setVisibility(0);
|
||||
this.nbv_bar.setTitle(diyDetailsModel.getTitle());
|
||||
this.tvDiyAuthor.setText(String.format(getString(R.string.author_by), diyDetailsModel.getAuthor()));
|
||||
this.tvSeeComment.setText(String.format(activity.getString(R.string.diy_details_comment), TextUtils.a(diyDetailsModel.getCommentNum())));
|
||||
this.tvDiyDesc.setMovementMethod(ScrollingMovementMethod.getInstance());
|
||||
this.tvDiyDesc.setText(diyDetailsModel.getDescription());
|
||||
RequestBuilder<Drawable> a = Glide.a((Activity) activity).a(diyDetailsModel.getThumbnail());
|
||||
a.a(new RequestOptions().b(R.drawable.diy_img_default).a(R.drawable.diy_img_default));
|
||||
a.a(this.imgDiyLogo);
|
||||
this.tvCreateDate.setText(new SimpleDateFormat(Locale.getDefault().getCountry().equals(Locale.CHINA.getCountry()) ? "yyyy年MM月dd" : "yyyy-MM-dd").format(new Date(diyDetailsModel.getCreateTime())));
|
||||
}
|
||||
|
||||
public static DiyDetailsFragment newInstance(long j, String str) {
|
||||
DiyDetailsFragment diyDetailsFragment = new DiyDetailsFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putLong("modelId", j);
|
||||
bundle.putString("customModelId", str);
|
||||
diyDetailsFragment.setArguments(bundle);
|
||||
return diyDetailsFragment;
|
||||
}
|
||||
|
||||
public /* synthetic */ void a(DialogInterface dialogInterface, int i) {
|
||||
this.mResumeStepDialog.dismiss();
|
||||
DiyDetailsModel diyDetailsModel = this.diyDetailsModel;
|
||||
if (diyDetailsModel == null || diyDetailsModel.getSteps() == null) {
|
||||
ALog.a("diyDetailsModel==nulldiyDetailsModel.getSteps()==null", new Object[0]);
|
||||
} else {
|
||||
ALog.a("diyDetailsModel.getSteps()==" + this.diyDetailsModel.getSteps().size(), new Object[0]);
|
||||
}
|
||||
int i2 = this.stepBrowse;
|
||||
if (i2 == -3) {
|
||||
DiyDetailsModel diyDetailsModel2 = this.diyDetailsModel;
|
||||
gotoUnity(diyDetailsModel2, 1005, 2, diyDetailsModel2.getSteps().size() + 4, UnityActivity.BLOCKLY_TYPE_NONE);
|
||||
} else if (i2 != -2) {
|
||||
DiyBrowseActivity.start(this.mActivity, i2, this.diyDetailsModel);
|
||||
} else {
|
||||
DiyDetailsModel diyDetailsModel3 = this.diyDetailsModel;
|
||||
gotoUnity(diyDetailsModel3, UnityActivity.CODE_BROWSE_PROGRAM, 3, diyDetailsModel3.getSteps().size() + 6, UnityActivity.BLOCKLY_TYPE_DIY_PREVIEW);
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ void b(DialogInterface dialogInterface, int i) {
|
||||
DiyBrowseActivity.start(getActivity(), this.diyDetailsModel);
|
||||
SPUtils.b(String.format(DiyBrowseActivity.DIYSTEP, this.diyDetailsModel.getCustomModelId()), -5);
|
||||
this.mResumeStepDialog.dismiss();
|
||||
}
|
||||
|
||||
public /* synthetic */ void c(DialogInterface dialogInterface, int i) {
|
||||
UbtPlayer.a(getActivity(), this.diyDetailsModel.getTitle(), this.diyDetailsModel.getVideoUrl());
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.activity.LazyLoadFragment
|
||||
protected void loadData() {
|
||||
requestDetails();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.activity.LazyLoadFragment, com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
if (getArguments() != null) {
|
||||
this.modelId = getArguments().getLong("modelId");
|
||||
this.customModelId = getArguments().getString("customModelId");
|
||||
}
|
||||
}
|
||||
|
||||
@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.fragment_diy_details, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
return inflate;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroyView() {
|
||||
this.mBind.unbind();
|
||||
CompositeDisposable compositeDisposable = this.disposable;
|
||||
if (compositeDisposable != null) {
|
||||
compositeDisposable.dispose();
|
||||
this.disposable.a();
|
||||
this.disposable = null;
|
||||
}
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
this.mListener = null;
|
||||
}
|
||||
|
||||
public void onImgPlay(View view) {
|
||||
FragmentActivity activity;
|
||||
if (this.diyDetailsModel == null || (activity = getActivity()) == null) {
|
||||
return;
|
||||
}
|
||||
JimuSimpleDialog.showWifiOnlyDialog(activity, new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.d
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public final void onClick(DialogInterface dialogInterface, int i) {
|
||||
DiyDetailsFragment.d(dialogInterface, i);
|
||||
}
|
||||
}, new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.a
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public final void onClick(DialogInterface dialogInterface, int i) {
|
||||
DiyDetailsFragment.this.c(dialogInterface, i);
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
public void onSeeComment(View view) {
|
||||
OnInteractionListener onInteractionListener;
|
||||
DiyDetailsModel diyDetailsModel = this.diyDetailsModel;
|
||||
if (diyDetailsModel == null || (onInteractionListener = this.mListener) == null) {
|
||||
return;
|
||||
}
|
||||
onInteractionListener.onCommentClick(diyDetailsModel);
|
||||
}
|
||||
|
||||
public void onStartPreview(View view) {
|
||||
if (this.diyDetailsModel == null) {
|
||||
return;
|
||||
}
|
||||
if (StringUtils.e(this.customModelId)) {
|
||||
this.customModelId = String.valueOf(this.modelId);
|
||||
}
|
||||
this.diyDetailsModel.setCustomModelId(this.customModelId);
|
||||
enterRecord();
|
||||
SPUtils.a(Constant.NoviceGuide.IS_SKIP_ALL_GUIDE_KEY, true);
|
||||
}
|
||||
|
||||
public void requestDetails() {
|
||||
DiyManager.getInstance().diyDetails((int) Cache.getInstance().getLoginUserIntId(), this.modelId, new ApiObserver<DiyDetailsModel>(this.loadingView) { // from class: com.ubt.jimu.diy.view.fragment.browse.DiyDetailsFragment.1
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
super.onComplete();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
super.onError(th);
|
||||
th.printStackTrace();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
DiyDetailsFragment.this.disposable.b(disposable);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onNext(DiyDetailsModel diyDetailsModel) {
|
||||
super.onNext((AnonymousClass1) diyDetailsModel);
|
||||
DiyDetailsFragment.this.diyDetailsModel = diyDetailsModel;
|
||||
DiyDetailsFragment.this.diyDetailsModel.setCustomModelId(DiyDetailsFragment.this.customModelId);
|
||||
DiyDetailsFragment.this.initView(diyDetailsModel);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setListener(OnInteractionListener onInteractionListener) {
|
||||
this.mListener = onInteractionListener;
|
||||
}
|
||||
}
|
@@ -0,0 +1,81 @@
|
||||
package com.ubt.jimu.diy.view.fragment.browse;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import butterknife.Unbinder;
|
||||
import butterknife.internal.DebouncingOnClickListener;
|
||||
import butterknife.internal.Utils;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
import com.ubt.jimu.widgets.NavigationBarView;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyDetailsFragment_ViewBinding implements Unbinder {
|
||||
private DiyDetailsFragment target;
|
||||
private View view7f090262;
|
||||
private View view7f09034b;
|
||||
private View view7f09055c;
|
||||
|
||||
public DiyDetailsFragment_ViewBinding(final DiyDetailsFragment diyDetailsFragment, View view) {
|
||||
this.target = diyDetailsFragment;
|
||||
diyDetailsFragment.nbv_bar = (NavigationBarView) Utils.b(view, R.id.nbv_bar, "field 'nbv_bar'", NavigationBarView.class);
|
||||
diyDetailsFragment.cvVideo = (CardView) Utils.b(view, R.id.cvVideo, "field 'cvVideo'", CardView.class);
|
||||
diyDetailsFragment.imgDiyLogo = (ImageView) Utils.b(view, R.id.imgDiyLogo, "field 'imgDiyLogo'", ImageView.class);
|
||||
View a = Utils.a(view, R.id.imgPlay, "field 'imgPlay' and method 'onImgPlay'");
|
||||
diyDetailsFragment.imgPlay = (ImageView) Utils.a(a, R.id.imgPlay, "field 'imgPlay'", ImageView.class);
|
||||
this.view7f090262 = a;
|
||||
a.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.DiyDetailsFragment_ViewBinding.1
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyDetailsFragment.onImgPlay(view2);
|
||||
}
|
||||
});
|
||||
View a2 = Utils.a(view, R.id.tvSeeComment, "field 'tvSeeComment' and method 'onSeeComment'");
|
||||
diyDetailsFragment.tvSeeComment = (TextView) Utils.a(a2, R.id.tvSeeComment, "field 'tvSeeComment'", TextView.class);
|
||||
this.view7f09055c = a2;
|
||||
a2.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.DiyDetailsFragment_ViewBinding.2
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyDetailsFragment.onSeeComment(view2);
|
||||
}
|
||||
});
|
||||
diyDetailsFragment.tvDiyAuthor = (TextView) Utils.b(view, R.id.tvDiyAuthor, "field 'tvDiyAuthor'", TextView.class);
|
||||
diyDetailsFragment.tvDiyDesc = (TextView) Utils.b(view, R.id.tvDiyDesc, "field 'tvDiyDesc'", TextView.class);
|
||||
diyDetailsFragment.tvCreateDate = (TextView) Utils.b(view, R.id.tvCreateDate, "field 'tvCreateDate'", TextView.class);
|
||||
diyDetailsFragment.loadingView = (LoadingView) Utils.b(view, R.id.loadingView, "field 'loadingView'", LoadingView.class);
|
||||
View a3 = Utils.a(view, R.id.llStart, "method 'onStartPreview'");
|
||||
this.view7f09034b = a3;
|
||||
a3.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.DiyDetailsFragment_ViewBinding.3
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyDetailsFragment.onStartPreview(view2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
DiyDetailsFragment diyDetailsFragment = this.target;
|
||||
if (diyDetailsFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
diyDetailsFragment.nbv_bar = null;
|
||||
diyDetailsFragment.cvVideo = null;
|
||||
diyDetailsFragment.imgDiyLogo = null;
|
||||
diyDetailsFragment.imgPlay = null;
|
||||
diyDetailsFragment.tvSeeComment = null;
|
||||
diyDetailsFragment.tvDiyAuthor = null;
|
||||
diyDetailsFragment.tvDiyDesc = null;
|
||||
diyDetailsFragment.tvCreateDate = null;
|
||||
diyDetailsFragment.loadingView = null;
|
||||
this.view7f090262.setOnClickListener(null);
|
||||
this.view7f090262 = null;
|
||||
this.view7f09055c.setOnClickListener(null);
|
||||
this.view7f09055c = null;
|
||||
this.view7f09034b.setOnClickListener(null);
|
||||
this.view7f09034b = null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,160 @@
|
||||
package com.ubt.jimu.diy.view.fragment.browse;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.method.ScrollingMovementMethod;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewStub;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.RequestBuilder;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.dialog.JimuSimpleDialog;
|
||||
import com.ubt.jimu.course.view.fragment.JimuMissionListFragment;
|
||||
import com.ubt.jimu.diy.model.DiyDetailsModel;
|
||||
import com.ubt.jimu.utils.GlideImageLoaderUtils;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
import com.ubt.jimu.widgets.player.UbtPlayer;
|
||||
import com.youth.banner.Banner;
|
||||
import com.youth.banner.listener.OnBannerListener;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class PreviewBuildStepFragment extends BrowseFragment implements OnBannerListener {
|
||||
private static final String INDEX = "index";
|
||||
protected Banner banner;
|
||||
protected ImageView imgPlay;
|
||||
protected ImageView imgThumbnail;
|
||||
protected LoadingView loadingView;
|
||||
private Unbinder mBind;
|
||||
private int mIndex;
|
||||
private OnFragmentInteractionListener mListener;
|
||||
private DiyDetailsModel.DiyBuildStep step;
|
||||
protected TextView tvBuildStepDesc;
|
||||
protected TextView tvBuildStepName;
|
||||
protected ViewStub viewStup;
|
||||
|
||||
public interface OnFragmentInteractionListener {
|
||||
}
|
||||
|
||||
static /* synthetic */ void a(DialogInterface dialogInterface, int i) {
|
||||
}
|
||||
|
||||
public static PreviewBuildStepFragment newInstance(int i, DiyDetailsModel.DiyBuildStep diyBuildStep, int i2) {
|
||||
PreviewBuildStepFragment previewBuildStepFragment = new PreviewBuildStepFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt(INDEX, i);
|
||||
bundle.putSerializable("step", diyBuildStep);
|
||||
bundle.putInt(JimuMissionListFragment.POSITION, i2);
|
||||
previewBuildStepFragment.setArguments(bundle);
|
||||
return previewBuildStepFragment;
|
||||
}
|
||||
|
||||
@Override // com.youth.banner.listener.OnBannerListener
|
||||
public void OnBannerClick(int i) {
|
||||
}
|
||||
|
||||
public /* synthetic */ void a(Activity activity, DialogInterface dialogInterface, int i) {
|
||||
UbtPlayer.a(activity, this.step.getName(), this.step.getVideoUrl());
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.fragment.browse.BrowseFragment
|
||||
public int getIndex() {
|
||||
return this.mIndex;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.fragment.browse.BrowseFragment
|
||||
public String getTitle() {
|
||||
return isAdded() ? getString(R.string.title_diy_build) : "";
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.fragment.browse.BrowseFragment, com.ubt.jimu.community.activity.LazyLoadFragment
|
||||
protected void loadData() {
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.activity.LazyLoadFragment, com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
if (getArguments() != null) {
|
||||
this.mIndex = getArguments().getInt(INDEX);
|
||||
this.step = (DiyDetailsModel.DiyBuildStep) getArguments().getSerializable("step");
|
||||
}
|
||||
}
|
||||
|
||||
@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.fragment_preview_build_step, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
DiyDetailsModel.DiyBuildStep diyBuildStep = this.step;
|
||||
if (diyBuildStep != null) {
|
||||
this.tvBuildStepName.setText(diyBuildStep.getName());
|
||||
this.tvBuildStepName.setVisibility(8);
|
||||
this.tvBuildStepDesc.setText(this.step.getDescription());
|
||||
this.tvBuildStepDesc.setMovementMethod(ScrollingMovementMethod.getInstance());
|
||||
if (this.step.getImages() == null || this.step.getImages().size() == 0) {
|
||||
RequestBuilder<Drawable> a = Glide.a(getActivity()).a(this.step.getThumbnail());
|
||||
a.a(new RequestOptions().b(R.drawable.diy_img_default).a(R.drawable.diy_img_default));
|
||||
a.a(this.imgThumbnail);
|
||||
} else {
|
||||
this.imgThumbnail.setVisibility(8);
|
||||
this.imgPlay.setVisibility(8);
|
||||
this.banner = (Banner) this.viewStup.inflate().findViewById(R.id.banner);
|
||||
this.banner.a(new GlideImageLoaderUtils(getActivity()));
|
||||
this.banner.a(1);
|
||||
this.banner.b(7);
|
||||
this.banner.b(this.step.getImages());
|
||||
this.banner.a();
|
||||
}
|
||||
}
|
||||
return inflate;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
this.mBind.unbind();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
Banner banner = this.banner;
|
||||
if (banner != null) {
|
||||
banner.c();
|
||||
this.banner = null;
|
||||
}
|
||||
this.mListener = null;
|
||||
}
|
||||
|
||||
public void onPlay(View view) {
|
||||
final FragmentActivity activity;
|
||||
if (this.step == null || (activity = getActivity()) == null) {
|
||||
return;
|
||||
}
|
||||
JimuSimpleDialog.showWifiOnlyDialog(activity, new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.e
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public final void onClick(DialogInterface dialogInterface, int i) {
|
||||
PreviewBuildStepFragment.a(dialogInterface, i);
|
||||
}
|
||||
}, new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.f
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public final void onClick(DialogInterface dialogInterface, int i) {
|
||||
PreviewBuildStepFragment.this.a(activity, dialogInterface, i);
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
}
|
@@ -0,0 +1,52 @@
|
||||
package com.ubt.jimu.diy.view.fragment.browse;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewStub;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import butterknife.Unbinder;
|
||||
import butterknife.internal.DebouncingOnClickListener;
|
||||
import butterknife.internal.Utils;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class PreviewBuildStepFragment_ViewBinding implements Unbinder {
|
||||
private PreviewBuildStepFragment target;
|
||||
private View view7f090262;
|
||||
|
||||
public PreviewBuildStepFragment_ViewBinding(final PreviewBuildStepFragment previewBuildStepFragment, View view) {
|
||||
this.target = previewBuildStepFragment;
|
||||
previewBuildStepFragment.imgThumbnail = (ImageView) Utils.b(view, R.id.imgThumbnail, "field 'imgThumbnail'", ImageView.class);
|
||||
View a = Utils.a(view, R.id.imgPlay, "field 'imgPlay' and method 'onPlay'");
|
||||
previewBuildStepFragment.imgPlay = (ImageView) Utils.a(a, R.id.imgPlay, "field 'imgPlay'", ImageView.class);
|
||||
this.view7f090262 = a;
|
||||
a.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.PreviewBuildStepFragment_ViewBinding.1
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
previewBuildStepFragment.onPlay(view2);
|
||||
}
|
||||
});
|
||||
previewBuildStepFragment.tvBuildStepName = (TextView) Utils.b(view, R.id.tvBuildStepName, "field 'tvBuildStepName'", TextView.class);
|
||||
previewBuildStepFragment.tvBuildStepDesc = (TextView) Utils.b(view, R.id.tvBuildStepDesc, "field 'tvBuildStepDesc'", TextView.class);
|
||||
previewBuildStepFragment.loadingView = (LoadingView) Utils.b(view, R.id.loadingView, "field 'loadingView'", LoadingView.class);
|
||||
previewBuildStepFragment.viewStup = (ViewStub) Utils.b(view, R.id.viewStup, "field 'viewStup'", ViewStub.class);
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
PreviewBuildStepFragment previewBuildStepFragment = this.target;
|
||||
if (previewBuildStepFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
previewBuildStepFragment.imgThumbnail = null;
|
||||
previewBuildStepFragment.imgPlay = null;
|
||||
previewBuildStepFragment.tvBuildStepName = null;
|
||||
previewBuildStepFragment.tvBuildStepDesc = null;
|
||||
previewBuildStepFragment.loadingView = null;
|
||||
previewBuildStepFragment.viewStup = null;
|
||||
this.view7f090262.setOnClickListener(null);
|
||||
this.view7f090262 = null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,207 @@
|
||||
package com.ubt.jimu.diy.view.fragment.browse;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.recyclelib.URecyclerView;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.entities.ApiRecord;
|
||||
import com.ubt.jimu.base.entities.PartEntities;
|
||||
import com.ubt.jimu.base.http.ApiObserver;
|
||||
import com.ubt.jimu.base.http.manager.DiyManager;
|
||||
import com.ubt.jimu.diy.model.DiyPartModel;
|
||||
import com.ubt.jimu.diy.view.adapter.PartAllAdapter;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
import com.ubtech.utils.StringUtils;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class PreviewPartListFragment extends BrowseFragment implements URecyclerView.LoadingListener {
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
private static final String INDEX = "index";
|
||||
private static final String MODEL_ID = "modelId";
|
||||
protected LoadingView loadingView;
|
||||
private Unbinder mBind;
|
||||
private int mIndex;
|
||||
private OnFragmentInteractionListener mListener;
|
||||
private String mParam2;
|
||||
private long modelId;
|
||||
protected URecyclerView recyclerView;
|
||||
private String mTitle = "";
|
||||
private ArrayList<DiyPartModel> listElectNetWork = new ArrayList<>();
|
||||
private ArrayList<DiyPartModel> connectionWork = new ArrayList<>();
|
||||
private ArrayList<DiyPartModel> decorateWork = new ArrayList<>();
|
||||
private ArrayList<DiyPartModel> lineWork = new ArrayList<>();
|
||||
|
||||
public interface OnFragmentInteractionListener {
|
||||
}
|
||||
|
||||
public static PreviewPartListFragment newInstance(int i, long j, String str) {
|
||||
PreviewPartListFragment previewPartListFragment = new PreviewPartListFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt(INDEX, i);
|
||||
bundle.putLong(MODEL_ID, j);
|
||||
bundle.putString(ARG_PARAM2, str);
|
||||
previewPartListFragment.setArguments(bundle);
|
||||
return previewPartListFragment;
|
||||
}
|
||||
|
||||
private void requestData() {
|
||||
DiyManager.getInstance().diyParts(this.modelId, new ApiObserver<ApiRecord<PartEntities.RecordsBean>>(this.loadingView) { // from class: com.ubt.jimu.diy.view.fragment.browse.PreviewPartListFragment.1
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
super.onError(th);
|
||||
PreviewPartListFragment.this.recyclerView.A();
|
||||
}
|
||||
|
||||
/* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onNext(ApiRecord<PartEntities.RecordsBean> apiRecord) {
|
||||
FragmentActivity activity;
|
||||
super.onNext((AnonymousClass1) apiRecord);
|
||||
if (apiRecord == null || (activity = PreviewPartListFragment.this.getActivity()) == null) {
|
||||
return;
|
||||
}
|
||||
PreviewPartListFragment.this.recyclerView.A();
|
||||
int size = apiRecord.getRecords() == null ? 0 : apiRecord.getRecords().size();
|
||||
PreviewPartListFragment previewPartListFragment = PreviewPartListFragment.this;
|
||||
previewPartListFragment.mTitle = previewPartListFragment.getString(R.string.diy_part_count, String.valueOf(size));
|
||||
PreviewPartListFragment previewPartListFragment2 = PreviewPartListFragment.this;
|
||||
previewPartListFragment2.setTitle(previewPartListFragment2.mTitle);
|
||||
if (apiRecord.getRecords() != null) {
|
||||
PreviewPartListFragment.this.listElectNetWork.clear();
|
||||
PreviewPartListFragment.this.connectionWork.clear();
|
||||
PreviewPartListFragment.this.decorateWork.clear();
|
||||
PreviewPartListFragment.this.lineWork.clear();
|
||||
for (PartEntities.RecordsBean recordsBean : apiRecord.getRecords()) {
|
||||
DiyPartModel diyPartModel = new DiyPartModel();
|
||||
diyPartModel.setType(recordsBean.getType());
|
||||
diyPartModel.setPartName(recordsBean.getName());
|
||||
diyPartModel.setImageUrl(recordsBean.getImage());
|
||||
diyPartModel.setCount(recordsBean.getNum());
|
||||
if (!StringUtils.e(recordsBean.getType())) {
|
||||
String type = recordsBean.getType();
|
||||
char c = 65535;
|
||||
switch (type.hashCode()) {
|
||||
case 49:
|
||||
if (type.equals("1")) {
|
||||
c = 1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 50:
|
||||
if (type.equals("2")) {
|
||||
c = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 51:
|
||||
if (type.equals("3")) {
|
||||
c = 2;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (c == 0) {
|
||||
PreviewPartListFragment.this.connectionWork.add(diyPartModel);
|
||||
} else if (c == 1) {
|
||||
PreviewPartListFragment.this.decorateWork.add(diyPartModel);
|
||||
} else if (c == 2) {
|
||||
PreviewPartListFragment.this.lineWork.add(diyPartModel);
|
||||
} else if (!PreviewPartListFragment.this.listElectNetWork.contains(diyPartModel)) {
|
||||
PreviewPartListFragment.this.listElectNetWork.add(diyPartModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (PreviewPartListFragment.this.connectionWork.size() > 0) {
|
||||
arrayList.add(1);
|
||||
}
|
||||
if (PreviewPartListFragment.this.decorateWork.size() > 0) {
|
||||
arrayList.add(2);
|
||||
}
|
||||
if (PreviewPartListFragment.this.lineWork.size() > 0) {
|
||||
arrayList.add(3);
|
||||
}
|
||||
if (PreviewPartListFragment.this.listElectNetWork.size() > 0) {
|
||||
arrayList.add(4);
|
||||
}
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(activity, 1, false);
|
||||
PartAllAdapter partAllAdapter = new PartAllAdapter(activity, arrayList, PreviewPartListFragment.this.listElectNetWork, PreviewPartListFragment.this.connectionWork, PreviewPartListFragment.this.decorateWork, PreviewPartListFragment.this.lineWork, PreviewPartListFragment.this.recyclerView, false);
|
||||
PreviewPartListFragment.this.recyclerView.setLayoutManager(linearLayoutManager);
|
||||
PreviewPartListFragment.this.recyclerView.setAdapter(partAllAdapter);
|
||||
PreviewPartListFragment.this.recyclerView.a(new DividerItemDecoration(activity, 1));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.fragment.browse.BrowseFragment
|
||||
public int getIndex() {
|
||||
return this.mIndex;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.fragment.browse.BrowseFragment
|
||||
public String getTitle() {
|
||||
return this.mTitle;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.fragment.browse.BrowseFragment, com.ubt.jimu.community.activity.LazyLoadFragment
|
||||
protected void loadData() {
|
||||
requestData();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.activity.LazyLoadFragment, com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
if (getArguments() != null) {
|
||||
this.mIndex = getArguments().getInt(INDEX);
|
||||
this.modelId = getArguments().getLong(MODEL_ID);
|
||||
this.mParam2 = getArguments().getString(ARG_PARAM2);
|
||||
}
|
||||
}
|
||||
|
||||
@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.fragment_preview_part_list, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
this.recyclerView.setLoadingListener(this);
|
||||
this.recyclerView.setPullRefreshEnabled(false);
|
||||
return inflate;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroyView() {
|
||||
this.mBind.unbind();
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
this.mListener = null;
|
||||
}
|
||||
|
||||
@Override // com.recyclelib.URecyclerView.LoadingListener
|
||||
public void onLoadingMore() {
|
||||
this.recyclerView.z();
|
||||
}
|
||||
|
||||
@Override // com.recyclelib.URecyclerView.LoadingListener
|
||||
public void onRefreshing() {
|
||||
this.loadingView.setIsRefresh(true);
|
||||
requestData();
|
||||
}
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
package com.ubt.jimu.diy.view.fragment.browse;
|
||||
|
||||
import android.view.View;
|
||||
import butterknife.Unbinder;
|
||||
import butterknife.internal.Utils;
|
||||
import com.recyclelib.URecyclerView;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class PreviewPartListFragment_ViewBinding implements Unbinder {
|
||||
private PreviewPartListFragment target;
|
||||
|
||||
public PreviewPartListFragment_ViewBinding(PreviewPartListFragment previewPartListFragment, View view) {
|
||||
this.target = previewPartListFragment;
|
||||
previewPartListFragment.recyclerView = (URecyclerView) Utils.b(view, R.id.recyclerView, "field 'recyclerView'", URecyclerView.class);
|
||||
previewPartListFragment.loadingView = (LoadingView) Utils.b(view, R.id.loadingView, "field 'loadingView'", LoadingView.class);
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
PreviewPartListFragment previewPartListFragment = this.target;
|
||||
if (previewPartListFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
previewPartListFragment.recyclerView = null;
|
||||
previewPartListFragment.loadingView = null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,99 @@
|
||||
package com.ubt.jimu.diy.view.fragment.browse;
|
||||
|
||||
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 android.widget.TextView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.ubt.jimu.R;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class PreviewStepDescFragment extends BrowseFragment {
|
||||
private static final String DESCRIPTION = "param2";
|
||||
private static final String INDEX = "index";
|
||||
private static final String LOGO_RES_ID = "logoResId";
|
||||
private static final String POSITION = "position";
|
||||
private String description;
|
||||
protected ImageView imgProcessLogo;
|
||||
private int logoResId;
|
||||
private Unbinder mBind;
|
||||
private int mIndex;
|
||||
private OnFragmentInteractionListener mListener;
|
||||
private int position;
|
||||
protected TextView tvPosition;
|
||||
protected TextView tvProcessDesc;
|
||||
|
||||
public interface OnFragmentInteractionListener {
|
||||
}
|
||||
|
||||
public static PreviewStepDescFragment newInstance(int i, int i2, String str, int i3) {
|
||||
PreviewStepDescFragment previewStepDescFragment = new PreviewStepDescFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt(INDEX, i);
|
||||
bundle.putInt(LOGO_RES_ID, i2);
|
||||
bundle.putString(DESCRIPTION, str);
|
||||
bundle.putInt("position", i3);
|
||||
previewStepDescFragment.setArguments(bundle);
|
||||
return previewStepDescFragment;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.fragment.browse.BrowseFragment
|
||||
public int getIndex() {
|
||||
return this.mIndex;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.fragment.browse.BrowseFragment
|
||||
public String getTitle() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.activity.LazyLoadFragment, com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
if (getArguments() != null) {
|
||||
this.mIndex = getArguments().getInt(INDEX);
|
||||
this.position = getArguments().getInt("position");
|
||||
this.logoResId = getArguments().getInt(LOGO_RES_ID);
|
||||
this.description = getArguments().getString(DESCRIPTION);
|
||||
}
|
||||
}
|
||||
|
||||
@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.fragment_process_desc, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
this.imgProcessLogo.setImageResource(this.logoResId);
|
||||
this.tvProcessDesc.setText(this.description);
|
||||
this.tvPosition.setText("0" + this.position);
|
||||
return inflate;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroyView() {
|
||||
this.mBind.unbind();
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
this.mListener = null;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.fragment.browse.BrowseFragment, com.ubtech.view.fragment.BaseFragment
|
||||
protected void onPageResume() {
|
||||
super.onPageResume();
|
||||
}
|
||||
|
||||
public void onProcessLogo(View view) {
|
||||
}
|
||||
}
|
@@ -0,0 +1,55 @@
|
||||
package com.ubt.jimu.diy.view.fragment.browse;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import butterknife.Unbinder;
|
||||
import butterknife.internal.DebouncingOnClickListener;
|
||||
import butterknife.internal.Utils;
|
||||
import com.ubt.jimu.R;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class PreviewStepDescFragment_ViewBinding implements Unbinder {
|
||||
private PreviewStepDescFragment target;
|
||||
private View view7f090269;
|
||||
private View view7f090558;
|
||||
|
||||
public PreviewStepDescFragment_ViewBinding(final PreviewStepDescFragment previewStepDescFragment, View view) {
|
||||
this.target = previewStepDescFragment;
|
||||
View a = Utils.a(view, R.id.imgProcessLogo, "field 'imgProcessLogo' and method 'onProcessLogo'");
|
||||
previewStepDescFragment.imgProcessLogo = (ImageView) Utils.a(a, R.id.imgProcessLogo, "field 'imgProcessLogo'", ImageView.class);
|
||||
this.view7f090269 = a;
|
||||
a.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.PreviewStepDescFragment_ViewBinding.1
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
previewStepDescFragment.onProcessLogo(view2);
|
||||
}
|
||||
});
|
||||
View a2 = Utils.a(view, R.id.tvProcessDesc, "field 'tvProcessDesc' and method 'onProcessLogo'");
|
||||
previewStepDescFragment.tvProcessDesc = (TextView) Utils.a(a2, R.id.tvProcessDesc, "field 'tvProcessDesc'", TextView.class);
|
||||
this.view7f090558 = a2;
|
||||
a2.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.browse.PreviewStepDescFragment_ViewBinding.2
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
previewStepDescFragment.onProcessLogo(view2);
|
||||
}
|
||||
});
|
||||
previewStepDescFragment.tvPosition = (TextView) Utils.b(view, R.id.tv_position, "field 'tvPosition'", TextView.class);
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
PreviewStepDescFragment previewStepDescFragment = this.target;
|
||||
if (previewStepDescFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
previewStepDescFragment.imgProcessLogo = null;
|
||||
previewStepDescFragment.tvProcessDesc = null;
|
||||
previewStepDescFragment.tvPosition = null;
|
||||
this.view7f090269.setOnClickListener(null);
|
||||
this.view7f090269 = null;
|
||||
this.view7f090558.setOnClickListener(null);
|
||||
this.view7f090558 = null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user