app/src/main/java/safeluck/drive/evaluation/fragment/SysExamSettingFragment.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/cview/TextCheckBox.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/java/safeluck/drive/evaluation/fragment/shop/ShopFragment.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/res/layout/layout_fragment_setlights.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/res/layout/layout_fragment_stationsettin.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
app/src/main/java/safeluck/drive/evaluation/fragment/SysExamSettingFragment.java
@@ -14,6 +14,7 @@ import java.util.List; import me.yokeyword.fragmentation.SupportFragment; import safeluck.drive.evaluation.MainActivity; import safeluck.drive.evaluation.R; import safeluck.drive.evaluation.adapter.SysSettingPagerAdapter; import safeluck.drive.evaluation.bean.SysExamSettingLargeMenu; @@ -47,7 +48,7 @@ } private void initView(View view) { mRecy = (RecyclerView) view.findViewById(R.id.recy); ((MainActivity)_mActivity).btn_return.setVisibility(View.VISIBLE); mAdapter = new SysSettingPagerAdapter(_mActivity); LinearLayoutManager manager = new LinearLayoutManager(_mActivity); mRecy.setLayoutManager(manager); app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/cview/TextCheckBox.java
@@ -3,9 +3,11 @@ import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.LinearLayout; import android.widget.TextView; @@ -17,9 +19,11 @@ * 邮箱:632393724@qq.com * All Rights Saved! Chongqing AnYun Tech co. LTD */ public class TextCheckBox extends LinearLayout { public class TextCheckBox extends LinearLayout implements View.OnClickListener { private CheckBox checkBox; private boolean isChecked = false; private static final String TAG = "TextCheckBox"; public TextCheckBox(Context context) { this(context,null); } @@ -42,12 +46,37 @@ TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.TextCheckBox_attr_tvcheck); String string = typedArray.getString(R.styleable.TextCheckBox_attr_tvcheck_txt_des_check); boolean aBoolean = typedArray.getBoolean(R.styleable.TextCheckBox_attr_tvcheck_check_not, false); isChecked = aBoolean; TextView text = view.findViewById(R.id.tv_checkbox); text.setText(string); checkBox = view.findViewById(R.id.check_setting); checkBox.setChecked(aBoolean); checkBox.setClickable(false); checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean Checked) { Log.i(TAG,"点击了checkbox checked="+Checked); isChecked = Checked; } }); setOnClickListener(this); } @Override public void onClick(View v) { Log.i(TAG,"点击,未取反之前isChecked="+isChecked); isChecked =!isChecked; checkBox.setChecked(isChecked); } /** * 获取Checkbox是否选中状态,选中为true * * @return */ public boolean isChecked(){ return isChecked; } } app/src/main/java/safeluck/drive/evaluation/fragment/shop/ShopFragment.java
@@ -13,6 +13,7 @@ import java.util.Arrays; import me.yokeyword.fragmentation.SupportFragment; import safeluck.drive.evaluation.MainActivity; import safeluck.drive.evaluation.R; import safeluck.drive.evaluation.bean.SysExamSettingLargeMenu; @@ -52,7 +53,7 @@ private void initView(View view, Bundle savedInstanceState) { mToolbar = (Toolbar) view.findViewById(R.id.toolbar); ((MainActivity)_mActivity).btn_return.setVisibility(View.GONE); mToolbar.setTitle(mMenu.getMenuName()); initToolbarNav(mToolbar); app/src/main/res/layout/layout_fragment_setlights.xml
New file @@ -0,0 +1,45 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText android:layout_width="match_parent" android:layout_height="wrap_content" app:txt_des_tvedit = "打转向灯后多少毫秒转弯或起步" app:et_input="3000" /> <safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText android:layout_width="match_parent" android:layout_height="wrap_content" app:txt_des_tvedit = "转向灯最长使用距离" app:et_input="200" /> <safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText android:layout_width="match_parent" android:layout_height="wrap_content" app:txt_des_tvedit = "转向灯最长使用时间/秒" app:et_input="27" /> <safeluck.drive.evaluation.fragment.rulefragments.cview.TextCheckBox android:layout_width="match_parent" android:layout_height="50dp" app:txt_des_check = "变更车道或超车时保持转向灯3秒以上视为打转向灯"/> <safeluck.drive.evaluation.fragment.rulefragments.cview.TextCheckBox android:layout_width="match_parent" android:layout_height="50dp" app:txt_des_check = "在转弯时灯光保持3秒视为打转向灯"/> <safeluck.drive.evaluation.fragment.rulefragments.cview.TextCheckBox android:layout_width="match_parent" android:layout_height="50dp" app:txt_des_check = "变道之后转弯需要重新关闭和打开转向灯"/> <safeluck.drive.evaluation.fragment.rulefragments.cview.TextCheckBox android:layout_width="match_parent" android:layout_height="50dp" app:txt_des_check = "在转弯时灯光保持3秒视为完成转弯项目"/> </LinearLayout> app/src/main/res/layout/layout_fragment_stationsettin.xml
New file @@ -0,0 +1,21 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText android:layout_width="match_parent" android:layout_height="wrap_content" app:txt_des_tvedit = "学校/车站/横道区域最高速度" app:et_input="25" /> <safeluck.drive.evaluation.fragment.rulefragments.cview.TextCheckBox android:layout_width="match_parent" android:layout_height="50dp" app:txt_des_check = "当踩了刹车不评判速度"/> </LinearLayout>