92 lines
3.2 KiB
Java
92 lines
3.2 KiB
Java
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;
|
|
}
|
|
}
|