Initial commit
This commit is contained in:
132
sources/com/ubt/jimu/diy/view/fragment/BuildStepFragment.java
Normal file
132
sources/com/ubt/jimu/diy/view/fragment/BuildStepFragment.java
Normal file
@@ -0,0 +1,132 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.diy.model.DiyBuildModel;
|
||||
import com.ubt.jimu.diy.view.adapter.DiyBuildStepAdapter;
|
||||
import com.ubt.jimu.utils.SPUtils;
|
||||
import com.ubt.jimu.utils.smartScaleTool.ScreenUtils;
|
||||
import com.ubt.jimu.widgets.SpaceItemDecoration;
|
||||
import com.ubt.jimu.widgets.TitleDiyView;
|
||||
import com.ubtech.utils.DisplayUtil;
|
||||
import com.ubtech.utils.StringUtils;
|
||||
import com.ubtech.view.fragment.BaseFragment;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class BuildStepFragment extends BaseFragment {
|
||||
public static final String UUID = "uuid";
|
||||
private List<DiyBuildModel> fLists;
|
||||
public boolean isShowSingle = true;
|
||||
private DiyBuildStepAdapter mBuildAdapter;
|
||||
private RecyclerView rvBuild;
|
||||
private TitleDiyView title;
|
||||
private String uuid;
|
||||
|
||||
private void bindClick() {
|
||||
this.title.setRightListener(new TitleDiyView.RightOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.BuildStepFragment.1
|
||||
@Override // com.ubt.jimu.widgets.TitleDiyView.RightOnClickListener
|
||||
public void onClick() {
|
||||
BuildStepFragment buildStepFragment = BuildStepFragment.this;
|
||||
buildStepFragment.isShowSingle = !buildStepFragment.isShowSingle;
|
||||
buildStepFragment.mBuildAdapter.isEdit(!BuildStepFragment.this.isShowSingle);
|
||||
BuildStepFragment buildStepFragment2 = BuildStepFragment.this;
|
||||
if (!buildStepFragment2.isShowSingle) {
|
||||
buildStepFragment2.title.setDiyRightResource(R.drawable.diy_step_cancel);
|
||||
BuildStepFragment.this.title.setDiyPreRightResource(R.drawable.diy_step_delete);
|
||||
BuildStepFragment.this.mBuildAdapter.notifyDataSetChanged();
|
||||
return;
|
||||
}
|
||||
buildStepFragment2.title.setDiyRightResource(R.drawable.diy_edit_nor);
|
||||
BuildStepFragment.this.title.setDiyPreRightResource(0);
|
||||
for (int size = BuildStepFragment.this.fLists.size(); size > 0; size--) {
|
||||
((DiyBuildModel) BuildStepFragment.this.fLists.get(size - 1)).setDelete(false);
|
||||
}
|
||||
BuildStepFragment.this.mBuildAdapter.notifyChanged(BuildStepFragment.this.fLists);
|
||||
SPUtils.a(StringUtils.c(BuildStepFragment.this.uuid), BuildStepFragment.this.fLists);
|
||||
}
|
||||
});
|
||||
this.title.setPreRightListener(new TitleDiyView.PreRightOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.BuildStepFragment.2
|
||||
@Override // com.ubt.jimu.widgets.TitleDiyView.PreRightOnClickListener
|
||||
public void onClick() {
|
||||
BuildStepFragment.this.mBuildAdapter.isEdit(false);
|
||||
BuildStepFragment.this.title.setDiyRightResource(R.drawable.diy_edit_nor);
|
||||
BuildStepFragment.this.title.setDiyPreRightResource(0);
|
||||
for (int size = BuildStepFragment.this.fLists.size(); size > 0; size--) {
|
||||
int i = size - 1;
|
||||
if (((DiyBuildModel) BuildStepFragment.this.fLists.get(i)).isDelete()) {
|
||||
BuildStepFragment.this.fLists.remove(i);
|
||||
}
|
||||
}
|
||||
BuildStepFragment.this.mBuildAdapter.notifyChanged(BuildStepFragment.this.fLists);
|
||||
SPUtils.a(StringUtils.c(BuildStepFragment.this.uuid), BuildStepFragment.this.fLists);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void configWh() {
|
||||
this.rvBuild.post(new Runnable() { // from class: com.ubt.jimu.diy.view.fragment.BuildStepFragment.3
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
BuildStepFragment.this.mBuildAdapter.setWh(ScreenUtils.a(0.6666667f, BuildStepFragment.this.rvBuild, ((BaseFragment) BuildStepFragment.this).mActivity.getResources().getDimension(R.dimen.diy_edit_list_left), 3));
|
||||
BuildStepFragment.this.mBuildAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static BuildStepFragment create(String str) {
|
||||
BuildStepFragment buildStepFragment = new BuildStepFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(UUID, str);
|
||||
buildStepFragment.setArguments(bundle);
|
||||
return buildStepFragment;
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
this.uuid = getArguments().getString(UUID);
|
||||
this.title.setDiyTitle(this.mActivity.getString(R.string.diy_step));
|
||||
this.title.setDiyRightResource(R.drawable.diy_edit_nor);
|
||||
this.mBuildAdapter = new DiyBuildStepAdapter(this.mActivity, this.fLists);
|
||||
this.rvBuild.setLayoutManager(new GridLayoutManager(this.mActivity, 3));
|
||||
this.rvBuild.setAdapter(this.mBuildAdapter);
|
||||
this.mBuildAdapter.setUUID(this.uuid);
|
||||
RecyclerView recyclerView = this.rvBuild;
|
||||
Activity activity = this.mActivity;
|
||||
int a = DisplayUtil.a(activity, activity.getResources().getDimension(R.dimen.diy_edit_list_bottom));
|
||||
Activity activity2 = this.mActivity;
|
||||
recyclerView.a(new SpaceItemDecoration(a, DisplayUtil.a(activity2, activity2.getResources().getDimension(R.dimen.diy_edit_list_left)), 3));
|
||||
configWh();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
this.title = (TitleDiyView) ((BaseFragment) this).mView.findViewById(R.id.title);
|
||||
this.rvBuild = (RecyclerView) ((BaseFragment) this).mView.findViewById(R.id.rv_build);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
return layoutInflater.inflate(R.layout.fragment_build, viewGroup, false);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
this.fLists = (List) SPUtils.c(StringUtils.c(this.uuid));
|
||||
this.mBuildAdapter.notifyChanged(this.fLists);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onViewCreated(View view, Bundle bundle) {
|
||||
super.onViewCreated(view, bundle);
|
||||
((BaseFragment) this).mView = view;
|
||||
initView();
|
||||
initData();
|
||||
bindClick();
|
||||
}
|
||||
}
|
@@ -0,0 +1,91 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubtech.view.fragment.BaseFragment;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class CreateRobotFragment extends BaseFragment {
|
||||
private static final String ARG_PARAM1 = "param1";
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
protected Button btnCreate;
|
||||
protected CardView cvContent;
|
||||
protected EditText edtRobotName;
|
||||
private Unbinder mBind;
|
||||
private OnFragmentInteractionListener mListener;
|
||||
private String mParam1;
|
||||
private String mParam2;
|
||||
|
||||
public interface OnFragmentInteractionListener {
|
||||
void onCreateRobot(String str, String str2);
|
||||
}
|
||||
|
||||
public static CreateRobotFragment newInstance(String str, String str2) {
|
||||
CreateRobotFragment createRobotFragment = new CreateRobotFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(ARG_PARAM1, str);
|
||||
bundle.putString(ARG_PARAM2, str2);
|
||||
createRobotFragment.setArguments(bundle);
|
||||
return createRobotFragment;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
if (context instanceof OnFragmentInteractionListener) {
|
||||
this.mListener = (OnFragmentInteractionListener) context;
|
||||
}
|
||||
}
|
||||
|
||||
protected void onBtnCreate(View view) {
|
||||
OnFragmentInteractionListener onFragmentInteractionListener = this.mListener;
|
||||
if (onFragmentInteractionListener != null) {
|
||||
onFragmentInteractionListener.onCreateRobot("robot's name", "path/to/image");
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, 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 // 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_create_robot, viewGroup, false);
|
||||
inflate.setBackground(new ColorDrawable(Color.argb(200, 155, 155, 155)));
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
return inflate;
|
||||
}
|
||||
|
||||
protected void onCvContent(View view) {
|
||||
getActivity().getSupportFragmentManager().d();
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import butterknife.Unbinder;
|
||||
import butterknife.internal.DebouncingOnClickListener;
|
||||
import butterknife.internal.Utils;
|
||||
import com.ubt.jimu.R;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class CreateRobotFragment_ViewBinding implements Unbinder {
|
||||
private CreateRobotFragment target;
|
||||
private View view7f09008c;
|
||||
private View view7f0900ff;
|
||||
|
||||
public CreateRobotFragment_ViewBinding(final CreateRobotFragment createRobotFragment, View view) {
|
||||
this.target = createRobotFragment;
|
||||
View a = Utils.a(view, R.id.cvContent, "field 'cvContent' and method 'onCvContent'");
|
||||
createRobotFragment.cvContent = (CardView) Utils.a(a, R.id.cvContent, "field 'cvContent'", CardView.class);
|
||||
this.view7f0900ff = a;
|
||||
a.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.CreateRobotFragment_ViewBinding.1
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
createRobotFragment.onCvContent(view2);
|
||||
}
|
||||
});
|
||||
createRobotFragment.edtRobotName = (EditText) Utils.b(view, R.id.edtRobotName, "field 'edtRobotName'", EditText.class);
|
||||
View a2 = Utils.a(view, R.id.btn_sure, "field 'btnCreate' and method 'onBtnCreate'");
|
||||
createRobotFragment.btnCreate = (Button) Utils.a(a2, R.id.btn_sure, "field 'btnCreate'", Button.class);
|
||||
this.view7f09008c = a2;
|
||||
a2.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.CreateRobotFragment_ViewBinding.2
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
createRobotFragment.onBtnCreate(view2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
CreateRobotFragment createRobotFragment = this.target;
|
||||
if (createRobotFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
createRobotFragment.cvContent = null;
|
||||
createRobotFragment.edtRobotName = null;
|
||||
createRobotFragment.btnCreate = null;
|
||||
this.view7f0900ff.setOnClickListener(null);
|
||||
this.view7f0900ff = null;
|
||||
this.view7f09008c.setOnClickListener(null);
|
||||
this.view7f09008c = null;
|
||||
}
|
||||
}
|
281
sources/com/ubt/jimu/diy/view/fragment/CreativeFragment.java
Normal file
281
sources/com/ubt/jimu/diy/view/fragment/CreativeFragment.java
Normal file
@@ -0,0 +1,281 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.db.diy.DiyDBModel;
|
||||
import com.ubt.jimu.base.db.diy.DiyHelper;
|
||||
import com.ubt.jimu.base.db.user.UserDbHandler;
|
||||
import com.ubt.jimu.base.entities.User;
|
||||
import com.ubt.jimu.base.http.ApiResponse;
|
||||
import com.ubt.jimu.transport3.DiyTransportServiceImpl;
|
||||
import com.ubt.jimu.transport3.bean.response.SaveOrUpdateModelBean;
|
||||
import com.ubt.jimu.transport3.dao.DiyDBModelDBHandler;
|
||||
import com.ubt.jimu.utils.LogUtils;
|
||||
import com.ubt.jimu.utils.SystemUtils;
|
||||
import com.ubt.jimu.utils.TextUtils;
|
||||
import com.ubt.jimu.widgets.NavigationBarView;
|
||||
import com.ubtech.utils.StringUtils;
|
||||
import com.ubtech.view.fragment.BaseFragment;
|
||||
import com.ubtrobot.log.ALog;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class CreativeFragment extends BaseFragment {
|
||||
EditText etIntro;
|
||||
EditText etTitle;
|
||||
private Unbinder mBind;
|
||||
private DiyDBModel mDb;
|
||||
private String mName;
|
||||
NavigationBarView mNavBarView;
|
||||
private CompositeDisposable disposables = new CompositeDisposable();
|
||||
private boolean updating = false;
|
||||
|
||||
static /* synthetic */ CharSequence a(CharSequence charSequence, int i, int i2, Spanned spanned, int i3, int i4) {
|
||||
if (Pattern.compile("[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]").matcher(charSequence.toString()).find()) {
|
||||
return "";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void bindClick() {
|
||||
this.etTitle.addTextChangedListener(new TextWatcher() { // from class: com.ubt.jimu.diy.view.fragment.CreativeFragment.1
|
||||
@Override // android.text.TextWatcher
|
||||
public void afterTextChanged(Editable editable) {
|
||||
EditText editText = CreativeFragment.this.etTitle;
|
||||
TextUtils.a(editText, editText.getText().toString().trim());
|
||||
boolean enable = CreativeFragment.this.enable();
|
||||
CreativeFragment.this.mNavBarView.setRightEnabled(enable);
|
||||
CreativeFragment.this.mNavBarView.setRightAlpha(enable ? 1.0f : 0.3f);
|
||||
}
|
||||
|
||||
@Override // android.text.TextWatcher
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
||||
}
|
||||
|
||||
@Override // android.text.TextWatcher
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
||||
}
|
||||
});
|
||||
this.etIntro.addTextChangedListener(new TextWatcher() { // from class: com.ubt.jimu.diy.view.fragment.CreativeFragment.2
|
||||
@Override // android.text.TextWatcher
|
||||
public void afterTextChanged(Editable editable) {
|
||||
EditText editText = CreativeFragment.this.etIntro;
|
||||
TextUtils.a(editText, editText.getText().toString().trim());
|
||||
boolean enable = CreativeFragment.this.enable();
|
||||
CreativeFragment.this.mNavBarView.setRightEnabled(enable);
|
||||
CreativeFragment.this.mNavBarView.setRightAlpha(enable ? 1.0f : 0.3f);
|
||||
}
|
||||
|
||||
@Override // android.text.TextWatcher
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
||||
}
|
||||
|
||||
@Override // android.text.TextWatcher
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
||||
}
|
||||
});
|
||||
this.mNavBarView.setListener(new NavigationBarView.OnActionClickListener.Stub() { // from class: com.ubt.jimu.diy.view.fragment.CreativeFragment.3
|
||||
@Override // com.ubt.jimu.widgets.NavigationBarView.OnActionClickListener.Stub
|
||||
public void onRightClick(View view) {
|
||||
if (StringUtils.e(CreativeFragment.this.etTitle.getText().toString())) {
|
||||
return;
|
||||
}
|
||||
Editable text = CreativeFragment.this.etIntro.getText();
|
||||
if (text != null && !android.text.TextUtils.isEmpty(text.toString().trim())) {
|
||||
CreativeFragment.this.mDb.setStep1state(1);
|
||||
}
|
||||
CreativeFragment.this.mDb.setModelName(CreativeFragment.this.etTitle.getText().toString().trim());
|
||||
CreativeFragment.this.mDb.setDescription(CreativeFragment.this.etIntro.getText().toString().trim());
|
||||
CreativeFragment creativeFragment = CreativeFragment.this;
|
||||
creativeFragment.updateDiyModel(creativeFragment.mDb);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static CreativeFragment create(String str) {
|
||||
CreativeFragment creativeFragment = new CreativeFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(BuildStepFragment.UUID, str);
|
||||
creativeFragment.setArguments(bundle);
|
||||
return creativeFragment;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public boolean enable() {
|
||||
Editable text;
|
||||
String obj = this.etTitle.getText().toString();
|
||||
if (StringUtils.e(obj) || (text = this.etIntro.getText()) == null || android.text.TextUtils.isEmpty(text.toString().trim())) {
|
||||
return false;
|
||||
}
|
||||
boolean z = !obj.trim().equals(this.mDb.getModelName());
|
||||
String trim = this.etIntro.getText().toString().trim();
|
||||
return z || ((android.text.TextUtils.isEmpty(trim) ? android.text.TextUtils.isEmpty(this.mDb.getDescription()) : trim.equals(this.mDb.getDescription())) ^ true);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void finishActivity() {
|
||||
this.mNavBarView.post(new Runnable() { // from class: com.ubt.jimu.diy.view.fragment.a
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
CreativeFragment.this.b();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
this.mName = getArguments().getString(BuildStepFragment.UUID);
|
||||
this.mDb = DiyHelper.getInstance().queryForUUid(this.mName);
|
||||
DiyDBModel diyDBModel = this.mDb;
|
||||
if (diyDBModel == null) {
|
||||
return;
|
||||
}
|
||||
boolean z = (android.text.TextUtils.isEmpty(diyDBModel.getModelName()) || android.text.TextUtils.isEmpty(this.mDb.getDescription())) ? false : true;
|
||||
this.mNavBarView.setRightIcon(R.drawable.ic_nav_finish);
|
||||
this.mNavBarView.setRightEnabled(z);
|
||||
this.mNavBarView.setRightAlpha(z ? 1.0f : 0.3f);
|
||||
this.etTitle.setText(this.mDb.getModelName());
|
||||
if (!android.text.TextUtils.isEmpty(this.mDb.getModelName())) {
|
||||
this.etTitle.setSelection(this.mDb.getModelName().length());
|
||||
}
|
||||
this.etTitle.setFilters(new InputFilter[]{new InputFilter() { // from class: com.ubt.jimu.diy.view.fragment.b
|
||||
@Override // android.text.InputFilter
|
||||
public final CharSequence filter(CharSequence charSequence, int i, int i2, Spanned spanned, int i3, int i4) {
|
||||
return CreativeFragment.a(charSequence, i, i2, spanned, i3, i4);
|
||||
}
|
||||
}, new InputFilter.LengthFilter(20)});
|
||||
this.etIntro.setText(this.mDb.getDescription());
|
||||
if (StringUtils.e(this.mDb.getDescription())) {
|
||||
return;
|
||||
}
|
||||
this.etIntro.setSelection(this.mDb.getDescription().length());
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void updateDiyModel(final DiyDBModel diyDBModel) {
|
||||
if (this.updating) {
|
||||
return;
|
||||
}
|
||||
this.updating = true;
|
||||
Observable.create(new ObservableOnSubscribe<DiyDBModel>() { // from class: com.ubt.jimu.diy.view.fragment.CreativeFragment.5
|
||||
@Override // io.reactivex.ObservableOnSubscribe
|
||||
public void subscribe(ObservableEmitter<DiyDBModel> observableEmitter) throws Exception {
|
||||
long a = SystemUtils.a();
|
||||
diyDBModel.setLastUploadTime(a);
|
||||
diyDBModel.setModifyTime(a);
|
||||
diyDBModel.setIsModify(true);
|
||||
DiyDBModelDBHandler.getInstance().update(diyDBModel);
|
||||
observableEmitter.onNext(diyDBModel);
|
||||
observableEmitter.onComplete();
|
||||
}
|
||||
}).subscribeOn(Schedulers.b()).observeOn(AndroidSchedulers.a()).subscribe(new Observer<DiyDBModel>() { // from class: com.ubt.jimu.diy.view.fragment.CreativeFragment.4
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
th.printStackTrace();
|
||||
CreativeFragment.this.updating = false;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
CreativeFragment.this.disposables.b(disposable);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onNext(DiyDBModel diyDBModel2) {
|
||||
Integer modelId = diyDBModel2.getModelId();
|
||||
User user = UserDbHandler.getUser();
|
||||
if (modelId.intValue() > 0 && user != null && user.getUserId() > 0) {
|
||||
CreativeFragment.this.uploadDiyDbModel(diyDBModel2);
|
||||
return;
|
||||
}
|
||||
CreativeFragment.this.updating = false;
|
||||
LogUtils.c("完成~~~");
|
||||
CreativeFragment.this.finishActivity();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void uploadDiyDbModel(DiyDBModel diyDBModel) {
|
||||
DiyTransportServiceImpl.getInstance().updateModel(diyDBModel, new Observer<ApiResponse<SaveOrUpdateModelBean>>() { // from class: com.ubt.jimu.diy.view.fragment.CreativeFragment.6
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
CreativeFragment.this.updating = false;
|
||||
ALog.a(CreativeFragment.this.TAG).d("更新模型错误");
|
||||
CreativeFragment.this.finishActivity();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
CreativeFragment.this.disposables.b(disposable);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onNext(ApiResponse<SaveOrUpdateModelBean> apiResponse) {
|
||||
CreativeFragment.this.updating = false;
|
||||
if (apiResponse.isStatus()) {
|
||||
ALog.a(CreativeFragment.this.TAG).d("更新模型成功");
|
||||
} else {
|
||||
ALog.a(CreativeFragment.this.TAG).d("更新模型失败");
|
||||
}
|
||||
CreativeFragment.this.finishActivity();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public /* synthetic */ void b() {
|
||||
this.mActivity.finish();
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
return layoutInflater.inflate(R.layout.fragment_creative, viewGroup, false);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroy() {
|
||||
this.disposables.dispose();
|
||||
this.disposables.a();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroyView() {
|
||||
this.mBind.unbind();
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onViewCreated(View view, Bundle bundle) {
|
||||
super.onViewCreated(view, bundle);
|
||||
this.mBind = ButterKnife.a(this, view);
|
||||
((BaseFragment) this).mView = view;
|
||||
initData();
|
||||
bindClick();
|
||||
}
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import butterknife.Unbinder;
|
||||
import butterknife.internal.Utils;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.widgets.NavigationBarView;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class CreativeFragment_ViewBinding implements Unbinder {
|
||||
private CreativeFragment target;
|
||||
|
||||
public CreativeFragment_ViewBinding(CreativeFragment creativeFragment, View view) {
|
||||
this.target = creativeFragment;
|
||||
creativeFragment.mNavBarView = (NavigationBarView) Utils.b(view, R.id.nbv_bar, "field 'mNavBarView'", NavigationBarView.class);
|
||||
creativeFragment.etTitle = (EditText) Utils.b(view, R.id.et_title, "field 'etTitle'", EditText.class);
|
||||
creativeFragment.etIntro = (EditText) Utils.b(view, R.id.et_intro, "field 'etIntro'", EditText.class);
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
CreativeFragment creativeFragment = this.target;
|
||||
if (creativeFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
creativeFragment.mNavBarView = null;
|
||||
creativeFragment.etTitle = null;
|
||||
creativeFragment.etIntro = null;
|
||||
}
|
||||
}
|
288
sources/com/ubt/jimu/diy/view/fragment/DiyCenterFragment.java
Normal file
288
sources/com/ubt/jimu/diy/view/fragment/DiyCenterFragment.java
Normal file
@@ -0,0 +1,288 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewStub;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.ubt.jimu.JimuApplication;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.entities.Constant;
|
||||
import com.ubt.jimu.diy.view.adapter.FragmentViewPagerAdapter;
|
||||
import com.ubt.jimu.diy.view.adapter.UserDiyAdapter;
|
||||
import com.ubt.jimu.utils.CustomViewPager;
|
||||
import com.ubt.jimu.utils.LogUtils;
|
||||
import com.ubt.jimu.utils.SPUtils;
|
||||
import com.ubtech.view.fragment.BaseFragment;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyCenterFragment extends BaseFragment implements ViewPager.OnPageChangeListener, View.OnClickListener {
|
||||
private static final String ARG_PARAM1 = "param1";
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
private FragmentPagerAdapter adapter;
|
||||
protected CardView cv_diy_guide;
|
||||
protected FrameLayout fl_diy_guide;
|
||||
protected FrameLayout fl_guide_pop_title;
|
||||
protected ImageView im_diy_guide_content;
|
||||
protected ImageView im_guide_diy_1;
|
||||
protected ImageView im_guide_diy_cancel;
|
||||
protected ImageView im_guide_diy_title;
|
||||
protected ImageView im_official_demo_guide;
|
||||
protected ImageView imgBack;
|
||||
protected ImageView imgNewRobot;
|
||||
private boolean isShowGuide;
|
||||
private Unbinder mBind;
|
||||
private View mGuideView;
|
||||
private OnFragmentInteractionListener mListener;
|
||||
private String mParam1;
|
||||
private String mParam2;
|
||||
private View mView;
|
||||
private OfficialDiyFragment officialDiyFragment;
|
||||
private int position;
|
||||
protected RelativeLayout rl_diy_guide;
|
||||
protected RelativeLayout rl_gaussian_blur_layout;
|
||||
protected RelativeLayout rl_guide_my_title;
|
||||
private boolean titleGuideIsShow;
|
||||
protected ImageView tvEdit;
|
||||
protected TextView tvOfficialDiy;
|
||||
protected ImageView tvPublishHistory;
|
||||
protected TextView tvUserDiy;
|
||||
protected TextView tv_guide_pop_text;
|
||||
protected TextView tv_guide_title;
|
||||
protected TextView tv_guide_title_my;
|
||||
private UserDiyFragment userDiyFragment;
|
||||
protected CustomViewPager viewPager;
|
||||
protected ViewStub viewStub;
|
||||
private boolean isEdit = false;
|
||||
private List<Fragment> fragmentArray = new ArrayList();
|
||||
|
||||
public interface OnFragmentInteractionListener {
|
||||
void onDiyCenterBackClick();
|
||||
|
||||
void onPublishListClick();
|
||||
|
||||
void onUserDiyEditClick();
|
||||
|
||||
void onUserDiyPublishHistoryClick();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
this.tvUserDiy.setBackgroundResource(JimuApplication.l().i() ? R.drawable.diy_tab_bg_my : R.drawable.diy_tab_bg_my_phone);
|
||||
this.tvUserDiy.setEnabled(SPUtils.a(Constant.NoviceGuide.OFFICIAL_DIY_GUIDE_ON_CLOCK));
|
||||
this.tvOfficialDiy.setBackgroundResource(JimuApplication.l().i() ? R.drawable.diy_tab_bg_official : R.drawable.diy_tab_bg_official_phone);
|
||||
this.imgBack.setEnabled(SPUtils.a(Constant.NoviceGuide.OFFICIAL_DIY_GUIDE_ON_CLOCK));
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
boolean a = SPUtils.a(Constant.NoviceGuide.OFFICIAL_DIY_GUIDE_ON_CLOCK);
|
||||
this.viewPager.setScanScroll(a);
|
||||
if (a) {
|
||||
return;
|
||||
}
|
||||
this.mGuideView = this.viewStub.inflate();
|
||||
this.im_official_demo_guide = (ImageView) this.mGuideView.findViewById(R.id.im_official_demo_guide);
|
||||
this.im_guide_diy_1 = (ImageView) this.mGuideView.findViewById(R.id.im_guide_diy_1);
|
||||
this.tv_guide_title = (TextView) this.mGuideView.findViewById(R.id.tv_guide_title);
|
||||
this.im_guide_diy_cancel = (ImageView) this.mGuideView.findViewById(R.id.im_guide_diy_cancel);
|
||||
this.cv_diy_guide = (CardView) this.mGuideView.findViewById(R.id.cv_diy_guide);
|
||||
this.rl_diy_guide = (RelativeLayout) this.mGuideView.findViewById(R.id.rl_diy_guide);
|
||||
this.tv_guide_title_my = (TextView) this.mGuideView.findViewById(R.id.tv_guide_title_my);
|
||||
this.tv_guide_pop_text = (TextView) this.mGuideView.findViewById(R.id.tv_guide_pop_text);
|
||||
this.im_diy_guide_content = (ImageView) this.mGuideView.findViewById(R.id.im_diy_guide_content);
|
||||
this.fl_diy_guide = (FrameLayout) this.mGuideView.findViewById(R.id.fl_diy_guide);
|
||||
this.rl_gaussian_blur_layout = (RelativeLayout) this.mGuideView.findViewById(R.id.rl_gaussian_blur_layout);
|
||||
LogUtils.c("rl_gaussian_blur_layout:" + this.rl_gaussian_blur_layout);
|
||||
this.imgNewRobot = (ImageView) this.mGuideView.findViewById(R.id.imgNewRobot);
|
||||
this.rl_guide_my_title = (RelativeLayout) this.mGuideView.findViewById(R.id.rl_guide_my_title);
|
||||
this.im_guide_diy_title = (ImageView) this.mGuideView.findViewById(R.id.im_guide_diy_title);
|
||||
this.fl_guide_pop_title = (FrameLayout) this.mGuideView.findViewById(R.id.fl_guide_pop_title);
|
||||
this.rl_gaussian_blur_layout.setOnClickListener(this);
|
||||
this.im_guide_diy_cancel.setOnClickListener(this);
|
||||
}
|
||||
|
||||
private void isEditState(boolean z) {
|
||||
if (z) {
|
||||
this.tvEdit.setImageResource(R.drawable.diy_step_cancel);
|
||||
this.tvPublishHistory.setImageResource(R.drawable.diy_step_delete);
|
||||
this.tvPublishHistory.setVisibility(0);
|
||||
} else {
|
||||
this.tvPublishHistory.setVisibility(4);
|
||||
this.tvEdit.setImageResource(R.drawable.diy_tab_icon_edit_nor);
|
||||
this.tvPublishHistory.setImageResource(R.drawable.diy_tab_icon_history);
|
||||
}
|
||||
}
|
||||
|
||||
public static DiyCenterFragment newInstance(String str, String str2) {
|
||||
DiyCenterFragment diyCenterFragment = new DiyCenterFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(ARG_PARAM1, str);
|
||||
bundle.putString(ARG_PARAM2, str2);
|
||||
diyCenterFragment.setArguments(bundle);
|
||||
return diyCenterFragment;
|
||||
}
|
||||
|
||||
private void select(TextView textView, boolean z) {
|
||||
textView.setTextColor(getResources().getColor(z ? R.color.txt_FEAA06 : android.R.color.white));
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onActivityResult(int i, int i2, Intent intent) {
|
||||
super.onActivityResult(i, i2, intent);
|
||||
this.userDiyFragment.onActivityResult(i, i2, intent);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
LogUtils.c("onAttachonAttachonAttachonAttach");
|
||||
if (context instanceof OnFragmentInteractionListener) {
|
||||
this.mListener = (OnFragmentInteractionListener) context;
|
||||
}
|
||||
}
|
||||
|
||||
protected void onBack(View view) {
|
||||
OnFragmentInteractionListener onFragmentInteractionListener = this.mListener;
|
||||
if (onFragmentInteractionListener != null) {
|
||||
onFragmentInteractionListener.onDiyCenterBackClick();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, 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 // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
this.mView = layoutInflater.inflate(R.layout.fragment_diy_center, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, this.mView);
|
||||
this.userDiyFragment = UserDiyFragment.newInstance("", "");
|
||||
this.officialDiyFragment = OfficialDiyFragment.newInstance("", "");
|
||||
this.fragmentArray.add(this.officialDiyFragment);
|
||||
this.fragmentArray.add(this.userDiyFragment);
|
||||
this.adapter = new FragmentViewPagerAdapter(getFragmentManager(), this.fragmentArray);
|
||||
this.viewPager.setAdapter(this.adapter);
|
||||
this.viewPager.a(this);
|
||||
select(false);
|
||||
initView();
|
||||
initData();
|
||||
return this.mView;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
protected void onEdit(View view) {
|
||||
UserDiyFragment userDiyFragment;
|
||||
UserDiyAdapter userDiyAdapter;
|
||||
OnFragmentInteractionListener onFragmentInteractionListener = this.mListener;
|
||||
if (onFragmentInteractionListener != null) {
|
||||
onFragmentInteractionListener.onUserDiyEditClick();
|
||||
}
|
||||
int i = this.position;
|
||||
if (i == 0 || i != 1 || (userDiyFragment = this.userDiyFragment) == null || (userDiyAdapter = userDiyFragment.adapter) == null) {
|
||||
return;
|
||||
}
|
||||
this.isEdit = true ^ this.isEdit;
|
||||
userDiyAdapter.setEditState(this.isEdit);
|
||||
isEditState(this.isEdit);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onHiddenChanged(boolean z) {
|
||||
super.onHiddenChanged(z);
|
||||
boolean a = SPUtils.a(Constant.NoviceGuide.TITLE_NOVICE_GUIDE_KEY);
|
||||
boolean a2 = SPUtils.a(Constant.NoviceGuide.OFFICIAL_DIY_GUIDE_ON_CLOCK);
|
||||
LogUtils.c("hidden:" + z + " isShow:" + a + " aBoolean:" + a2);
|
||||
if (!a && !z && a2) {
|
||||
try {
|
||||
this.imgBack.setEnabled(true);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
LogUtils.c("onHiddenChanged_1:" + z);
|
||||
}
|
||||
|
||||
protected void onOfficialDiyTab(View view) {
|
||||
select(false);
|
||||
SPUtils.b(Constant.Black.BLACK_MODEL_TYPE_KEY, 0);
|
||||
this.viewPager.setCurrentItem(0);
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
||||
public void onPageScrollStateChanged(int i) {
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
||||
public void onPageScrolled(int i, float f, int i2) {
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
||||
public void onPageSelected(int i) {
|
||||
this.position = i;
|
||||
if (i == 0) {
|
||||
select(false);
|
||||
} else {
|
||||
select(true);
|
||||
isEditState(this.isEdit);
|
||||
}
|
||||
}
|
||||
|
||||
protected void onPublishHistory(View view) {
|
||||
if (this.isEdit) {
|
||||
this.userDiyFragment.adapter.isDeleteItem();
|
||||
}
|
||||
}
|
||||
|
||||
protected void onUserDiyTab(View view) {
|
||||
SPUtils.b(Constant.Black.BLACK_MODEL_TYPE_KEY, 1);
|
||||
this.viewPager.setCurrentItem(1);
|
||||
}
|
||||
|
||||
private void select(boolean z) {
|
||||
if (z) {
|
||||
select(this.tvUserDiy, true);
|
||||
select(this.tvOfficialDiy, false);
|
||||
this.tvEdit.setVisibility(0);
|
||||
this.tvPublishHistory.setVisibility(0);
|
||||
return;
|
||||
}
|
||||
select(this.tvUserDiy, false);
|
||||
select(this.tvOfficialDiy, true);
|
||||
this.tvEdit.setVisibility(4);
|
||||
this.tvPublishHistory.setVisibility(4);
|
||||
}
|
||||
}
|
@@ -0,0 +1,98 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
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.utils.CustomViewPager;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyCenterFragment_ViewBinding implements Unbinder {
|
||||
private DiyCenterFragment target;
|
||||
private View view7f090237;
|
||||
private View view7f090545;
|
||||
private View view7f090556;
|
||||
private View view7f09055a;
|
||||
private View view7f090564;
|
||||
|
||||
public DiyCenterFragment_ViewBinding(final DiyCenterFragment diyCenterFragment, View view) {
|
||||
this.target = diyCenterFragment;
|
||||
View a = Utils.a(view, R.id.tvOfficialDiy, "field 'tvOfficialDiy' and method 'onOfficialDiyTab'");
|
||||
diyCenterFragment.tvOfficialDiy = (TextView) Utils.a(a, R.id.tvOfficialDiy, "field 'tvOfficialDiy'", TextView.class);
|
||||
this.view7f090556 = a;
|
||||
a.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyCenterFragment_ViewBinding.1
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyCenterFragment.onOfficialDiyTab(view2);
|
||||
}
|
||||
});
|
||||
View a2 = Utils.a(view, R.id.tvUserDiy, "field 'tvUserDiy' and method 'onUserDiyTab'");
|
||||
diyCenterFragment.tvUserDiy = (TextView) Utils.a(a2, R.id.tvUserDiy, "field 'tvUserDiy'", TextView.class);
|
||||
this.view7f090564 = a2;
|
||||
a2.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyCenterFragment_ViewBinding.2
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyCenterFragment.onUserDiyTab(view2);
|
||||
}
|
||||
});
|
||||
View a3 = Utils.a(view, R.id.tvPublishHistory, "field 'tvPublishHistory' and method 'onPublishHistory'");
|
||||
diyCenterFragment.tvPublishHistory = (ImageView) Utils.a(a3, R.id.tvPublishHistory, "field 'tvPublishHistory'", ImageView.class);
|
||||
this.view7f09055a = a3;
|
||||
a3.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyCenterFragment_ViewBinding.3
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyCenterFragment.onPublishHistory(view2);
|
||||
}
|
||||
});
|
||||
View a4 = Utils.a(view, R.id.tvEdit, "field 'tvEdit' and method 'onEdit'");
|
||||
diyCenterFragment.tvEdit = (ImageView) Utils.a(a4, R.id.tvEdit, "field 'tvEdit'", ImageView.class);
|
||||
this.view7f090545 = a4;
|
||||
a4.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyCenterFragment_ViewBinding.4
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyCenterFragment.onEdit(view2);
|
||||
}
|
||||
});
|
||||
diyCenterFragment.viewPager = (CustomViewPager) Utils.b(view, R.id.viewPager, "field 'viewPager'", CustomViewPager.class);
|
||||
View a5 = Utils.a(view, R.id.imgBack, "field 'imgBack' and method 'onBack'");
|
||||
diyCenterFragment.imgBack = (ImageView) Utils.a(a5, R.id.imgBack, "field 'imgBack'", ImageView.class);
|
||||
this.view7f090237 = a5;
|
||||
a5.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyCenterFragment_ViewBinding.5
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyCenterFragment.onBack(view2);
|
||||
}
|
||||
});
|
||||
diyCenterFragment.viewStub = (ViewStub) Utils.b(view, R.id.viewStub, "field 'viewStub'", ViewStub.class);
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
DiyCenterFragment diyCenterFragment = this.target;
|
||||
if (diyCenterFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
diyCenterFragment.tvOfficialDiy = null;
|
||||
diyCenterFragment.tvUserDiy = null;
|
||||
diyCenterFragment.tvPublishHistory = null;
|
||||
diyCenterFragment.tvEdit = null;
|
||||
diyCenterFragment.viewPager = null;
|
||||
diyCenterFragment.imgBack = null;
|
||||
diyCenterFragment.viewStub = null;
|
||||
this.view7f090556.setOnClickListener(null);
|
||||
this.view7f090556 = null;
|
||||
this.view7f090564.setOnClickListener(null);
|
||||
this.view7f090564 = null;
|
||||
this.view7f09055a.setOnClickListener(null);
|
||||
this.view7f09055a = null;
|
||||
this.view7f090545.setOnClickListener(null);
|
||||
this.view7f090545 = null;
|
||||
this.view7f090237.setOnClickListener(null);
|
||||
this.view7f090237 = null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,107 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.ubt.jimu.R;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyDescriptionFragment extends Fragment {
|
||||
private static final String ARG_PARAM1 = "param1";
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
protected Button btnComplete;
|
||||
protected EditText edtRobotDescription;
|
||||
protected EditText edtRobotName;
|
||||
protected ImageView imgRight;
|
||||
private Unbinder mBind;
|
||||
private OnDiyDescriptionFragmentInteractionListener mListener;
|
||||
private String mParam1;
|
||||
private String mParam2;
|
||||
protected TextView tvTitle;
|
||||
|
||||
public interface OnDiyDescriptionFragmentInteractionListener {
|
||||
void onDiyDescriptionBack(View view);
|
||||
|
||||
void onDiyDescriptionComplete(String str, String str2);
|
||||
|
||||
void onDiyDescriptionHelp(View view);
|
||||
}
|
||||
|
||||
public static DiyDescriptionFragment newInstance(String str, String str2) {
|
||||
DiyDescriptionFragment diyDescriptionFragment = new DiyDescriptionFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(ARG_PARAM1, str);
|
||||
bundle.putString(ARG_PARAM2, str2);
|
||||
diyDescriptionFragment.setArguments(bundle);
|
||||
return diyDescriptionFragment;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
if (context instanceof OnDiyDescriptionFragmentInteractionListener) {
|
||||
this.mListener = (OnDiyDescriptionFragmentInteractionListener) context;
|
||||
}
|
||||
}
|
||||
|
||||
protected void onBack(View view) {
|
||||
OnDiyDescriptionFragmentInteractionListener onDiyDescriptionFragmentInteractionListener = this.mListener;
|
||||
if (onDiyDescriptionFragmentInteractionListener != null) {
|
||||
onDiyDescriptionFragmentInteractionListener.onDiyDescriptionBack(view);
|
||||
}
|
||||
}
|
||||
|
||||
protected void onComplete(View view) {
|
||||
OnDiyDescriptionFragmentInteractionListener onDiyDescriptionFragmentInteractionListener = this.mListener;
|
||||
if (onDiyDescriptionFragmentInteractionListener != null) {
|
||||
onDiyDescriptionFragmentInteractionListener.onDiyDescriptionComplete(this.edtRobotName.getText().toString(), this.edtRobotDescription.getText().toString());
|
||||
}
|
||||
}
|
||||
|
||||
@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_description, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
this.tvTitle.setText(R.string.title_diy_description);
|
||||
this.imgRight.setBackgroundResource(R.drawable.community_mypublish_icon);
|
||||
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;
|
||||
}
|
||||
|
||||
protected void onHelp(View view) {
|
||||
OnDiyDescriptionFragmentInteractionListener onDiyDescriptionFragmentInteractionListener = this.mListener;
|
||||
if (onDiyDescriptionFragmentInteractionListener != null) {
|
||||
onDiyDescriptionFragmentInteractionListener.onDiyDescriptionHelp(view);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,72 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
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 DiyDescriptionFragment_ViewBinding implements Unbinder {
|
||||
private DiyDescriptionFragment target;
|
||||
private View view7f09006c;
|
||||
private View view7f090237;
|
||||
private View view7f09026b;
|
||||
|
||||
public DiyDescriptionFragment_ViewBinding(final DiyDescriptionFragment diyDescriptionFragment, View view) {
|
||||
this.target = diyDescriptionFragment;
|
||||
diyDescriptionFragment.tvTitle = (TextView) Utils.b(view, R.id.tvTitle, "field 'tvTitle'", TextView.class);
|
||||
View a = Utils.a(view, R.id.imgRight, "field 'imgRight' and method 'onHelp'");
|
||||
diyDescriptionFragment.imgRight = (ImageView) Utils.a(a, R.id.imgRight, "field 'imgRight'", ImageView.class);
|
||||
this.view7f09026b = a;
|
||||
a.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyDescriptionFragment_ViewBinding.1
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyDescriptionFragment.onHelp(view2);
|
||||
}
|
||||
});
|
||||
diyDescriptionFragment.edtRobotName = (EditText) Utils.b(view, R.id.edtRobotName, "field 'edtRobotName'", EditText.class);
|
||||
diyDescriptionFragment.edtRobotDescription = (EditText) Utils.b(view, R.id.edtRobotDescription, "field 'edtRobotDescription'", EditText.class);
|
||||
View a2 = Utils.a(view, R.id.btnComplete, "field 'btnComplete' and method 'onComplete'");
|
||||
diyDescriptionFragment.btnComplete = (Button) Utils.a(a2, R.id.btnComplete, "field 'btnComplete'", Button.class);
|
||||
this.view7f09006c = a2;
|
||||
a2.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyDescriptionFragment_ViewBinding.2
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyDescriptionFragment.onComplete(view2);
|
||||
}
|
||||
});
|
||||
View a3 = Utils.a(view, R.id.imgBack, "method 'onBack'");
|
||||
this.view7f090237 = a3;
|
||||
a3.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyDescriptionFragment_ViewBinding.3
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyDescriptionFragment.onBack(view2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
DiyDescriptionFragment diyDescriptionFragment = this.target;
|
||||
if (diyDescriptionFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
diyDescriptionFragment.tvTitle = null;
|
||||
diyDescriptionFragment.imgRight = null;
|
||||
diyDescriptionFragment.edtRobotName = null;
|
||||
diyDescriptionFragment.edtRobotDescription = null;
|
||||
diyDescriptionFragment.btnComplete = null;
|
||||
this.view7f09026b.setOnClickListener(null);
|
||||
this.view7f09026b = null;
|
||||
this.view7f09006c.setOnClickListener(null);
|
||||
this.view7f09006c = null;
|
||||
this.view7f090237.setOnClickListener(null);
|
||||
this.view7f090237 = null;
|
||||
}
|
||||
}
|
130
sources/com/ubt/jimu/diy/view/fragment/DiyHomeFragment.java
Normal file
130
sources/com/ubt/jimu/diy/view/fragment/DiyHomeFragment.java
Normal file
@@ -0,0 +1,130 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
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 android.widget.Toast;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.ubt.jimu.JimuApplication;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubtech.view.fragment.BaseFragment;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyHomeFragment extends BaseFragment {
|
||||
private static final String ARG_PARAM1 = "param1";
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
protected ImageView imgRight;
|
||||
private Unbinder mBind;
|
||||
private OnBuildStepFragmentInteractionListener mListener;
|
||||
private String mParam1;
|
||||
private String mParam2;
|
||||
protected TextView tvTitle;
|
||||
|
||||
public interface OnBuildStepFragmentInteractionListener {
|
||||
void onImgRobotAction(View view);
|
||||
|
||||
void onImgRobotBuildStep(View view);
|
||||
|
||||
void onImgRobotDescription(View view);
|
||||
|
||||
void onImgRobotProgram(View view);
|
||||
|
||||
void onImgRobotShow(View view);
|
||||
}
|
||||
|
||||
public static DiyHomeFragment newInstance(String str, String str2) {
|
||||
DiyHomeFragment diyHomeFragment = new DiyHomeFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(ARG_PARAM1, str);
|
||||
bundle.putString(ARG_PARAM2, str2);
|
||||
diyHomeFragment.setArguments(bundle);
|
||||
return diyHomeFragment;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
if (context instanceof OnBuildStepFragmentInteractionListener) {
|
||||
this.mListener = (OnBuildStepFragmentInteractionListener) context;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, 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 // 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_home, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
this.tvTitle.setText("创意小风扇");
|
||||
this.imgRight.setBackgroundResource(R.drawable.community_mypublish_icon);
|
||||
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();
|
||||
this.mListener = null;
|
||||
}
|
||||
|
||||
protected void onImgBack(View view) {
|
||||
getActivity().finish();
|
||||
}
|
||||
|
||||
protected void onImgPublish(View view) {
|
||||
Toast.makeText(getContext(), JimuApplication.l().getResources().getString(R.string.post), 0).show();
|
||||
}
|
||||
|
||||
protected void onImgRobotAction(View view) {
|
||||
OnBuildStepFragmentInteractionListener onBuildStepFragmentInteractionListener = this.mListener;
|
||||
if (onBuildStepFragmentInteractionListener != null) {
|
||||
onBuildStepFragmentInteractionListener.onImgRobotAction(view);
|
||||
}
|
||||
}
|
||||
|
||||
protected void onImgRobotBuildStep(View view) {
|
||||
OnBuildStepFragmentInteractionListener onBuildStepFragmentInteractionListener = this.mListener;
|
||||
if (onBuildStepFragmentInteractionListener != null) {
|
||||
onBuildStepFragmentInteractionListener.onImgRobotBuildStep(view);
|
||||
}
|
||||
}
|
||||
|
||||
protected void onImgRobotDescription(View view) {
|
||||
OnBuildStepFragmentInteractionListener onBuildStepFragmentInteractionListener = this.mListener;
|
||||
if (onBuildStepFragmentInteractionListener != null) {
|
||||
onBuildStepFragmentInteractionListener.onImgRobotDescription(view);
|
||||
}
|
||||
}
|
||||
|
||||
protected void onImgRobotProgram(View view) {
|
||||
OnBuildStepFragmentInteractionListener onBuildStepFragmentInteractionListener = this.mListener;
|
||||
if (onBuildStepFragmentInteractionListener != null) {
|
||||
onBuildStepFragmentInteractionListener.onImgRobotProgram(view);
|
||||
}
|
||||
}
|
||||
|
||||
protected void onImgRobotShow(View view) {
|
||||
OnBuildStepFragmentInteractionListener onBuildStepFragmentInteractionListener = this.mListener;
|
||||
if (onBuildStepFragmentInteractionListener != null) {
|
||||
onBuildStepFragmentInteractionListener.onImgRobotShow(view);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,108 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
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 DiyHomeFragment_ViewBinding implements Unbinder {
|
||||
private DiyHomeFragment target;
|
||||
private View view7f090237;
|
||||
private View view7f09026b;
|
||||
private View view7f09026c;
|
||||
private View view7f09026d;
|
||||
private View view7f09026e;
|
||||
private View view7f09026f;
|
||||
private View view7f090270;
|
||||
|
||||
public DiyHomeFragment_ViewBinding(final DiyHomeFragment diyHomeFragment, View view) {
|
||||
this.target = diyHomeFragment;
|
||||
diyHomeFragment.tvTitle = (TextView) Utils.b(view, R.id.tvTitle, "field 'tvTitle'", TextView.class);
|
||||
View a = Utils.a(view, R.id.imgRight, "field 'imgRight' and method 'onImgPublish'");
|
||||
diyHomeFragment.imgRight = (ImageView) Utils.a(a, R.id.imgRight, "field 'imgRight'", ImageView.class);
|
||||
this.view7f09026b = a;
|
||||
a.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyHomeFragment_ViewBinding.1
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyHomeFragment.onImgPublish(view2);
|
||||
}
|
||||
});
|
||||
View a2 = Utils.a(view, R.id.imgBack, "method 'onImgBack'");
|
||||
this.view7f090237 = a2;
|
||||
a2.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyHomeFragment_ViewBinding.2
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyHomeFragment.onImgBack(view2);
|
||||
}
|
||||
});
|
||||
View a3 = Utils.a(view, R.id.imgRobotDescription, "method 'onImgRobotDescription'");
|
||||
this.view7f09026e = a3;
|
||||
a3.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyHomeFragment_ViewBinding.3
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyHomeFragment.onImgRobotDescription(view2);
|
||||
}
|
||||
});
|
||||
View a4 = Utils.a(view, R.id.imgRobotBuildStep, "method 'onImgRobotBuildStep'");
|
||||
this.view7f09026d = a4;
|
||||
a4.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyHomeFragment_ViewBinding.4
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyHomeFragment.onImgRobotBuildStep(view2);
|
||||
}
|
||||
});
|
||||
View a5 = Utils.a(view, R.id.imgRobotAction, "method 'onImgRobotAction'");
|
||||
this.view7f09026c = a5;
|
||||
a5.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyHomeFragment_ViewBinding.5
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyHomeFragment.onImgRobotAction(view2);
|
||||
}
|
||||
});
|
||||
View a6 = Utils.a(view, R.id.imgRobotProgram, "method 'onImgRobotProgram'");
|
||||
this.view7f09026f = a6;
|
||||
a6.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyHomeFragment_ViewBinding.6
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyHomeFragment.onImgRobotProgram(view2);
|
||||
}
|
||||
});
|
||||
View a7 = Utils.a(view, R.id.imgRobotShow, "method 'onImgRobotShow'");
|
||||
this.view7f090270 = a7;
|
||||
a7.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyHomeFragment_ViewBinding.7
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyHomeFragment.onImgRobotShow(view2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
DiyHomeFragment diyHomeFragment = this.target;
|
||||
if (diyHomeFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
diyHomeFragment.tvTitle = null;
|
||||
diyHomeFragment.imgRight = null;
|
||||
this.view7f09026b.setOnClickListener(null);
|
||||
this.view7f09026b = null;
|
||||
this.view7f090237.setOnClickListener(null);
|
||||
this.view7f090237 = null;
|
||||
this.view7f09026e.setOnClickListener(null);
|
||||
this.view7f09026e = null;
|
||||
this.view7f09026d.setOnClickListener(null);
|
||||
this.view7f09026d = null;
|
||||
this.view7f09026c.setOnClickListener(null);
|
||||
this.view7f09026c = null;
|
||||
this.view7f09026f.setOnClickListener(null);
|
||||
this.view7f09026f = null;
|
||||
this.view7f090270.setOnClickListener(null);
|
||||
this.view7f090270 = null;
|
||||
}
|
||||
}
|
138
sources/com/ubt/jimu/diy/view/fragment/DiyPartAllFragment.java
Normal file
138
sources/com/ubt/jimu/diy/view/fragment/DiyPartAllFragment.java
Normal file
@@ -0,0 +1,138 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.db.diy.DiyDBModel;
|
||||
import com.ubt.jimu.base.db.diy.DiyHelper;
|
||||
import com.ubt.jimu.base.db.diy.DiyStep2Helper;
|
||||
import com.ubt.jimu.base.db.diy.DiyStep2Model;
|
||||
import com.ubt.jimu.base.event.BaseEvent;
|
||||
import com.ubt.jimu.diy.model.DiyPartModel;
|
||||
import com.ubt.jimu.diy.view.Diy4BuildActivity;
|
||||
import com.ubt.jimu.diy.view.adapter.PartAllAdapter;
|
||||
import com.ubt.jimu.utils.SPUtils;
|
||||
import com.ubt.jimu.widgets.TitleDiyView;
|
||||
import com.ubtech.utils.StringUtils;
|
||||
import com.ubtech.view.fragment.BaseFragment;
|
||||
import java.util.ArrayList;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyPartAllFragment extends BaseFragment {
|
||||
public int count = 0;
|
||||
private ImageView mImgSure;
|
||||
private RecyclerView mRyPartAll;
|
||||
private TitleDiyView mTitle;
|
||||
private String mUuid;
|
||||
|
||||
private void bindClick() {
|
||||
this.mImgSure.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyPartAllFragment.1
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
DiyStep2Model queryForUUid = DiyStep2Helper.getInstance().queryForUUid(DiyPartAllFragment.this.mUuid);
|
||||
queryForUUid.setStep4state(1);
|
||||
DiyStep2Helper.getInstance().insertData(queryForUUid);
|
||||
DiyDBModel queryForUUid2 = DiyHelper.getInstance().queryForUUid(DiyPartAllFragment.this.mUuid);
|
||||
queryForUUid2.setStep2state(1);
|
||||
DiyHelper.getInstance().insertData(queryForUUid2);
|
||||
Diy4BuildActivity.start(((BaseFragment) DiyPartAllFragment.this).mActivity, ProductBuildFragment.class.getSimpleName());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static DiyPartAllFragment create(int i, String str) {
|
||||
DiyPartAllFragment diyPartAllFragment = new DiyPartAllFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(BuildStepFragment.UUID, str);
|
||||
bundle.putInt("count", i);
|
||||
diyPartAllFragment.setArguments(bundle);
|
||||
return diyPartAllFragment;
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
this.mUuid = getArguments().getString(BuildStepFragment.UUID);
|
||||
int i = 0;
|
||||
while (i < 4) {
|
||||
i++;
|
||||
arrayList.add(Integer.valueOf(i));
|
||||
}
|
||||
ArrayList arrayList2 = (ArrayList) SPUtils.c(StringUtils.a(this.mUuid, "Elect"));
|
||||
ArrayList arrayList3 = (ArrayList) SPUtils.c(StringUtils.a(this.mUuid, "connection"));
|
||||
ArrayList arrayList4 = (ArrayList) SPUtils.c(StringUtils.a(this.mUuid, "decorate"));
|
||||
ArrayList arrayList5 = (ArrayList) SPUtils.c(StringUtils.a(this.mUuid, "line"));
|
||||
this.count = getArguments().getInt("count");
|
||||
ArrayList arrayList6 = new ArrayList();
|
||||
ArrayList arrayList7 = new ArrayList();
|
||||
ArrayList arrayList8 = new ArrayList();
|
||||
ArrayList arrayList9 = new ArrayList();
|
||||
for (int i2 = 0; i2 < arrayList2.size(); i2++) {
|
||||
if (((DiyPartModel) arrayList2.get(i2)).getCount() != 0) {
|
||||
arrayList6.add(arrayList2.get(i2));
|
||||
}
|
||||
}
|
||||
for (int i3 = 0; i3 < arrayList3.size(); i3++) {
|
||||
if (((DiyPartModel) arrayList3.get(i3)).getCount() != 0) {
|
||||
arrayList7.add(arrayList3.get(i3));
|
||||
}
|
||||
}
|
||||
for (int i4 = 0; i4 < arrayList4.size(); i4++) {
|
||||
if (((DiyPartModel) arrayList4.get(i4)).getCount() != 0) {
|
||||
arrayList8.add(arrayList4.get(i4));
|
||||
}
|
||||
}
|
||||
for (int i5 = 0; i5 < arrayList5.size(); i5++) {
|
||||
if (((DiyPartModel) arrayList5.get(i5)).getCount() != 0) {
|
||||
arrayList9.add(arrayList5.get(i5));
|
||||
}
|
||||
}
|
||||
this.mTitle.setDiyTitle(String.format(this.mActivity.getString(R.string.diy_part_count), String.valueOf(this.count)));
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this.mActivity, 1, false);
|
||||
PartAllAdapter partAllAdapter = new PartAllAdapter(this.mActivity, arrayList, arrayList6, arrayList7, arrayList8, arrayList9, this.mRyPartAll, true);
|
||||
this.mRyPartAll.setLayoutManager(linearLayoutManager);
|
||||
this.mRyPartAll.setAdapter(partAllAdapter);
|
||||
this.mRyPartAll.a(new DividerItemDecoration(this.mActivity, 1));
|
||||
}
|
||||
|
||||
private void initView(View view) {
|
||||
this.mTitle = (TitleDiyView) view.findViewById(R.id.title);
|
||||
this.mRyPartAll = (RecyclerView) view.findViewById(R.id.ry_part_all);
|
||||
this.mImgSure = (ImageView) view.findViewById(R.id.img_sure);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
EventBus.b().c(this);
|
||||
return layoutInflater.inflate(R.layout.fragment_part_all, viewGroup, false);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
EventBus.b().d(this);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEventNotifyCount(BaseEvent baseEvent) {
|
||||
if (baseEvent.getType() == 3) {
|
||||
this.count += Integer.parseInt(baseEvent.getMsg());
|
||||
this.mTitle.setDiyTitle(String.format(this.mActivity.getString(R.string.diy_part_count), String.valueOf(this.count)));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onViewCreated(View view, Bundle bundle) {
|
||||
super.onViewCreated(view, bundle);
|
||||
initView(view);
|
||||
initData();
|
||||
bindClick();
|
||||
}
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.diy.model.DiyPartModel;
|
||||
import com.ubt.jimu.diy.view.adapter.ConnectionCAdapter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyPartDecorateFragment extends DiyPartListCommonFragment {
|
||||
public static DiyPartDecorateFragment create(String str, ArrayList<DiyPartModel> arrayList) {
|
||||
DiyPartDecorateFragment diyPartDecorateFragment = new DiyPartDecorateFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("partType", str);
|
||||
bundle.putSerializable(DiyPartDecorateFragment.class.getSimpleName(), arrayList);
|
||||
diyPartDecorateFragment.setArguments(bundle);
|
||||
return diyPartDecorateFragment;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.fragment.DiyPartListCommonFragment
|
||||
public void initData() {
|
||||
this.mBackground.setBackgroundResource(R.drawable.diy_parts_bg01);
|
||||
ConnectionCAdapter connectionCAdapter = new ConnectionCAdapter(this.mActivity, (List) getArguments().getSerializable(DiyPartDecorateFragment.class.getSimpleName()), "decorate", true, this.mPartList);
|
||||
this.mPartList.setLayoutManager(new GridLayoutManager((Context) this.mActivity, 6, 1, false));
|
||||
this.mPartList.setAdapter(connectionCAdapter);
|
||||
}
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.diy.model.DiyPartModel;
|
||||
import com.ubt.jimu.diy.view.adapter.ElectronicAdapter;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyPartElectronicFragment extends DiyPartListCommonFragment {
|
||||
public static DiyPartElectronicFragment create(ArrayList<DiyPartModel> arrayList) {
|
||||
DiyPartElectronicFragment diyPartElectronicFragment = new DiyPartElectronicFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable(DiyPartElectronicFragment.class.getSimpleName(), arrayList);
|
||||
diyPartElectronicFragment.setArguments(bundle);
|
||||
return diyPartElectronicFragment;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.fragment.DiyPartListCommonFragment
|
||||
public void initData() {
|
||||
this.mBackground.setBackgroundResource(R.drawable.diy_parts_bg02);
|
||||
ElectronicAdapter electronicAdapter = new ElectronicAdapter(this.mActivity, (ArrayList) getArguments().getSerializable(DiyPartElectronicFragment.class.getSimpleName()));
|
||||
this.mPartList.setLayoutManager(new GridLayoutManager(this.mActivity, 6));
|
||||
this.mPartList.setAdapter(electronicAdapter);
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.diy.model.DiyPartModel;
|
||||
import com.ubt.jimu.diy.view.adapter.LineCAdapter;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyPartLineFragment extends DiyPartListCommonFragment {
|
||||
public static DiyPartLineFragment create(ArrayList<DiyPartModel> arrayList) {
|
||||
DiyPartLineFragment diyPartLineFragment = new DiyPartLineFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable(DiyPartLineFragment.class.getSimpleName(), arrayList);
|
||||
diyPartLineFragment.setArguments(bundle);
|
||||
return diyPartLineFragment;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.fragment.DiyPartListCommonFragment
|
||||
public void initData() {
|
||||
this.datas = (ArrayList) getArguments().getSerializable(DiyPartLineFragment.class.getSimpleName());
|
||||
this.mBackground.setBackgroundResource(R.drawable.diy_parts_bg01);
|
||||
LineCAdapter lineCAdapter = new LineCAdapter(this.mActivity, this.datas, true);
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this.mActivity, 1, false);
|
||||
this.mPartList.setAdapter(lineCAdapter);
|
||||
this.mPartList.setLayoutManager(linearLayoutManager);
|
||||
}
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.diy.model.DiyPartModel;
|
||||
import com.ubt.jimu.widgets.screenAdaptive.XFrameLayout;
|
||||
import com.ubtech.view.fragment.BaseFragment;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public abstract class DiyPartListCommonFragment extends BaseFragment {
|
||||
protected List<DiyPartModel> datas = new ArrayList();
|
||||
protected XFrameLayout mBackground;
|
||||
protected RecyclerView mPartList;
|
||||
|
||||
private void initView(View view) {
|
||||
this.mBackground = (XFrameLayout) view.findViewById(R.id.fm_background);
|
||||
this.mPartList = (RecyclerView) view.findViewById(R.id.ry_part_list);
|
||||
}
|
||||
|
||||
public abstract void initData();
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
return layoutInflater.inflate(R.layout.fragment_diy_part_list, viewGroup, false);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onViewCreated(View view, Bundle bundle) {
|
||||
super.onViewCreated(view, bundle);
|
||||
initView(view);
|
||||
initData();
|
||||
}
|
||||
}
|
@@ -0,0 +1,77 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.ubt.jimu.R;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyProgramFragment extends Fragment {
|
||||
private static final String ARG_PARAM1 = "param1";
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
private Unbinder mBind;
|
||||
private OnFragmentInteractionListener mListener;
|
||||
private String mParam1;
|
||||
private String mParam2;
|
||||
protected TextView tvTitle;
|
||||
|
||||
public interface OnFragmentInteractionListener {
|
||||
}
|
||||
|
||||
public static DiyProgramFragment newInstance(String str, String str2) {
|
||||
DiyProgramFragment diyProgramFragment = new DiyProgramFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(ARG_PARAM1, str);
|
||||
bundle.putString(ARG_PARAM2, str2);
|
||||
diyProgramFragment.setArguments(bundle);
|
||||
return diyProgramFragment;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
if (context instanceof OnFragmentInteractionListener) {
|
||||
this.mListener = (OnFragmentInteractionListener) context;
|
||||
}
|
||||
}
|
||||
|
||||
protected void onBack(View view) {
|
||||
getFragmentManager().d();
|
||||
}
|
||||
|
||||
@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_program, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
this.tvTitle.setText(R.string.title_diy_program);
|
||||
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;
|
||||
}
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.view.View;
|
||||
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 DiyProgramFragment_ViewBinding implements Unbinder {
|
||||
private DiyProgramFragment target;
|
||||
private View view7f090237;
|
||||
|
||||
public DiyProgramFragment_ViewBinding(final DiyProgramFragment diyProgramFragment, View view) {
|
||||
this.target = diyProgramFragment;
|
||||
diyProgramFragment.tvTitle = (TextView) Utils.b(view, R.id.tvTitle, "field 'tvTitle'", TextView.class);
|
||||
View a = Utils.a(view, R.id.imgBack, "method 'onBack'");
|
||||
this.view7f090237 = a;
|
||||
a.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyProgramFragment_ViewBinding.1
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyProgramFragment.onBack(view2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
DiyProgramFragment diyProgramFragment = this.target;
|
||||
if (diyProgramFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
diyProgramFragment.tvTitle = null;
|
||||
this.view7f090237.setOnClickListener(null);
|
||||
this.view7f090237 = null;
|
||||
}
|
||||
}
|
79
sources/com/ubt/jimu/diy/view/fragment/DiyShowFragment.java
Normal file
79
sources/com/ubt/jimu/diy/view/fragment/DiyShowFragment.java
Normal file
@@ -0,0 +1,79 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.ubt.jimu.R;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DiyShowFragment extends Fragment {
|
||||
private static final String ARG_PARAM1 = "param1";
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
private Unbinder mBind;
|
||||
private OnFragmentInteractionListener mListener;
|
||||
private String mParam1;
|
||||
private String mParam2;
|
||||
protected TextView tvTitle;
|
||||
|
||||
public interface OnFragmentInteractionListener {
|
||||
void onFragmentInteraction(Uri uri);
|
||||
}
|
||||
|
||||
public static DiyShowFragment newInstance(String str, String str2) {
|
||||
DiyShowFragment diyShowFragment = new DiyShowFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(ARG_PARAM1, str);
|
||||
bundle.putString(ARG_PARAM2, str2);
|
||||
diyShowFragment.setArguments(bundle);
|
||||
return diyShowFragment;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
if (context instanceof OnFragmentInteractionListener) {
|
||||
this.mListener = (OnFragmentInteractionListener) context;
|
||||
}
|
||||
}
|
||||
|
||||
protected void onBack(View view) {
|
||||
getFragmentManager().d();
|
||||
}
|
||||
|
||||
@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_show, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
this.tvTitle.setText(R.string.title_diy_show);
|
||||
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;
|
||||
}
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.view.View;
|
||||
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 DiyShowFragment_ViewBinding implements Unbinder {
|
||||
private DiyShowFragment target;
|
||||
private View view7f090237;
|
||||
|
||||
public DiyShowFragment_ViewBinding(final DiyShowFragment diyShowFragment, View view) {
|
||||
this.target = diyShowFragment;
|
||||
diyShowFragment.tvTitle = (TextView) Utils.b(view, R.id.tvTitle, "field 'tvTitle'", TextView.class);
|
||||
View a = Utils.a(view, R.id.imgBack, "method 'onBack'");
|
||||
this.view7f090237 = a;
|
||||
a.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.DiyShowFragment_ViewBinding.1
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
diyShowFragment.onBack(view2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
DiyShowFragment diyShowFragment = this.target;
|
||||
if (diyShowFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
diyShowFragment.tvTitle = null;
|
||||
this.view7f090237.setOnClickListener(null);
|
||||
this.view7f090237 = null;
|
||||
}
|
||||
}
|
211
sources/com/ubt/jimu/diy/view/fragment/OfficialDiyFragment.java
Normal file
211
sources/com/ubt/jimu/diy/view/fragment/OfficialDiyFragment.java
Normal file
@@ -0,0 +1,211 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
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.SpaceItemDecoration;
|
||||
import com.ubtech.utils.DisplayUtil;
|
||||
import com.ubtech.view.fragment.LazyLoadFragment;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class OfficialDiyFragment extends LazyLoadFragment implements OfficialDiyAdapter.OnOfficialDiyItemClickListener, URecyclerView.LoadingListener, OfficialDiyContract.View {
|
||||
private static final String ARG_PARAM1 = "param1";
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
private OfficialDiyAdapter adapter;
|
||||
private OnOfficialDiyFragmentInteractionListener listener;
|
||||
private Unbinder mBind;
|
||||
private GridLayoutManager mGd;
|
||||
protected LoadingView mLoadingView;
|
||||
private ViewTreeObserver.OnGlobalLayoutListener mOnGlobalLayoutListener;
|
||||
private String mParam1;
|
||||
private String mParam2;
|
||||
private NoviceGuideListener noviceGuideListener;
|
||||
private List<DiyModel> officialDiyRobots = new ArrayList();
|
||||
private int pageNumber = 1;
|
||||
private final int pageSize = 20;
|
||||
private OfficialDiyContract.Presenter presenter;
|
||||
protected URecyclerView recyclerView;
|
||||
|
||||
public interface NoviceGuideListener {
|
||||
void startNoviceGuideListener(List<DiyModel> list, GridLayoutManager gridLayoutManager);
|
||||
}
|
||||
|
||||
public interface NoviceGuideListenerOnItemListener {
|
||||
void onOfficialDiyItemClickNoviceGuide(DiyModel diyModel, int i);
|
||||
}
|
||||
|
||||
public interface OnOfficialDiyFragmentInteractionListener {
|
||||
void onOfficialDiyItemClick(DiyModel diyModel, int i);
|
||||
}
|
||||
|
||||
private void iniData() {
|
||||
this.presenter.queryOfficialDiy(false, this.pageNumber, 20);
|
||||
}
|
||||
|
||||
public static OfficialDiyFragment newInstance(String str, String str2) {
|
||||
OfficialDiyFragment officialDiyFragment = new OfficialDiyFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(ARG_PARAM1, str);
|
||||
bundle.putString(ARG_PARAM2, str2);
|
||||
officialDiyFragment.setArguments(bundle);
|
||||
return officialDiyFragment;
|
||||
}
|
||||
|
||||
public /* synthetic */ void b() {
|
||||
int[] a = ScreenUtils.a(0.76666665f, this.recyclerView, this.mActivity.getResources().getDimension(R.dimen.diy_edit_list_left), 3);
|
||||
this.recyclerView.a(new SpaceItemDecoration(DisplayUtil.a(getContext(), this.mActivity.getResources().getDimension(R.dimen.diy_edit_list_bottom)), DisplayUtil.a(getContext(), this.mActivity.getResources().getDimension(R.dimen.diy_edit_list_left)), 3, true));
|
||||
this.adapter = new OfficialDiyAdapter(getContext(), this.officialDiyRobots, a[1], a[0]);
|
||||
this.mGd = new GridLayoutManager(getContext(), 3);
|
||||
this.adapter.setListener(this);
|
||||
this.recyclerView.setLayoutManager(this.mGd);
|
||||
this.recyclerView.setAdapter(this.adapter);
|
||||
this.recyclerView.setLoadingListener(this);
|
||||
iniData();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.contract.OfficialDiyContract.View
|
||||
public void loadCompleted() {
|
||||
this.recyclerView.y();
|
||||
this.recyclerView.z();
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.LazyLoadFragment
|
||||
protected void loadData() {
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.contract.OfficialDiyContract.View
|
||||
public void loadError() {
|
||||
this.recyclerView.y();
|
||||
this.recyclerView.z();
|
||||
}
|
||||
|
||||
public /* synthetic */ void o() {
|
||||
this.adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // com.ubtech.view.fragment.LazyLoadFragment, androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
if (context instanceof OnOfficialDiyFragmentInteractionListener) {
|
||||
this.listener = (OnOfficialDiyFragmentInteractionListener) context;
|
||||
}
|
||||
}
|
||||
|
||||
@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_official_diy, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
this.presenter = new OfficialDiyPresenter(getContext(), this, this.mLoadingView);
|
||||
this.recyclerView.post(new Runnable() { // from class: com.ubt.jimu.diy.view.fragment.d
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
OfficialDiyFragment.this.b();
|
||||
}
|
||||
});
|
||||
this.recyclerView.postDelayed(new Runnable() { // from class: com.ubt.jimu.diy.view.fragment.c
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
OfficialDiyFragment.this.o();
|
||||
}
|
||||
}, 2000L);
|
||||
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();
|
||||
this.listener = null;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onHiddenChanged(boolean z) {
|
||||
super.onHiddenChanged(z);
|
||||
}
|
||||
|
||||
@Override // com.recyclelib.URecyclerView.LoadingListener
|
||||
public void onLoadingMore() {
|
||||
this.presenter.queryOfficialDiy(true, this.pageNumber, 20);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.view.adapter.OfficialDiyAdapter.OnOfficialDiyItemClickListener
|
||||
public void onOfficialDiyItemClick(DiyModel diyModel, int i) {
|
||||
if (i == 0) {
|
||||
SPUtils.a("COURSE_GUIDE_SHOW_KEY", true);
|
||||
SPUtils.a(Constant.NoviceGuide.OFFICIAL_DIY_GUIDE_ON_CLOCK, true);
|
||||
this.adapter.notifyDataSetChanged();
|
||||
}
|
||||
OnOfficialDiyFragmentInteractionListener onOfficialDiyFragmentInteractionListener = this.listener;
|
||||
if (onOfficialDiyFragmentInteractionListener != null) {
|
||||
onOfficialDiyFragmentInteractionListener.onOfficialDiyItemClick(diyModel, i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.recyclelib.URecyclerView.LoadingListener
|
||||
public void onRefreshing() {
|
||||
this.presenter.queryOfficialDiy(true, 1, 20);
|
||||
}
|
||||
|
||||
public void setNoviceGuideListener(NoviceGuideListener noviceGuideListener) {
|
||||
this.noviceGuideListener = noviceGuideListener;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.diy.contract.OfficialDiyContract.View
|
||||
public void showOfficialDiy(List<DiyModel> list, int i) {
|
||||
if (list == null || list.size() == 0) {
|
||||
return;
|
||||
}
|
||||
this.pageNumber = i + 1;
|
||||
if (i == 1) {
|
||||
this.officialDiyRobots.clear();
|
||||
this.officialDiyRobots.addAll(list);
|
||||
} else {
|
||||
this.officialDiyRobots.addAll(list);
|
||||
}
|
||||
this.adapter.notifyDataSetChanged();
|
||||
boolean a = SPUtils.a(Constant.NoviceGuide.OFFICIAL_DIY_GUIDE_ON_CLOCK);
|
||||
NoviceGuideListener noviceGuideListener = this.noviceGuideListener;
|
||||
if (noviceGuideListener == null || a) {
|
||||
return;
|
||||
}
|
||||
noviceGuideListener.startNoviceGuideListener(this.officialDiyRobots, this.mGd);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.BaseView
|
||||
public void setPresenter(OfficialDiyContract.Presenter presenter) {
|
||||
this.presenter = presenter;
|
||||
}
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
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 OfficialDiyFragment_ViewBinding implements Unbinder {
|
||||
private OfficialDiyFragment target;
|
||||
|
||||
public OfficialDiyFragment_ViewBinding(OfficialDiyFragment officialDiyFragment, View view) {
|
||||
this.target = officialDiyFragment;
|
||||
officialDiyFragment.recyclerView = (URecyclerView) Utils.b(view, R.id.recycleView, "field 'recyclerView'", URecyclerView.class);
|
||||
officialDiyFragment.mLoadingView = (LoadingView) Utils.b(view, R.id.loading, "field 'mLoadingView'", LoadingView.class);
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
OfficialDiyFragment officialDiyFragment = this.target;
|
||||
if (officialDiyFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
officialDiyFragment.recyclerView = null;
|
||||
officialDiyFragment.mLoadingView = null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,634 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.RequestBuilder;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.ijm.dataencryption.de.DataDecryptTool;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.cache.Cache;
|
||||
import com.ubt.jimu.base.cache.Constants;
|
||||
import com.ubt.jimu.base.db.diy.DiyDBModel;
|
||||
import com.ubt.jimu.base.db.diy.DiyHelper;
|
||||
import com.ubt.jimu.diy.DiyRobotDbHandler;
|
||||
import com.ubt.jimu.diy.view.DiyFanActivity;
|
||||
import com.ubt.jimu.transport.dao.TransportFileDbHandler;
|
||||
import com.ubt.jimu.transport.model.TransportFile;
|
||||
import com.ubt.jimu.transport3.DiyTransportServiceImpl;
|
||||
import com.ubt.jimu.transport3.dao.TransportFileDbHandler2;
|
||||
import com.ubt.jimu.unity.ModelType;
|
||||
import com.ubt.jimu.utils.ExternalOverFroyoUtils;
|
||||
import com.ubt.jimu.utils.LogUtils;
|
||||
import com.ubt.jimu.utils.NetWorkUtil;
|
||||
import com.ubt.jimu.utils.SystemUtils;
|
||||
import com.ubt.jimu.utils.videoUtil.CompressUtil;
|
||||
import com.ubt.jimu.utils.videoUtil.VideoUtils;
|
||||
import com.ubt.jimu.video.Configuration;
|
||||
import com.ubt.jimu.video.OnCompressListener;
|
||||
import com.ubt.jimu.video.VideoCompressUtils;
|
||||
import com.ubt.jimu.widgets.JAlertDialog;
|
||||
import com.ubt.jimu.widgets.NavigationBarView;
|
||||
import com.ubt.jimu.widgets.choosePhotos.AlbumActivity;
|
||||
import com.ubt.jimu.widgets.choosePhotos.media.HPMedia;
|
||||
import com.ubt.jimu.widgets.player.UbtPlayer;
|
||||
import com.ubtech.permission.JimuPermissionRequest;
|
||||
import com.ubtech.permission.PermissionRequestListener;
|
||||
import com.ubtech.utils.FileHelper;
|
||||
import com.ubtech.utils.StringUtils;
|
||||
import com.ubtech.view.fragment.BaseFragment;
|
||||
import com.ubtrobot.log.ALog;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class OriginalityShowFragment extends BaseFragment {
|
||||
private TransportFileDbHandler2 fileDbHandler;
|
||||
private ImageView imgVideoAdd;
|
||||
private String localVideoCoverPath;
|
||||
private TextView mDescTv;
|
||||
private ImageView mImgOriginDelete;
|
||||
protected JAlertDialog mJAlertDialog;
|
||||
private DiyDBModel mModel;
|
||||
private NavigationBarView mNavBarView;
|
||||
private ImageView mVideo;
|
||||
private String modelVideoLocalPath;
|
||||
private TransportFile videoCoverFileTransport;
|
||||
private TransportFile videoFileTransport;
|
||||
private String videoLocalPath;
|
||||
private String videoServeCoverPath;
|
||||
private String videoServicePath;
|
||||
private CompositeDisposable disposables = new CompositeDisposable();
|
||||
private boolean modify = false;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void addDiyModelShowVideo(final DiyDBModel diyDBModel, final String str) {
|
||||
Observable create = Observable.create(new ObservableOnSubscribe<String>() { // from class: com.ubt.jimu.diy.view.fragment.OriginalityShowFragment.4
|
||||
@Override // io.reactivex.ObservableOnSubscribe
|
||||
public void subscribe(final ObservableEmitter<String> observableEmitter) throws Exception {
|
||||
if (VideoUtils.b(str) <= 5.0d) {
|
||||
OriginalityShowFragment originalityShowFragment = OriginalityShowFragment.this;
|
||||
String saveDiyShowFile = originalityShowFragment.saveDiyShowFile(originalityShowFragment.getContext(), diyDBModel.getModelCreatedId(), diyDBModel.getCustomModelId(), str, ".mp4");
|
||||
if (TextUtils.isEmpty(saveDiyShowFile)) {
|
||||
observableEmitter.onError(new Exception("保存视频文件失败"));
|
||||
return;
|
||||
} else {
|
||||
observableEmitter.onNext(saveDiyShowFile);
|
||||
observableEmitter.onComplete();
|
||||
return;
|
||||
}
|
||||
}
|
||||
String str2 = ExternalOverFroyoUtils.a(OriginalityShowFragment.this.getContext(), (ModelType) null) + String.format(Constants.CUSTOM_MODEL, diyDBModel.getModelCreatedId()) + DiyFanActivity.uuid + File.separator + TransportFile.MODEL_SHOW_DIR;
|
||||
final String str3 = str2 + File.separator + DiyFanActivity.uuid + ".mp4";
|
||||
File file = new File(str2);
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
Configuration configuration = new Configuration();
|
||||
configuration.a = str;
|
||||
configuration.b = str3;
|
||||
ArrayList arrayList = new ArrayList();
|
||||
arrayList.add(configuration);
|
||||
VideoCompressUtils.a(((BaseFragment) OriginalityShowFragment.this).mActivity).a(arrayList, new OnCompressListener() { // from class: com.ubt.jimu.diy.view.fragment.OriginalityShowFragment.4.1
|
||||
@Override // com.ubt.jimu.video.OnCompressListener
|
||||
public void onAllCompressFail() {
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.video.OnCompressListener
|
||||
public void onAllCompressSuccess() {
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.video.OnCompressListener
|
||||
public void onFail(boolean z) {
|
||||
ALog.a(OriginalityShowFragment.this.TAG).d("压缩视频文件失败,不压缩,拷贝到对应目录后直接上传");
|
||||
if (FileHelper.b(new File(str), new File(str3))) {
|
||||
observableEmitter.onNext(str3);
|
||||
observableEmitter.onComplete();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.video.OnCompressListener
|
||||
public void onProgress(float f) {
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.video.OnCompressListener
|
||||
public void onSuccess(Configuration configuration2) {
|
||||
observableEmitter.onNext(configuration2.b);
|
||||
observableEmitter.onComplete();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.video.OnCompressListener
|
||||
public void prepareCompress() {
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
showLoading("");
|
||||
create.subscribeOn(Schedulers.b()).observeOn(AndroidSchedulers.a()).subscribe(new Observer<String>() { // from class: com.ubt.jimu.diy.view.fragment.OriginalityShowFragment.5
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
OriginalityShowFragment.this.hideLoading();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
OriginalityShowFragment.this.disposables.b(disposable);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onNext(String str2) {
|
||||
diyDBModel.setStep5PathDesc(str2);
|
||||
if (OriginalityShowFragment.this.videoFileTransport == null) {
|
||||
OriginalityShowFragment originalityShowFragment = OriginalityShowFragment.this;
|
||||
originalityShowFragment.videoFileTransport = originalityShowFragment.newDiyShowFile(diyDBModel, str2, TransportFile.TYPE_DIY_SHOW);
|
||||
TransportFile selectUnique = OriginalityShowFragment.this.fileDbHandler.selectUnique(OriginalityShowFragment.this.videoFileTransport);
|
||||
if (selectUnique == null) {
|
||||
OriginalityShowFragment.this.videoFileTransport.setCustomFileId(Long.valueOf(OriginalityShowFragment.this.fileDbHandler.insert(OriginalityShowFragment.this.videoFileTransport)));
|
||||
} else {
|
||||
OriginalityShowFragment.this.videoFileTransport.setCustomFileId(selectUnique.getCustomFileId());
|
||||
OriginalityShowFragment.this.videoFileTransport.setIsDeleted(false);
|
||||
OriginalityShowFragment.this.fileDbHandler.update(OriginalityShowFragment.this.videoFileTransport);
|
||||
}
|
||||
} else {
|
||||
long a = SystemUtils.a();
|
||||
OriginalityShowFragment.this.videoFileTransport.setModifyTime(a);
|
||||
OriginalityShowFragment.this.videoFileTransport.setLastUploadTime(a);
|
||||
OriginalityShowFragment.this.videoFileTransport.setUploaded(false);
|
||||
OriginalityShowFragment.this.videoFileTransport.setIsModify(true);
|
||||
TransportFileDbHandler2.getInstance().update(OriginalityShowFragment.this.videoFileTransport);
|
||||
}
|
||||
if (diyDBModel.getModelId() == null || diyDBModel.getModelId().intValue() == 0) {
|
||||
OriginalityShowFragment.this.hideLoading();
|
||||
OriginalityShowFragment.this.finishShowActivity();
|
||||
} else if (NetWorkUtil.b(OriginalityShowFragment.this.getContext())) {
|
||||
OriginalityShowFragment originalityShowFragment2 = OriginalityShowFragment.this;
|
||||
originalityShowFragment2.uploadModelFile(diyDBModel, originalityShowFragment2.videoFileTransport);
|
||||
} else {
|
||||
OriginalityShowFragment.this.hideLoading();
|
||||
OriginalityShowFragment.this.finishShowActivity();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void bindClick() {
|
||||
this.mVideo.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.OriginalityShowFragment.1
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
if (StringUtils.e(OriginalityShowFragment.this.videoLocalPath)) {
|
||||
JimuPermissionRequest.c(((BaseFragment) OriginalityShowFragment.this).mActivity, new PermissionRequestListener() { // from class: com.ubt.jimu.diy.view.fragment.OriginalityShowFragment.1.1
|
||||
@Override // com.ubtech.permission.PermissionRequestListener
|
||||
public void onDenied() {
|
||||
}
|
||||
|
||||
@Override // com.ubtech.permission.PermissionRequestListener
|
||||
public void onGranted() {
|
||||
AlbumActivity.a(((BaseFragment) OriginalityShowFragment.this).mActivity, 200, 1, null, 2, "UNITERMING_VIDEO");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
UbtPlayer.a(((BaseFragment) OriginalityShowFragment.this).mActivity, "", OriginalityShowFragment.this.videoLocalPath);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.mImgOriginDelete.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.diy.view.fragment.OriginalityShowFragment.2
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
OriginalityShowFragment.this.videoLocalPath = "";
|
||||
OriginalityShowFragment.this.localVideoCoverPath = "";
|
||||
OriginalityShowFragment.this.initAddVideo();
|
||||
}
|
||||
});
|
||||
this.mNavBarView.setListener(new NavigationBarView.OnActionClickListener.Stub() { // from class: com.ubt.jimu.diy.view.fragment.OriginalityShowFragment.3
|
||||
@Override // com.ubt.jimu.widgets.NavigationBarView.OnActionClickListener.Stub
|
||||
public void onRightClick(View view) {
|
||||
if (!OriginalityShowFragment.this.modify) {
|
||||
OriginalityShowFragment.this.finishShowActivity();
|
||||
return;
|
||||
}
|
||||
if (StringUtils.e(OriginalityShowFragment.this.localVideoCoverPath)) {
|
||||
OriginalityShowFragment.this.mModel.setStep5state(0);
|
||||
} else {
|
||||
OriginalityShowFragment.this.mModel.setStep5state(1);
|
||||
}
|
||||
DiyRobotDbHandler.deleteFile(OriginalityShowFragment.this.mModel.getStep5PathDesc());
|
||||
DiyRobotDbHandler.deleteFile(OriginalityShowFragment.this.mModel.getStep5desc());
|
||||
String userId = Cache.getInstance().getUserId();
|
||||
if (!TextUtils.isEmpty(userId) && !userId.equals("local")) {
|
||||
OriginalityShowFragment originalityShowFragment = OriginalityShowFragment.this;
|
||||
originalityShowFragment.addDiyModelShowVideo(originalityShowFragment.mModel, OriginalityShowFragment.this.videoLocalPath);
|
||||
return;
|
||||
}
|
||||
LogUtils.c("视频源地址:" + OriginalityShowFragment.this.videoLocalPath);
|
||||
LogUtils.c("视频模型地址:" + OriginalityShowFragment.this.modelVideoLocalPath);
|
||||
File file = new File(OriginalityShowFragment.this.modelVideoLocalPath);
|
||||
FileHelper.b(new File(OriginalityShowFragment.this.videoLocalPath), file);
|
||||
if (file.exists()) {
|
||||
OriginalityShowFragment.this.saveVideoDB(userId, file.getName());
|
||||
LogUtils.c("本地用户,文件复制成功");
|
||||
}
|
||||
OriginalityShowFragment.this.saveViewCorverDB(userId);
|
||||
OriginalityShowFragment.this.finishShowActivity();
|
||||
OriginalityShowFragment.this.hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static OriginalityShowFragment create(String str) {
|
||||
OriginalityShowFragment originalityShowFragment = new OriginalityShowFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(BuildStepFragment.UUID, str);
|
||||
originalityShowFragment.setArguments(bundle);
|
||||
return originalityShowFragment;
|
||||
}
|
||||
|
||||
private void deleteDiyShowVideo(TransportFile transportFile) {
|
||||
if (transportFile == null) {
|
||||
return;
|
||||
}
|
||||
File file = TransportFileDbHandler.getFile(transportFile);
|
||||
if (file != null && file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
long a = SystemUtils.a();
|
||||
transportFile.setModifyTime(a);
|
||||
transportFile.setLastUploadTime(a);
|
||||
transportFile.setIsDeleted(true);
|
||||
transportFile.setIsModify(true);
|
||||
TransportFileDbHandler2.getInstance().update(transportFile);
|
||||
DiyTransportServiceImpl.getInstance().deleteModelFile(transportFile);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void finishShowActivity() {
|
||||
this.mVideo.post(new Runnable() { // from class: com.ubt.jimu.diy.view.fragment.e
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
OriginalityShowFragment.this.b();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private String getVideoCoverModeFilePath() {
|
||||
return (ExternalOverFroyoUtils.a(getContext(), (ModelType) null) + String.format(Constants.CUSTOM_MODEL, Cache.getInstance().getUserId()) + DiyFanActivity.uuid + File.separator + TransportFile.MODEL_SHOW_DIR) + File.separator + DiyFanActivity.uuid + ".jpg";
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void initAddVideo() {
|
||||
this.imgVideoAdd.setVisibility(0);
|
||||
this.mImgOriginDelete.setVisibility(8);
|
||||
Glide.a(this.mActivity).a(Integer.valueOf(R.color.bg_3E5570)).a(this.mVideo);
|
||||
this.mDescTv.setVisibility(0);
|
||||
this.imgVideoAdd.setBackgroundResource(R.drawable.diy_add_video);
|
||||
this.mNavBarView.setRightEnabled(false);
|
||||
this.mNavBarView.setRightAlpha(0.3f);
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
this.mNavBarView.setRightEnabled(false);
|
||||
this.mNavBarView.setRightAlpha(0.3f);
|
||||
this.mModel = DiyHelper.getInstance().queryForUUid(getArguments().getString(BuildStepFragment.UUID));
|
||||
this.fileDbHandler = TransportFileDbHandler2.getInstance();
|
||||
String userId = Cache.getInstance().getUserId();
|
||||
this.modelVideoLocalPath = ExternalOverFroyoUtils.a(getContext(), (ModelType) null) + String.format(Constants.CUSTOM_MODEL, Cache.getInstance().getUserId()) + DiyFanActivity.uuid + File.separator + TransportFile.MODEL_SHOW_DIR + File.separator + DiyFanActivity.uuid + ".mp4";
|
||||
String str = ExternalOverFroyoUtils.a(getContext(), (ModelType) null) + String.format(Constants.CUSTOM_MODEL, Cache.getInstance().getUserId()) + DiyFanActivity.uuid + File.separator + TransportFile.MODEL_SHOW_DIR + File.separator + DiyFanActivity.uuid + ".jpg";
|
||||
LogUtils.c("initData 本地视频路径:" + this.videoLocalPath);
|
||||
boolean isEmpty = TextUtils.isEmpty(userId);
|
||||
Integer valueOf = Integer.valueOf(R.color.bg_3E5570);
|
||||
if (isEmpty || userId.equals("local")) {
|
||||
if (!new File(this.modelVideoLocalPath).exists()) {
|
||||
this.imgVideoAdd.setVisibility(0);
|
||||
this.mImgOriginDelete.setVisibility(8);
|
||||
Glide.a(this.mActivity).a(valueOf).a(this.mVideo);
|
||||
this.mDescTv.setVisibility(0);
|
||||
this.imgVideoAdd.setBackgroundResource(R.drawable.diy_add_video);
|
||||
LogUtils.c("initData 本地没有 网络没有:");
|
||||
return;
|
||||
}
|
||||
this.videoLocalPath = this.modelVideoLocalPath;
|
||||
this.localVideoCoverPath = str;
|
||||
this.imgVideoAdd.setBackgroundResource(R.drawable.icon_play);
|
||||
this.mImgOriginDelete.setVisibility(0);
|
||||
this.mDescTv.setVisibility(8);
|
||||
RequestBuilder<Drawable> a = Glide.a(this.mActivity).a(str);
|
||||
a.a(new RequestOptions().a(true).a(DiskCacheStrategy.b).b().a(R.drawable.bg_default_normal));
|
||||
a.a(this.mVideo);
|
||||
return;
|
||||
}
|
||||
this.videoFileTransport = this.fileDbHandler.getModelFile(this.mModel.getModelCreatedId(), this.mModel.getCustomModelId(), TransportFile.TYPE_DIY_SHOW);
|
||||
LogUtils.c("用户登录-modelVideoLocalPath:" + this.modelVideoLocalPath);
|
||||
File file = new File(this.modelVideoLocalPath);
|
||||
if (this.videoFileTransport == null && !file.exists()) {
|
||||
this.imgVideoAdd.setVisibility(0);
|
||||
this.mImgOriginDelete.setVisibility(8);
|
||||
Glide.a(this.mActivity).a(valueOf).a(this.mVideo);
|
||||
this.mDescTv.setVisibility(0);
|
||||
this.imgVideoAdd.setBackgroundResource(R.drawable.diy_add_video);
|
||||
LogUtils.c("用户没有设置视频");
|
||||
return;
|
||||
}
|
||||
this.videoCoverFileTransport = this.fileDbHandler.getModelFile(this.mModel.getModelCreatedId(), this.mModel.getCustomModelId(), TransportFile.TYPE_AUDIO_SHOW);
|
||||
TransportFile transportFile = this.videoFileTransport;
|
||||
if (transportFile != null && !TextUtils.isEmpty(transportFile.getFileUrl()) && this.videoCoverFileTransport == null) {
|
||||
this.videoLocalPath = this.videoFileTransport.getFileUrl();
|
||||
if (new File(this.modelVideoLocalPath).exists()) {
|
||||
this.videoLocalPath = this.modelVideoLocalPath;
|
||||
saveVideoCover(userId, DiyFanActivity.uuid);
|
||||
}
|
||||
LogUtils.c("兼容老版本:" + this.videoLocalPath);
|
||||
LogUtils.c("兼容老版本:" + str);
|
||||
this.imgVideoAdd.setBackgroundResource(R.drawable.icon_play);
|
||||
this.mImgOriginDelete.setVisibility(0);
|
||||
this.mDescTv.setVisibility(8);
|
||||
RequestBuilder<Drawable> a2 = Glide.a(this.mActivity).a(str);
|
||||
a2.a(new RequestOptions().a(true).a(DiskCacheStrategy.b).b().a(R.drawable.bg_default_normal));
|
||||
a2.a(this.mVideo);
|
||||
return;
|
||||
}
|
||||
TransportFile transportFile2 = this.videoFileTransport;
|
||||
if (transportFile2 == null || TextUtils.isEmpty(transportFile2.getFileUrl()) || this.videoCoverFileTransport == null) {
|
||||
return;
|
||||
}
|
||||
this.videoLocalPath = this.videoFileTransport.getFileUrl();
|
||||
this.localVideoCoverPath = this.videoCoverFileTransport.getFileUrl();
|
||||
if (new File(this.modelVideoLocalPath).exists()) {
|
||||
this.videoLocalPath = this.modelVideoLocalPath;
|
||||
}
|
||||
if (new File(str).exists()) {
|
||||
this.localVideoCoverPath = str;
|
||||
}
|
||||
this.imgVideoAdd.setBackgroundResource(R.drawable.icon_play);
|
||||
this.mImgOriginDelete.setVisibility(0);
|
||||
this.mDescTv.setVisibility(8);
|
||||
RequestBuilder<Drawable> a3 = Glide.a(this.mActivity).a(str);
|
||||
a3.a(new RequestOptions().a(true).a(DiskCacheStrategy.b).b().a(R.drawable.bg_default_normal));
|
||||
a3.a(this.mVideo);
|
||||
LogUtils.c("视频和封面都已经上传到网络:" + this.videoLocalPath);
|
||||
LogUtils.c("视频和封面都已经上传到网络:" + this.localVideoCoverPath);
|
||||
}
|
||||
|
||||
private void initView(View view) {
|
||||
this.mNavBarView = (NavigationBarView) view.findViewById(R.id.nbv_bar);
|
||||
this.mNavBarView.setRightIcon(R.drawable.ic_nav_finish);
|
||||
this.mVideo = (ImageView) view.findViewById(R.id.video);
|
||||
this.mImgOriginDelete = (ImageView) view.findViewById(R.id.img_origin_delete);
|
||||
this.imgVideoAdd = (ImageView) view.findViewById(R.id.img_video_add);
|
||||
this.mDescTv = (TextView) view.findViewById(R.id.tv_desc);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public TransportFile newDiyShowFile(DiyDBModel diyDBModel, String str, String str2) {
|
||||
TransportFile transportFile = new TransportFile(diyDBModel.getModelCreatedId(), diyDBModel.getModelId().intValue(), diyDBModel.getCustomModelId(), String.valueOf(ModelType.PLAYER_DATA.getType()), str2, "", FileHelper.a(str));
|
||||
transportFile.setFilePath(TransportFileDbHandler2.getModelFilePath(transportFile));
|
||||
return transportFile;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public String saveDiyShowFile(Context context, String str, String str2, String str3, String str4) {
|
||||
if (StringUtils.e(str3)) {
|
||||
return "";
|
||||
}
|
||||
String str5 = ExternalOverFroyoUtils.a(context, (ModelType) null) + String.format(Constants.CUSTOM_MODEL, str) + str2 + File.separator + TransportFile.MODEL_SHOW_DIR;
|
||||
String str6 = str5 + File.separator + str2 + str4;
|
||||
File file = new File(str3);
|
||||
File file2 = new File(str5);
|
||||
File file3 = new File(str6);
|
||||
if (!file2.exists()) {
|
||||
file2.mkdirs();
|
||||
}
|
||||
return FileHelper.b(file, file3) ? str6 : "";
|
||||
}
|
||||
|
||||
private void saveVideoCover(String str, String str2) {
|
||||
FileOutputStream fileOutputStream;
|
||||
if (TextUtils.isEmpty(this.videoLocalPath)) {
|
||||
return;
|
||||
}
|
||||
String str3 = ExternalOverFroyoUtils.a(getContext(), (ModelType) null) + String.format(Constants.CUSTOM_MODEL, str) + str2 + File.separator + TransportFile.MODEL_SHOW_DIR;
|
||||
String videoCoverModeFilePath = getVideoCoverModeFilePath();
|
||||
File file = new File(str3);
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
File file2 = new File(videoCoverModeFilePath);
|
||||
LogUtils.c("保存图片到模型目录下:" + videoCoverModeFilePath + " " + file2.exists());
|
||||
if (file2.exists()) {
|
||||
LogUtils.c("开始删除:" + file2.delete());
|
||||
}
|
||||
Bitmap a = VideoUtils.a(this.videoLocalPath, DataDecryptTool.DECRYPT_SP_FILE, 608, 2);
|
||||
if (a == null) {
|
||||
this.localVideoCoverPath = "";
|
||||
return;
|
||||
}
|
||||
try {
|
||||
fileOutputStream = new FileOutputStream(file2);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
fileOutputStream = null;
|
||||
}
|
||||
a.compress(Bitmap.CompressFormat.JPEG, 100, fileOutputStream);
|
||||
this.localVideoCoverPath = videoCoverModeFilePath;
|
||||
if (fileOutputStream != null) {
|
||||
try {
|
||||
fileOutputStream.flush();
|
||||
fileOutputStream.close();
|
||||
} catch (IOException e2) {
|
||||
e2.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void saveVideoDB(String str, String str2) {
|
||||
TransportFile transportFile = new TransportFile(str, this.mModel.getModelId().intValue(), this.mModel.getCustomModelId(), String.valueOf(ModelType.PLAYER_DATA.getType()), TransportFile.TYPE_DIY_SHOW, "playerdata/" + this.mModel.getCustomModelId() + "/Exhibition", str2);
|
||||
TransportFile selectUnique = this.fileDbHandler.selectUnique(transportFile);
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
if (selectUnique != null) {
|
||||
selectUnique.setModifyTime(currentTimeMillis);
|
||||
selectUnique.setLastUploadTime(currentTimeMillis);
|
||||
this.fileDbHandler.update(selectUnique);
|
||||
LogUtils.c("数据库已经有记录,更新本地数据库");
|
||||
return;
|
||||
}
|
||||
LogUtils.c("数据库没有记录");
|
||||
transportFile.setCreateTime(currentTimeMillis);
|
||||
transportFile.setModifyTime(currentTimeMillis);
|
||||
transportFile.setLastUploadTime(currentTimeMillis);
|
||||
this.fileDbHandler.insert(transportFile);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void saveViewCorverDB(String str) {
|
||||
String videoCoverModeFilePath = getVideoCoverModeFilePath();
|
||||
LogUtils.c("localCoverFilePath:" + videoCoverModeFilePath);
|
||||
File file = new File(videoCoverModeFilePath);
|
||||
if (file.exists()) {
|
||||
long a = SystemUtils.a();
|
||||
TransportFile transportFile = new TransportFile(str, this.mModel.getModelId().intValue(), this.mModel.getCustomModelId(), String.valueOf(ModelType.PLAYER_DATA.getType()), TransportFile.TYPE_AUDIO_SHOW, "playerdata/" + this.mModel.getCustomModelId() + "/Exhibition", file.getName());
|
||||
transportFile.setLastUploadTime(a);
|
||||
transportFile.setModifyTime(a);
|
||||
transportFile.setCreateTime(a);
|
||||
TransportFile selectUnique = this.fileDbHandler.selectUnique(transportFile);
|
||||
if (selectUnique == null) {
|
||||
this.fileDbHandler.insert(transportFile);
|
||||
LogUtils.c("本地数据库没记录封面文件,插入数据库");
|
||||
} else {
|
||||
selectUnique.setLastUploadTime(a);
|
||||
selectUnique.setModifyTime(a);
|
||||
this.fileDbHandler.update(selectUnique);
|
||||
LogUtils.c("本地有封面文件数据库记录,更新数据库");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Configuration setConfiguration(String str, String str2) {
|
||||
Configuration configuration = new Configuration();
|
||||
configuration.a = str;
|
||||
configuration.b = str2;
|
||||
configuration.c = VideoUtils.d(str);
|
||||
CompressUtil.b(str);
|
||||
CompressUtil.a(str);
|
||||
Log.e("Test", "视频宽高:" + configuration.c);
|
||||
return configuration;
|
||||
}
|
||||
|
||||
private void setVideoPath(ArrayList<HPMedia> arrayList) {
|
||||
if (arrayList == null || arrayList.size() == 0) {
|
||||
return;
|
||||
}
|
||||
String path = arrayList.get(0).getPath();
|
||||
if (!TextUtils.isEmpty(path) && new File(path).exists()) {
|
||||
this.videoLocalPath = path;
|
||||
LogUtils.c("视频路径:" + path);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateVideo() {
|
||||
boolean isEmpty = TextUtils.isEmpty(this.videoLocalPath);
|
||||
if (isEmpty) {
|
||||
this.imgVideoAdd.setVisibility(0);
|
||||
this.mImgOriginDelete.setVisibility(8);
|
||||
Glide.a(this.mActivity).a(Integer.valueOf(R.color.bg_3E5570)).a(this.mVideo);
|
||||
this.mDescTv.setVisibility(0);
|
||||
this.imgVideoAdd.setBackgroundResource(R.drawable.diy_add_video);
|
||||
} else {
|
||||
this.imgVideoAdd.setBackgroundResource(R.drawable.icon_play);
|
||||
this.mImgOriginDelete.setVisibility(0);
|
||||
this.mDescTv.setVisibility(8);
|
||||
RequestBuilder<Drawable> a = Glide.a(this.mActivity).a(this.localVideoCoverPath);
|
||||
a.a(new RequestOptions().a(true).a(DiskCacheStrategy.b).b().a(R.mipmap.diy_video_cover_default));
|
||||
a.a(this.mVideo);
|
||||
LogUtils.c("重新加载视频封面:" + this.localVideoCoverPath);
|
||||
}
|
||||
this.mNavBarView.setRightEnabled(!isEmpty);
|
||||
this.mNavBarView.setRightAlpha(!isEmpty ? 1.0f : 0.3f);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void uploadModelFile(DiyDBModel diyDBModel, TransportFile transportFile) {
|
||||
DiyTransportServiceImpl.getInstance().uploadModelFile(diyDBModel, transportFile, new DiyTransportServiceImpl.UploadStateListener() { // from class: com.ubt.jimu.diy.view.fragment.OriginalityShowFragment.6
|
||||
@Override // com.ubt.jimu.transport3.DiyTransportServiceImpl.UploadStateListener
|
||||
public void onUploadComplete() {
|
||||
OriginalityShowFragment.this.hideLoading();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.transport3.DiyTransportServiceImpl.UploadStateListener
|
||||
public void onUploadFailure() {
|
||||
OriginalityShowFragment.this.finishShowActivity();
|
||||
OriginalityShowFragment.this.hideLoading();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.transport3.DiyTransportServiceImpl.UploadStateListener
|
||||
public void onUploadSucceed() {
|
||||
OriginalityShowFragment.this.finishShowActivity();
|
||||
OriginalityShowFragment.this.hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public /* synthetic */ void b() {
|
||||
this.mActivity.finish();
|
||||
}
|
||||
|
||||
protected void hideLoading() {
|
||||
JAlertDialog jAlertDialog = this.mJAlertDialog;
|
||||
if (jAlertDialog == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
jAlertDialog.dismiss();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onActivityResult(int i, int i2, Intent intent) {
|
||||
super.onActivityResult(i, i2, intent);
|
||||
if (-1 != i2 || intent == null) {
|
||||
return;
|
||||
}
|
||||
ArrayList<HPMedia> arrayList = (ArrayList) intent.getSerializableExtra("result_data");
|
||||
this.modify = true;
|
||||
setVideoPath(arrayList);
|
||||
saveVideoCover(this.mModel.getModelCreatedId(), this.mModel.getCustomModelId());
|
||||
updateVideo();
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
return layoutInflater.inflate(R.layout.fragment_origin, viewGroup, false);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroy() {
|
||||
this.disposables.dispose();
|
||||
this.disposables.a();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onViewCreated(View view, Bundle bundle) {
|
||||
super.onViewCreated(view, bundle);
|
||||
initView(view);
|
||||
initData();
|
||||
bindClick();
|
||||
}
|
||||
|
||||
protected void showLoading(String str) {
|
||||
if (this.mJAlertDialog == null) {
|
||||
JAlertDialog.Builder builder = new JAlertDialog.Builder(getContext());
|
||||
builder.a(R.drawable.ic_loading);
|
||||
builder.a(str);
|
||||
builder.a(true);
|
||||
this.mJAlertDialog = builder.a();
|
||||
}
|
||||
this.mJAlertDialog.show();
|
||||
}
|
||||
}
|
137
sources/com/ubt/jimu/diy/view/fragment/ProductBuildFragment.java
Normal file
137
sources/com/ubt/jimu/diy/view/fragment/ProductBuildFragment.java
Normal file
@@ -0,0 +1,137 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.db.diy.DiyStep2Helper;
|
||||
import com.ubt.jimu.base.db.diy.DiyStep2Model;
|
||||
import com.ubt.jimu.diy.model.FansModel;
|
||||
import com.ubt.jimu.diy.view.adapter.BuildAdapter;
|
||||
import com.ubt.jimu.unity.bluetooth.UnityActivity;
|
||||
import com.ubt.jimu.utils.smartScaleTool.ScreenUtils;
|
||||
import com.ubt.jimu.widgets.SpaceItemDecoration;
|
||||
import com.ubt.jimu.widgets.TitleDiyView;
|
||||
import com.ubtech.utils.DisplayUtil;
|
||||
import com.ubtech.view.fragment.BaseFragment;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class ProductBuildFragment extends BaseFragment {
|
||||
private BuildAdapter mBuildAdapter;
|
||||
private List<FansModel> mFLists;
|
||||
private RecyclerView rvBuild;
|
||||
private TitleDiyView title;
|
||||
private String uuid;
|
||||
|
||||
private void configAdapterWidth() {
|
||||
this.rvBuild.post(new Runnable() { // from class: com.ubt.jimu.diy.view.fragment.ProductBuildFragment.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
ProductBuildFragment.this.mBuildAdapter.setWh(ScreenUtils.a(0.6666667f, ProductBuildFragment.this.rvBuild, ((BaseFragment) ProductBuildFragment.this).mActivity.getResources().getDimension(R.dimen.diy_edit_list_left), 3));
|
||||
ProductBuildFragment.this.mBuildAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static ProductBuildFragment create(String str, String str2) {
|
||||
ProductBuildFragment productBuildFragment = new ProductBuildFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(BuildStepFragment.UUID, str);
|
||||
bundle.putString(UnityActivity.pModelName, str2);
|
||||
productBuildFragment.setArguments(bundle);
|
||||
return productBuildFragment;
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
this.uuid = getArguments().getString(BuildStepFragment.UUID);
|
||||
DiyStep2Model queryForUUid = DiyStep2Helper.getInstance().queryForUUid(this.uuid);
|
||||
if (queryForUUid == null) {
|
||||
queryForUUid = new DiyStep2Model();
|
||||
queryForUUid.setCustomModelId(this.uuid);
|
||||
queryForUUid.setModelName(getArguments().getString(UnityActivity.pModelName));
|
||||
DiyStep2Helper.getInstance().insertData(queryForUUid);
|
||||
}
|
||||
this.title.setDiyTitle(this.mActivity.getString(R.string.diy_build));
|
||||
initList(queryForUUid);
|
||||
this.mBuildAdapter = new BuildAdapter(this.mActivity, this.mFLists);
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(this.mActivity, 3);
|
||||
this.rvBuild.a(new SpaceItemDecoration(DisplayUtil.a(this.mActivity, getResources().getDimension(R.dimen.diy_edit_list_bottom)), DisplayUtil.a(this.mActivity, getResources().getDimension(R.dimen.diy_edit_list_left)), 3));
|
||||
this.rvBuild.setLayoutManager(gridLayoutManager);
|
||||
this.rvBuild.setAdapter(this.mBuildAdapter);
|
||||
this.mBuildAdapter.setModel(queryForUUid);
|
||||
configAdapterWidth();
|
||||
}
|
||||
|
||||
private void initList(DiyStep2Model diyStep2Model) {
|
||||
this.mFLists = new ArrayList();
|
||||
FansModel fansModel = new FansModel();
|
||||
fansModel.setLock(1);
|
||||
fansModel.setCompleteState(diyStep2Model.getStep1state().intValue());
|
||||
fansModel.setRightNext("diy_bulid_step_1");
|
||||
fansModel.setItemName(this.mActivity.getString(R.string.diy_step));
|
||||
FansModel fansModel2 = new FansModel();
|
||||
fansModel2.setLock(diyStep2Model.getStep2lock().intValue());
|
||||
fansModel2.setCompleteState(diyStep2Model.getStep2state().intValue());
|
||||
fansModel2.setRightNext("diy_bulid_step_2");
|
||||
fansModel2.setItemName(this.mActivity.getString(R.string.diy_final));
|
||||
FansModel fansModel3 = new FansModel();
|
||||
fansModel3.setLock(diyStep2Model.getStep3lock().intValue());
|
||||
fansModel3.setCompleteState(diyStep2Model.getStep3state().intValue());
|
||||
fansModel3.setRightNext("diy_bulid_step_3");
|
||||
fansModel3.setItemName(this.mActivity.getString(R.string.diy_config));
|
||||
FansModel fansModel4 = new FansModel();
|
||||
fansModel4.setLock(diyStep2Model.getStep4lock().intValue());
|
||||
fansModel4.setCompleteState(diyStep2Model.getStep4state().intValue());
|
||||
fansModel4.setRightNext("diy_bulid_step_4");
|
||||
fansModel4.setItemName(this.mActivity.getString(R.string.diy_part));
|
||||
this.mFLists.add(fansModel);
|
||||
this.mFLists.add(fansModel2);
|
||||
this.mFLists.add(fansModel3);
|
||||
this.mFLists.add(fansModel4);
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
this.title = (TitleDiyView) ((BaseFragment) this).mView.findViewById(R.id.title);
|
||||
this.rvBuild = (RecyclerView) ((BaseFragment) this).mView.findViewById(R.id.rv_build);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
return layoutInflater.inflate(R.layout.fragment_product_build, viewGroup, false);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
DiyStep2Model queryForUUid = DiyStep2Helper.getInstance().queryForUUid(this.uuid);
|
||||
if (queryForUUid != null) {
|
||||
this.mFLists.get(0).setLock(1);
|
||||
this.mFLists.get(0).setCompleteState(queryForUUid.getStep1state().intValue());
|
||||
this.mFLists.get(1).setLock(queryForUUid.getStep2lock().intValue());
|
||||
this.mFLists.get(1).setCompleteState(queryForUUid.getStep2state().intValue());
|
||||
this.mFLists.get(2).setLock(queryForUUid.getStep3lock().intValue());
|
||||
this.mFLists.get(2).setCompleteState(queryForUUid.getStep3state().intValue());
|
||||
this.mFLists.get(3).setLock(queryForUUid.getStep4lock().intValue());
|
||||
this.mFLists.get(3).setCompleteState(queryForUUid.getStep4state().intValue());
|
||||
}
|
||||
this.mBuildAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onViewCreated(View view, Bundle bundle) {
|
||||
super.onViewCreated(view, bundle);
|
||||
((BaseFragment) this).mView = view;
|
||||
initView();
|
||||
initData();
|
||||
}
|
||||
}
|
@@ -0,0 +1,98 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.diy.DiyPublishment;
|
||||
import com.ubt.jimu.diy.view.adapter.PublishHistoryAdapter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class PublishHistoryFragment extends Fragment {
|
||||
private static final String ARG_PARAM1 = "param1";
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
private PublishHistoryAdapter adapter;
|
||||
private Unbinder mBind;
|
||||
private OnFragmentInteractionListener mListener;
|
||||
private String mParam1;
|
||||
private String mParam2;
|
||||
private List<DiyPublishment> publishments = new ArrayList();
|
||||
protected RecyclerView recyclerView;
|
||||
|
||||
public interface OnFragmentInteractionListener {
|
||||
void onPublishHistoryBackClick();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
this.publishments.add(new DiyPublishment());
|
||||
}
|
||||
this.adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public static PublishHistoryFragment newInstance(String str, String str2) {
|
||||
PublishHistoryFragment publishHistoryFragment = new PublishHistoryFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(ARG_PARAM1, str);
|
||||
bundle.putString(ARG_PARAM2, str2);
|
||||
publishHistoryFragment.setArguments(bundle);
|
||||
return publishHistoryFragment;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // android.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
if (context instanceof OnFragmentInteractionListener) {
|
||||
this.mListener = (OnFragmentInteractionListener) context;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.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 // android.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
View inflate = layoutInflater.inflate(R.layout.fragment_publish_history, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
this.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
this.adapter = new PublishHistoryAdapter(getContext(), this.publishments);
|
||||
this.recyclerView.setAdapter(this.adapter);
|
||||
initData();
|
||||
return inflate;
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
this.mBind.unbind();
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
this.mListener = null;
|
||||
}
|
||||
|
||||
protected void onImgBack(View view) {
|
||||
OnFragmentInteractionListener onFragmentInteractionListener = this.mListener;
|
||||
if (onFragmentInteractionListener != null) {
|
||||
onFragmentInteractionListener.onPublishHistoryBackClick();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.view.View;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.Unbinder;
|
||||
import butterknife.internal.DebouncingOnClickListener;
|
||||
import butterknife.internal.Utils;
|
||||
import com.ubt.jimu.R;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class PublishHistoryFragment_ViewBinding implements Unbinder {
|
||||
private PublishHistoryFragment target;
|
||||
private View view7f090237;
|
||||
|
||||
public PublishHistoryFragment_ViewBinding(final PublishHistoryFragment publishHistoryFragment, View view) {
|
||||
this.target = publishHistoryFragment;
|
||||
publishHistoryFragment.recyclerView = (RecyclerView) Utils.b(view, R.id.recyclerView, "field 'recyclerView'", RecyclerView.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.PublishHistoryFragment_ViewBinding.1
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
publishHistoryFragment.onImgBack(view2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
PublishHistoryFragment publishHistoryFragment = this.target;
|
||||
if (publishHistoryFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
publishHistoryFragment.recyclerView = null;
|
||||
this.view7f090237.setOnClickListener(null);
|
||||
this.view7f090237 = null;
|
||||
}
|
||||
}
|
140
sources/com/ubt/jimu/diy/view/fragment/UserDiyFragment.java
Normal file
140
sources/com/ubt/jimu/diy/view/fragment/UserDiyFragment.java
Normal file
@@ -0,0 +1,140 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.recyclelib.URecyclerView;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.db.diy.DiyDBModel;
|
||||
import com.ubt.jimu.base.db.diy.DiyHelper;
|
||||
import com.ubt.jimu.base.event.BaseEvent;
|
||||
import com.ubt.jimu.diy.view.adapter.UserDiyAdapter;
|
||||
import com.ubt.jimu.utils.smartScaleTool.ScreenUtils;
|
||||
import com.ubt.jimu.widgets.SpaceItemDecoration;
|
||||
import com.ubt.jimu.widgets.choosePhotos.media.HPMedia;
|
||||
import com.ubtech.utils.DisplayUtil;
|
||||
import com.ubtech.view.fragment.BaseFragment;
|
||||
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 UserDiyFragment extends BaseFragment {
|
||||
public UserDiyAdapter adapter;
|
||||
private Unbinder mBind;
|
||||
protected URecyclerView recyclerView;
|
||||
private List<DiyDBModel> diyRobots = new ArrayList();
|
||||
private int count = 1;
|
||||
|
||||
static /* synthetic */ int access$008(UserDiyFragment userDiyFragment) {
|
||||
int i = userDiyFragment.count;
|
||||
userDiyFragment.count = i + 1;
|
||||
return i;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void configAdapterWidth() {
|
||||
this.adapter.setWh(ScreenUtils.a(0.8333333f, this.recyclerView, getResources().getDimension(R.dimen.diy_edit_list_left), 3));
|
||||
this.adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
this.adapter = new UserDiyAdapter(this.mActivity, this.diyRobots);
|
||||
this.recyclerView.setLayoutManager(new GridLayoutManager(this.mActivity, 3));
|
||||
this.recyclerView.a(new SpaceItemDecoration(DisplayUtil.a(getContext(), this.mActivity.getResources().getDimension(R.dimen.diy_edit_list_bottom)), DisplayUtil.a(getContext(), this.mActivity.getResources().getDimension(R.dimen.diy_edit_list_left)), 3, true));
|
||||
this.recyclerView.setAdapter(this.adapter);
|
||||
this.recyclerView.setLoadingListener(new URecyclerView.LoadingListener() { // from class: com.ubt.jimu.diy.view.fragment.UserDiyFragment.1
|
||||
@Override // com.recyclelib.URecyclerView.LoadingListener
|
||||
public void onLoadingMore() {
|
||||
UserDiyFragment.access$008(UserDiyFragment.this);
|
||||
}
|
||||
|
||||
@Override // com.recyclelib.URecyclerView.LoadingListener
|
||||
public void onRefreshing() {
|
||||
UserDiyFragment.this.count = 1;
|
||||
UserDiyFragment.this.loadData();
|
||||
}
|
||||
});
|
||||
this.recyclerView.post(new Runnable() { // from class: com.ubt.jimu.diy.view.fragment.UserDiyFragment.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
UserDiyFragment.this.configAdapterWidth();
|
||||
}
|
||||
});
|
||||
this.recyclerView.setLoadingMoreEnabled(false);
|
||||
}
|
||||
|
||||
public static UserDiyFragment newInstance(String str, String str2) {
|
||||
return new UserDiyFragment();
|
||||
}
|
||||
|
||||
public View getItemInfo() {
|
||||
return this.adapter.getItemView();
|
||||
}
|
||||
|
||||
public void loadData() {
|
||||
this.diyRobots.clear();
|
||||
this.diyRobots.addAll(DiyHelper.getInstance().getDiyList());
|
||||
this.adapter.notifyDataSetChanged();
|
||||
this.adapter.notifySelect();
|
||||
this.recyclerView.y();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onActivityResult(int i, int i2, Intent intent) {
|
||||
super.onActivityResult(i, i2, intent);
|
||||
if (-1 != i2 || intent == null) {
|
||||
return;
|
||||
}
|
||||
this.adapter.setPopupwindow(((HPMedia) ((ArrayList) intent.getSerializableExtra("result_data")).get(0)).getPath());
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
EventBus.b().c(this);
|
||||
}
|
||||
|
||||
@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_user_diy, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
return inflate;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
EventBus.b().d(this);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroyView() {
|
||||
this.mBind.unbind();
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEventData(BaseEvent baseEvent) {
|
||||
loadData();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
loadData();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onViewCreated(View view, Bundle bundle) {
|
||||
super.onViewCreated(view, bundle);
|
||||
initData();
|
||||
}
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
package com.ubt.jimu.diy.view.fragment;
|
||||
|
||||
import android.view.View;
|
||||
import butterknife.Unbinder;
|
||||
import butterknife.internal.Utils;
|
||||
import com.recyclelib.URecyclerView;
|
||||
import com.ubt.jimu.R;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class UserDiyFragment_ViewBinding implements Unbinder {
|
||||
private UserDiyFragment target;
|
||||
|
||||
public UserDiyFragment_ViewBinding(UserDiyFragment userDiyFragment, View view) {
|
||||
this.target = userDiyFragment;
|
||||
userDiyFragment.recyclerView = (URecyclerView) Utils.b(view, R.id.recyclerView, "field 'recyclerView'", URecyclerView.class);
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
UserDiyFragment userDiyFragment = this.target;
|
||||
if (userDiyFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
userDiyFragment.recyclerView = null;
|
||||
}
|
||||
}
|
@@ -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