| | |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.Button; |
| | | import android.widget.ListView; |
| | | |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | |
| | | import com.anyun.exam.lib.AYSdk; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | public class NetWorkTrainFragment extends SupportFragment { |
| | | public class NetWorkTrainFragment extends SupportFragment implements View.OnClickListener { |
| | | |
| | | private ListView mListView ; |
| | | private Button btn_start_exam; |
| | | private ScoreAdapter mScoreAdapter; |
| | | |
| | | private List<ScoreBean> mArrayList = new ArrayList<>(); |
| | |
| | | mListView = view.findViewById(R.id.lv); |
| | | mScoreAdapter = new ScoreAdapter(_mActivity); |
| | | mListView.setAdapter(mScoreAdapter); |
| | | btn_start_exam = view.findViewById(R.id.btn_start); |
| | | btn_start_exam.setOnClickListener(this); |
| | | mListView.addHeaderView(LayoutInflater.from(_mActivity).inflate(R.layout.layout_score_item,null)); |
| | | mArrayList.add(new ScoreBean(12,"直角转弯","后轮胎压线")); |
| | | mArrayList.add(new ScoreBean(100,"倒车入库","未系安全带")); |
| | |
| | | mScoreAdapter.addDatas(mArrayList); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | switch (v.getId()){ |
| | | case R.id.btn_start: |
| | | AYSdk.getInstance().at_sendCmd("AT+BEGIN_EXAM:0\r\n"); |
| | | break; |
| | | } |
| | | } |
| | | } |