From f5a6da1f77245fa8104f9e275cca13342654ffab Mon Sep 17 00:00:00 2001 From: endian11 <Dana_Lee1016@126.com> Date: 星期四, 24 九月 2020 15:40:07 +0800 Subject: [PATCH] 完成档位相关设置 --- app/src/main/res/values/attrs.xml | 9 app/src/main/java/safeluck/drive/evaluation/fragment/shop/ShopFragment.java | 2 app/src/main/res/layout/layout_road_train.xml | 300 ++++++++++++------------ app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java | 1 app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/cview/TextEditText.java | 82 ++++++ app/src/main/res/layout/layout_text_checkbox.xml | 20 + app/src/main/java/safeluck/drive/evaluation/fragment/shop/ContentFragment.java | 16 + app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/FragmentSetting1.java | 70 +++++ app/src/main/res/layout/fragment_gear_setting.xml | 111 +++++++++ app/src/main/res/layout/fragment_largeitem_setting.xml | 3 app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/FragmentSetting0.java | 48 --- app/src/main/res/layout/layout_viewgroup_tv_edit.xml | 25 ++ app/src/main/res/values/dimens.xml | 1 13 files changed, 501 insertions(+), 187 deletions(-) diff --git a/app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java b/app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java index f952304..7f453b4 100644 --- a/app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java +++ b/app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java @@ -1202,6 +1202,7 @@ if (routeCross.getIdx()==roadCrossInfo.getCrossing_index()&&routeCross.getRoad()==roadCrossInfo.getRoad_id()){ Log.i(TAG,"璇ヨ矾鍙e凡缁忛�夋嫨浜嗚椹舵柟鍚戯紝纭畾瑕佽鐩栦互鍓嶏紵"); MyDialog myDialog = MyDialog.Companion.newInstance("璇ヨ矾鍙e凡缁忛�夋嫨浜嗚椹舵柟鍚戯紝纭畾瑕佽鐩栦互鍓嶏紵"); + myDialog.setCancelable(false); hasInsertRoadCrossDirect = true; myDialog.setOnClick(new MyDialog.MyOnClickListener() { @Override diff --git a/app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/FragmentSetting0.java b/app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/FragmentSetting0.java index 8420598..8e43a3d 100644 --- a/app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/FragmentSetting0.java +++ b/app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/FragmentSetting0.java @@ -1,6 +1,7 @@ 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; @@ -12,16 +13,15 @@ import me.yokeyword.fragmentation.SupportFragment; import safeluck.drive.evaluation.R; +import safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText; /** * Created by YoKeyword on 16/2/7. */ public class FragmentSetting0 extends SupportFragment { private static final String ARG_NUMBER = "arg_number"; - - private Toolbar mToolbar; - private TextView mTvName; - private Button mBtnNext, mBtnNextWithFinish; + private static final String TAG = FragmentSetting0.class.getSimpleName(); + private TextEditText textEditText; private int mNumber; @@ -38,50 +38,22 @@ super.onCreate(savedInstanceState); Bundle args = getArguments(); if (args != null) { - mNumber =Integer.parseInt(args.getString(ARG_NUMBER)) ; + mNumber =args.getInt(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); + View view = inflater.inflate(R.layout.fragment_gear_setting, container, false); initView(view); return view; } private void initView(View view) { - mToolbar = (Toolbar) view.findViewById(R.id.toolbar); - 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; - - mToolbar.setTitle(title); - initToolbarNav(mToolbar); - - 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+"")); - } - }); + textEditText = view.findViewById(R.id.textet1); + textEditText.getInput(); } - protected void initToolbarNav(Toolbar toolbar) { - toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp); - toolbar.setNavigationOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - pop(); - } - }); - } + } diff --git a/app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/FragmentSetting1.java b/app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/FragmentSetting1.java index 7839fad..dbe7d2b 100644 --- a/app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/FragmentSetting1.java +++ b/app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/FragmentSetting1.java @@ -1,6 +1,18 @@ 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 @@ -9,4 +21,62 @@ * 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+"")); + } + }); + } + } diff --git a/app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/cview/TextEditText.java b/app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/cview/TextEditText.java new file mode 100644 index 0000000..a84913e --- /dev/null +++ b/app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/cview/TextEditText.java @@ -0,0 +1,82 @@ +package safeluck.drive.evaluation.fragment.rulefragments.cview; + +import android.content.Context; +import android.content.res.TypedArray; +import android.text.Editable; +import android.text.TextWatcher; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.TextView; + +import safeluck.drive.evaluation.R; + +/** + * DriveJudge + * Created by lzw on 2020/9/23. 15:10:43 + * 閭锛�632393724@qq.com + * All Rights Saved! Chongqing AnYun Tech co. LTD + */ +public class TextEditText extends LinearLayout { + + private TextView tv_des; + private EditText editText; + + public TextEditText(Context context) { + this(context,null); + + } + + + + public TextEditText(Context context, AttributeSet attrs) { + this(context,attrs,0); + + } + + public TextEditText(Context context, AttributeSet attrs, int defStyleAttr) { + this(context, attrs, defStyleAttr,0); + } + + public TextEditText(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + initView(context,attrs); + } + + private void initView(Context context, AttributeSet attrs) { + View view = LayoutInflater.from(context).inflate(R.layout.layout_viewgroup_tv_edit,this,true); + int[] textEditText_attr = R.styleable.TextEditText_attr; + TypedArray typedArray = context.obtainStyledAttributes(attrs, textEditText_attr); + String des = typedArray.getString(R.styleable.TextEditText_attr_txt_des_tvedit); + String input = typedArray.getString(R.styleable.TextEditText_attr_et_input); + tv_des = view.findViewById(R.id.tv_des); + editText = view.findViewById(R.id.et_value_setting); + + editText.setText(input); + + editText.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + + } + }); + tv_des.setText(des); + } + + public String getInput(){ + String edite = editText.getText().toString().trim(); + return edite; + } +} diff --git a/app/src/main/java/safeluck/drive/evaluation/fragment/shop/ContentFragment.java b/app/src/main/java/safeluck/drive/evaluation/fragment/shop/ContentFragment.java index 9a21a8e..edf952f 100644 --- a/app/src/main/java/safeluck/drive/evaluation/fragment/shop/ContentFragment.java +++ b/app/src/main/java/safeluck/drive/evaluation/fragment/shop/ContentFragment.java @@ -10,10 +10,16 @@ import androidx.annotation.Nullable; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + import me.yokeyword.fragmentation.SupportFragment; import me.yokeyword.fragmentation.anim.DefaultNoAnimator; import me.yokeyword.fragmentation.anim.FragmentAnimator; import safeluck.drive.evaluation.R; +import safeluck.drive.evaluation.fragment.BaseSettingFragment; +import safeluck.drive.evaluation.fragment.rulefragments.FragmentSetting0; +import safeluck.drive.evaluation.fragment.rulefragments.FragmentSetting1; /** * Created by YoKeyword on 16/2/9. @@ -24,6 +30,8 @@ private TextView mTvContent; private Button mBtnNext; + + private int currPos = 0; private String mMenu; public static ContentFragment newInstance(String menu) { @@ -46,10 +54,16 @@ } switch (mMenu){ case "妗d綅鐩稿叧璁剧疆": + currPos = 0; + + loadRootFragment(R.id.fl_content_container, FragmentSetting0 .newInstance(String.valueOf(currPos)),false,false ); break; case "甯哥敤鍙傛暟璁剧疆": + currPos = 1; + loadRootFragment(R.id.fl_content_container, FragmentSetting1.newInstance(String.valueOf(currPos)),false,false ); break; case "閫氱敤璇勫垽璁剧疆": + currPos = 2; break; case "涓婅溅璧锋璁剧疆": break; @@ -69,7 +83,7 @@ return view; } - private void initView(View view) { + private void initView(View view) { // mTvContent = (TextView) view.findViewById(R.id.tv_content); diff --git a/app/src/main/java/safeluck/drive/evaluation/fragment/shop/ShopFragment.java b/app/src/main/java/safeluck/drive/evaluation/fragment/shop/ShopFragment.java index b0f434f..bc7ffd4 100644 --- a/app/src/main/java/safeluck/drive/evaluation/fragment/shop/ShopFragment.java +++ b/app/src/main/java/safeluck/drive/evaluation/fragment/shop/ShopFragment.java @@ -77,7 +77,7 @@ * * @param fragment */ - public void switchContentFragment(ContentFragment fragment) { + public void switchContentFragment(ContentFragment fragment) { SupportFragment contentFragment = findChildFragment(ContentFragment.class); if (contentFragment != null) { contentFragment.replaceFragment(fragment, false); diff --git a/app/src/main/res/layout/fragment_gear_setting.xml b/app/src/main/res/layout/fragment_gear_setting.xml new file mode 100644 index 0000000..33fc812 --- /dev/null +++ b/app/src/main/res/layout/fragment_gear_setting.xml @@ -0,0 +1,111 @@ +<?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:orientation="vertical" + android:layout_height="match_parent"> +<safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:txt_des_tvedit = "鍏佽妗d綅涓嶅尮閰�/绉�" + android:id="@+id/textet1" + app:et_input="3" + /> + <safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:txt_des_tvedit = "鍔犲噺妗i」鐩厑璁告。浣嶄笉鍖归厤姣" + app:et_input="300" + /><safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:txt_des_tvedit = "1鎸℃渶闀夸娇鐢ㄨ窛绂�/绫�" + app:et_input="120" + android:id="@+id/tedit_1_gear" + /><safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:txt_des_tvedit = "2鎸℃渶闀夸娇鐢ㄨ窛绂�/绫�" + app:et_input="120" + android:id="@+id/tedit_2_gear" + /> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="@dimen/ui_margin_60dp" + android:orientation="horizontal"> + <safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText + android:layout_width="0dp" + android:layout_height="wrap_content" + app:txt_des_tvedit = "1鎸¢�熷害鑼冨洿" + android:layout_weight="1" + app:et_input="0" + android:id="@+id/tedit_1_gear_" + /><safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText + android:layout_width="0dp" + android:layout_height="wrap_content" + app:txt_des_tvedit = "鍒�" + android:layout_weight="1" + app:et_input="20" + android:id="@+id/tedit_1_gea_r" + /> + </LinearLayout> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="@dimen/ui_margin_60dp" + android:orientation="horizontal"> + <safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText + android:layout_width="0dp" + android:layout_height="wrap_content" + app:txt_des_tvedit = "2鎸¢�熷害鑼冨洿" + android:layout_weight="1" + app:et_input="5" + android:id="@+id/tedit_2_gear_" + /><safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText + android:layout_width="0dp" + android:layout_height="wrap_content" + app:txt_des_tvedit = "鍒�" + android:layout_weight="1" + app:et_input="30" + android:id="@+id/tedit_2_gea_r" + /> + </LinearLayout> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="@dimen/ui_margin_60dp" + android:orientation="horizontal"> + <safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText + android:layout_width="0dp" + android:layout_height="wrap_content" + app:txt_des_tvedit = "3鎸¢�熷害鑼冨洿" + android:layout_weight="1" + app:et_input="15" + android:id="@+id/tedit_3_gear_" + /><safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText + android:layout_width="0dp" + android:layout_height="wrap_content" + app:txt_des_tvedit = "鍒�" + android:layout_weight="1" + app:et_input="40" + android:id="@+id/tedit_3_gea_r" + /> + </LinearLayout> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="@dimen/ui_margin_60dp" + android:orientation="horizontal"> + <safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText + android:layout_width="0dp" + android:layout_height="wrap_content" + app:txt_des_tvedit = "4鎸¢�熷害鑼冨洿" + android:layout_weight="1" + app:et_input="25" + android:id="@+id/tedit_4_gear_" + /><safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText + android:layout_width="0dp" + android:layout_height="wrap_content" + app:txt_des_tvedit = "鍒�" + android:layout_weight="1" + app:et_input="50" + android:id="@+id/tedit_4_gea_r" + /> + </LinearLayout> +</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_largeitem_setting.xml b/app/src/main/res/layout/fragment_largeitem_setting.xml index 0b33a73..fb29093 100644 --- a/app/src/main/res/layout/fragment_largeitem_setting.xml +++ b/app/src/main/res/layout/fragment_largeitem_setting.xml @@ -4,7 +4,7 @@ android:layout_height="match_parent" android:orientation="vertical"> - <include layout="@layout/toolbar"/> + <TextView android:id="@+id/tv_name" @@ -13,6 +13,7 @@ android:layout_marginTop="16dp" android:gravity="center_horizontal" android:text="CyclerFragment1" + android:textColor="@android:color/white" android:textSize="30sp"/> <Button diff --git a/app/src/main/res/layout/layout_road_train.xml b/app/src/main/res/layout/layout_road_train.xml index 62475ff..65b4621 100644 --- a/app/src/main/res/layout/layout_road_train.xml +++ b/app/src/main/res/layout/layout_road_train.xml @@ -1,158 +1,166 @@ <?xml version="1.0" encoding="utf-8"?> -<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_height="match_parent" - android:layout_width="match_parent" - xmlns:app="http://schemas.android.com/apk/res-auto"> +<GridLayout android:layout_width="match_parent" + android:layout_height="110dp" + android:columnCount="6" + android:orientation="horizontal" + android:rowCount="2" + xmlns:android="http://schemas.android.com/apk/res/android"> - -<TableLayout - - android:layout_width="match_parent" - android:layout_height="45dp" - android:padding="@dimen/ui_margin_5dp" - android:gravity="bottom"> - - - -<TableRow android:layout_width="match_parent" - android:id="@+id/first" - android:layout_height="35dp"> - <Button android:id="@+id/btn_1" - android:layout_width="0dp" - android:layout_weight="1" - android:layout_height="wrap_content" - android:textColor="#FFFFFF" - style="@style/ui_exam_font" + <Button + android:id="@+id/btn_3" + android:layout_height="@dimen/ui_margin_40dp" + android:layout_rowWeight="1" + android:layout_columnWeight="1" + android:layout_marginLeft="@dimen/ui_margin_10dp" + android:layout_marginTop="@dimen/ui_margin_5dp" android:layout_marginRight="@dimen/ui_margin_10dp" - android:background="@drawable/btn_exam_item_bg" - android:text="@string/straight_line"/> - <Button android:id="@+id/btn_2" - android:layout_width="0dp" - android:layout_weight="1" - android:layout_height="wrap_content" - android:textColor="#FFFFFF" - android:background="@drawable/btn_exam_item_bg" - android:layout_marginRight="@dimen/ui_margin_10dp" - style="@style/ui_exam_font" - android:text="@string/add_subtract"/> - <Button android:id="@+id/btn_3" - android:layout_width="0dp" - android:layout_weight="1" - android:layout_height="wrap_content" - android:textColor="#FFFFFF" - android:background="@drawable/btn_exam_item_bg" - android:layout_marginRight="@dimen/ui_margin_10dp" - style="@style/ui_exam_font" - android:text="@string/pull_over"/> - <Button android:id="@+id/btn_4" - android:layout_width="0dp" - android:layout_weight="1" - android:layout_height="wrap_content" - android:textColor="#FFFFFF" - android:background="@drawable/btn_exam_item_bg" - android:layout_marginRight="@dimen/ui_margin_10dp" - style="@style/ui_exam_font" - android:text="@string/by_crossing"/> - <Button android:id="@+id/btn_5" - android:layout_width="0dp" - android:layout_weight="1" - android:layout_height="wrap_content" - android:textColor="#FFFFFF" - style="@style/ui_exam_font" - android:background="@drawable/btn_exam_item_bg" - android:layout_marginRight="@dimen/ui_margin_10dp" - android:text="@string/junction_left"/> - <Button android:id="@+id/btn_6" - android:layout_width="0dp" - android:layout_weight="1" - android:layout_height="wrap_content" - android:textColor="#FFFFFF" - android:background="@drawable/btn_exam_item_bg" - android:layout_marginRight="@dimen/ui_margin_10dp" - style="@style/ui_exam_font" - android:text="@string/junction_right"/> - <Button android:id="@+id/btn_12" - android:layout_width="0dp" - android:layout_weight="1" - android:layout_height="wrap_content" - android:textColor="#FFFFFF" - android:background="@drawable/btn_exam_item_bg" + android:layout_marginBottom="5dp" + android:background="@drawable/btn_item_collect_bg" + android:text="@string/pull_over" + android:textColor="@color/color_ffffff" /> - style="@style/ui_exam_font" - android:text="@string/lane_change"/> -</TableRow> - - <TableRow android:layout_width="match_parent" - android:id="@+id/second" - android:layout_height="35dp"> - - <Button android:id="@+id/btn_7" - android:layout_width="0dp" - android:layout_weight="1" - android:layout_height="wrap_content" - android:textColor="#FFFFFF" - android:background="@drawable/btn_exam_item_bg" + <Button android:text="@string/add_subtract" + android:layout_columnWeight="1" + android:layout_height="@dimen/ui_margin_40dp" + android:layout_rowWeight="1" + android:id="@+id/btn_2" + android:layout_marginTop="@dimen/ui_margin_5dp" + android:layout_marginLeft="@dimen/ui_margin_10dp" android:layout_marginRight="@dimen/ui_margin_10dp" - style="@style/ui_exam_font" - android:text="@string/crosswalk"/> - <Button android:id="@+id/btn_8" - android:layout_width="0dp" - android:layout_weight="1" - android:layout_height="wrap_content" - android:textColor="#FFFFFF" - style="@style/ui_exam_font" - android:background="@drawable/btn_exam_item_bg" - android:layout_marginRight="@dimen/ui_margin_10dp" - android:text="@string/school_area"/> + android:layout_marginBottom="5dp" + android:textColor="@color/color_ffffff" + android:background="@drawable/btn_item_collect_bg" + /> - <Button android:id="@+id/btn_9" - android:layout_width="0dp" - android:layout_weight="1" - android:layout_height="wrap_content" - android:textColor="#FFFFFF" - style="@style/ui_exam_font" - android:background="@drawable/btn_exam_item_bg" + <Button android:text="@string/crosswalk" + android:layout_marginLeft="@dimen/ui_margin_10dp" android:layout_marginRight="@dimen/ui_margin_10dp" - android:text="@string/bus_area"/> - <Button android:id="@+id/btn_10" - android:layout_width="0dp" - android:layout_weight="1" - android:layout_height="wrap_content" - android:textColor="#FFFFFF" - style="@style/ui_exam_font" - android:background="@drawable/btn_exam_item_bg" + android:layout_marginBottom="5dp" + android:layout_height="@dimen/ui_margin_40dp" + android:textColor="@color/color_ffffff" + android:layout_width="wrap_content" + android:layout_columnWeight="1" + android:layout_marginTop="@dimen/ui_margin_5dp" + + android:layout_rowWeight="1" + android:id="@+id/btn_7" + android:background="@drawable/btn_item_collect_bg"/> + + <Button android:text="@string/straight_line" + android:textColor="@color/color_ffffff" + android:layout_height="@dimen/ui_margin_40dp" + android:layout_columnWeight="1" + android:layout_rowWeight="1" + android:layout_marginTop="@dimen/ui_margin_5dp" + + android:layout_marginLeft="@dimen/ui_margin_10dp" android:layout_marginRight="@dimen/ui_margin_10dp" - android:text="@string/turn_around"/> - <Button android:id="@+id/btn_14" - android:layout_width="0dp" - android:layout_weight="1" - android:layout_height="wrap_content" - android:textColor="#FFFFFF" - android:background="@drawable/btn_exam_item_bg" - android:layout_marginRight="@dimen/ui_margin_10dp" - style="@style/ui_exam_font" - android:text="@string/start_vehicle"/> - <Button android:id="@+id/btn_16" - android:textColor="#FFFFFF" - style="@style/ui_exam_font" - android:background="@drawable/btn_exam_item_bg" - android:layout_marginRight="@dimen/ui_margin_10dp" - android:layout_width="0dp" - android:layout_weight="1" - android:layout_height="wrap_content" - android:text="@string/pull_over"/> + android:layout_marginBottom="5dp" + android:id="@+id/btn_1" + android:background="@drawable/btn_item_collect_bg"/> + + <Button android:text="@string/lane_change" + android:layout_marginTop="@dimen/ui_margin_5dp" + android:layout_marginLeft="@dimen/ui_margin_10dp" + android:layout_marginRight="@dimen/ui_margin_10dp" + android:layout_marginBottom="5dp" + android:layout_height="@dimen/ui_margin_40dp" + android:layout_columnWeight="1" + android:id="@+id/btn__5" + android:layout_rowWeight="1" + android:textColor="@color/color_ffffff" + android:background="@drawable/btn_item_collect_bg" + /> - <Button android:id="@+id/btn_13" - android:layout_width="0dp" - android:layout_weight="1" - android:layout_height="@dimen/ui_margin_45dp" - android:textColor="#FFFFFF" - android:background="@drawable/btn_exam_item_bg" + <Button android:text="@string/over_take" + android:layout_marginTop="@dimen/ui_margin_5dp" + android:layout_marginLeft="@dimen/ui_margin_10dp" + android:layout_marginRight="@dimen/ui_margin_10dp" + android:layout_marginBottom="5dp" + android:id="@+id/btn__7" + android:layout_height="@dimen/ui_margin_40dp" + android:textColor="@color/color_ffffff" + android:layout_columnWeight="1" + android:layout_rowWeight="1" + android:background="@drawable/btn_item_collect_bg"/> - style="@style/ui_exam_font" - android:text="@string/night_driving"/> - </TableRow> + <Button android:text="@string/school_area" + android:layout_marginLeft="@dimen/ui_margin_10dp" + android:layout_marginRight="@dimen/ui_margin_10dp" + android:layout_marginBottom="5dp" + android:textColor="@color/color_ffffff" + android:layout_height="@dimen/ui_margin_40dp" + android:id="@+id/btn_8" + android:layout_columnWeight="1" + android:layout_rowWeight="1" + android:background="@drawable/btn_item_collect_bg"/> -</TableLayout> -</ScrollView> \ No newline at end of file + <Button android:text="@string/bus_area" + android:layout_marginLeft="@dimen/ui_margin_10dp" + android:layout_marginRight="@dimen/ui_margin_10dp" + android:layout_marginBottom="5dp" + android:textColor="@color/color_ffffff" + android:layout_columnWeight="1" + android:id="@+id/btn_9" + android:layout_rowWeight="1" + android:background="@drawable/btn_item_collect_bg"/> + + <Button android:text="@string/side_by_side" + android:layout_columnWeight="1" + android:layout_rowWeight="1" + android:layout_marginLeft="@dimen/ui_margin_10dp" + android:layout_marginRight="@dimen/ui_margin_10dp" + android:id="@+id/btn_re_6" + android:layout_marginBottom="5dp" + android:textColor="@color/color_ffffff" + android:background="@drawable/btn_item_collect_bg" + /> + <Button android:text="@string/junction_left" + android:layout_height="@dimen/ui_margin_40dp" + android:layout_marginLeft="@dimen/ui_margin_10dp" + android:layout_marginRight="@dimen/ui_margin_10dp" + android:layout_marginBottom="5dp" + android:textColor="@color/color_ffffff" + + android:id="@+id/btn_5" + android:layout_columnWeight="1" + android:layout_rowWeight="1" + android:background="@drawable/btn_item_collect_bg"/> + + <Button android:text="@string/junction_right" + android:layout_marginLeft="@dimen/ui_margin_10dp" + android:layout_marginRight="@dimen/ui_margin_10dp" + android:layout_marginBottom="5dp" + android:textColor="@color/color_ffffff" + android:layout_height="@dimen/ui_margin_40dp" + android:layout_columnWeight="1" + android:id="@+id/btn_6" + android:layout_rowWeight="1" + android:background="@drawable/btn_item_collect_bg"/> + <Button android:text="@string/turn_around" + android:layout_columnWeight="1" + android:layout_rowWeight="1" + android:id="@+id/btn_10" + android:layout_height="@dimen/ui_margin_40dp" + android:layout_marginLeft="@dimen/ui_margin_10dp" + android:layout_marginRight="@dimen/ui_margin_10dp" + android:layout_marginBottom="5dp" + android:textColor="@color/color_ffffff" + android:background="@drawable/btn_item_collect_bg" + /> + + <Button android:text="@string/by_crossing" + android:layout_height="@dimen/ui_margin_40dp" + android:textColor="@color/color_ffffff" + android:layout_marginLeft="@dimen/ui_margin_10dp" + android:id="@+id/btn_4" + android:visibility="gone" + android:layout_marginRight="@dimen/ui_margin_10dp" + android:layout_marginBottom="5dp" + android:background="@drawable/btn_item_collect_bg" + android:layout_columnWeight="1" + android:layout_rowWeight="1" + /> + +</GridLayout> diff --git a/app/src/main/res/layout/layout_text_checkbox.xml b/app/src/main/res/layout/layout_text_checkbox.xml new file mode 100644 index 0000000..43189ac --- /dev/null +++ b/app/src/main/res/layout/layout_text_checkbox.xml @@ -0,0 +1,20 @@ +<?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:orientation="horizontal" + android:gravity="center_vertical" + android:padding="@dimen/ui_margin_10dp" + android:layout_height="match_parent"> +<CheckBox + android:layout_width="@dimen/ui_margin_40dp" + android:layout_height="@dimen/ui_margin_40dp" + android:id="@+id/check_setting"/> + <TextView + android:layout_width="match_parent" + android:text="閫変腑寮�濮嬫垜浠�" + android:id="@+id/tv_checkbox" + android:gravity="center_vertical" + android:textColor="@android:color/white" + android:textSize="@dimen/network_train_textsize22px" + android:layout_height="@dimen/ui_margin_50dp"/> +</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/layout_viewgroup_tv_edit.xml b/app/src/main/res/layout/layout_viewgroup_tv_edit.xml new file mode 100644 index 0000000..1b4f0ce --- /dev/null +++ b/app/src/main/res/layout/layout_viewgroup_tv_edit.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="horizontal" android:layout_width="match_parent" + android:gravity="center_vertical" + android:padding="@dimen/ui_margin_5dp" + android:layout_height="@dimen/ui_margin_60dp"> +<TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@android:color/white" + android:layout_weight="1" + + android:id="@+id/tv_des" + android:textSize="@dimen/network_train_textsize26px" + android:text="鎻忚堪鎬ц瑷�"/> + <EditText + android:layout_width="wrap_content" + android:layout_height="@dimen/ui_margin_50dp" + android:layout_weight="1" + android:id="@+id/et_value_setting" + android:textSize="@dimen/network_train_textsize26px" + android:background="@android:drawable/editbox_background_normal" + android:text="3"/> + +</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 5dc8219..7d19aa3 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -22,4 +22,13 @@ <!-- <attr name="view_height" format="integer"/>--> <!-- <attr name="view_width" format="integer"/>--> </declare-styleable> + <declare-styleable name="TextEditText_attr"> + <attr name="txt_des_tvedit" format="string"/> + <attr name="et_input" format="string"/> + </declare-styleable> + <declare-styleable name="TextCheckBox_attr_tvcheck"> + <attr name="txt_des_check" format="string"/> + <attr name="check_not" format="boolean"/> + + </declare-styleable> </resources> \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index cc83eaa..321c02e 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -33,5 +33,6 @@ <dimen name="dialog_content_line_space">8dp</dimen> <dimen name="dialog_item_image_height_width">60dp</dimen> + <dimen name="ui_margin_60dp">60dp</dimen> </resources> \ No newline at end of file -- Gitblit v1.8.0