| | |
| | | package safeluck.drive.evaluation.fragment.rulefragments; |
| | | |
| | | import android.os.Bundle; |
| | | import android.util.Log; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.Button; |
| | | import android.widget.TextView; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.appcompat.widget.Toolbar; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.R; |
| | | |
| | | /** |
| | | * DriveJudge |
| | |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | public class FragmentSetting1 extends SupportFragment { |
| | | private static final String ARG_NUMBER = "arg_number"; |
| | | private static final String TAG = FragmentSetting1.class.getSimpleName(); |
| | | private TextView mTvName; |
| | | private Button mBtnNext, mBtnNextWithFinish; |
| | | |
| | | private int mNumber; |
| | | |
| | | public static FragmentSetting0 newInstance(String number) { |
| | | FragmentSetting0 fragment = new FragmentSetting0(); |
| | | Bundle args = new Bundle(); |
| | | args.putInt(ARG_NUMBER, Integer.parseInt(number)); |
| | | fragment.setArguments(args); |
| | | return fragment; |
| | | } |
| | | |
| | | @Override |
| | | public void onCreate(@Nullable Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | Bundle args = getArguments(); |
| | | if (args != null) { |
| | | mNumber =Integer.parseInt(args.getString(ARG_NUMBER)) ; |
| | | Log.i(TAG,"mNumber="+mNumber); |
| | | } |
| | | } |
| | | |
| | | @Nullable |
| | | @Override |
| | | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | View view = inflater.inflate(R.layout.fragment_largeitem_setting, container, false); |
| | | initView(view); |
| | | return view; |
| | | } |
| | | |
| | | private void initView(View view) { |
| | | |
| | | mTvName = (TextView) view.findViewById(R.id.tv_name); |
| | | mBtnNext = (Button) view.findViewById(R.id.btn_next); |
| | | mBtnNextWithFinish = (Button) view.findViewById(R.id.btn_next_with_finish); |
| | | |
| | | String title = "CyclerFragment " + mNumber; |
| | | |
| | | |
| | | |
| | | mTvName.setText(title); |
| | | mBtnNext.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | start(FragmentSetting0.newInstance(mNumber + 1+"")); |
| | | } |
| | | }); |
| | | mBtnNextWithFinish.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | startWithPop(FragmentSetting0.newInstance(mNumber + 1+"")); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |