app/src/main/java/safeluck/drive/evaluation/MainActivity.java
@@ -259,6 +259,7 @@ } @Override protected void onDestroy() { super.onDestroy(); app/src/main/java/safeluck/drive/evaluation/customview/MyInputDialog.kt
New file @@ -0,0 +1,133 @@ package safeluck.drive.evaluation.customview import android.app.Dialog import android.graphics.Color import android.graphics.drawable.ColorDrawable import android.os.Build import android.os.Bundle import android.text.Editable import android.text.TextUtils import android.text.TextWatcher import android.util.DisplayMetrics import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.view.WindowManager import android.widget.Button import androidx.fragment.app.DialogFragment import com.google.android.material.textfield.TextInputEditText import com.google.android.material.textfield.TextInputLayout import safeluck.drive.evaluation.R /** * * @ProjectName: DriveJudge * @Package: safeluck.drive.evaluation.customview * @ClassName: MyDialog * @Description: java类作用描述 * @Author: 李占伟 * @CreateDate: 2020-04-29 16:46 * @UpdateUser: 更新者 * @UpdateDate: 2020-04-29 16:46 * @UpdateRemark: 更新说明 * @Version: 1.0 */ class MyInputDialog : DialogFragment() { lateinit var button: Button lateinit var button_cancle: Button lateinit var textInput: TextInputEditText lateinit var textInputLayout: TextInputLayout var mess: String? = null lateinit var onClick:MyOnClickListener override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { if(dialog!=null){ var windown = dialog!!.window; windown?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) windown?.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) dialog?.setOnShowListener { windown?.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) hideBottomUIMenu()} } var view = inflater.inflate(R.layout.layout_input_dlg,container,false) initView(view) return view } override fun onStart() { super.onStart() val dialog: Dialog? = dialog if (dialog != null) { val dm = DisplayMetrics() activity!!.windowManager.defaultDisplay.getMetrics(dm) var width:Int = (dm.widthPixels * 0.5).toInt() dialog.window.setLayout(width , ViewGroup.LayoutParams.WRAP_CONTENT) } } private fun initView(view: View?) { mess = arguments?.getString("message") button = view!!.findViewById(R.id.btn_sure_) textInput = view!!.findViewById(R.id.tiet_road_num) textInput.addTextChangedListener(object : TextWatcher { override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {} override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {} override fun afterTextChanged(s: Editable?) { if (textInput.text?.length!! > 0) { textInputLayout.isErrorEnabled = false } } }) textInputLayout = view!!.findViewById(R.id.til_password) button_cancle = view!!.findViewById(R.id.btn_cancle_) button.setOnClickListener { var str = textInput.text.toString().trim() if (!TextUtils.isEmpty(str)) { onClick.onSure(str) dismiss() } else { textInputLayout.error = "线路名称不能为空" } } button_cancle.setOnClickListener { onClick.onCancle() dismiss() } } /** * 隐藏虚拟按键,并且全屏 */ protected fun hideBottomUIMenu() { //隐藏虚拟按键,并且全屏 if (Build.VERSION.SDK_INT > 11 && Build.VERSION.SDK_INT < 19) { // lower api val v = this.dialog?.window?.decorView v?.systemUiVisibility = View.GONE } else if (Build.VERSION.SDK_INT >= 19) { //for new api versions. val decorView = dialog?.window?.decorView val uiOptions = (View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY or View.SYSTEM_UI_FLAG_FULLSCREEN) decorView?.systemUiVisibility = uiOptions } } companion object{ fun newInstance(message:String):MyInputDialog{ var myDialog= MyInputDialog() var bundle = Bundle() bundle.putString("message",message) myDialog.arguments = bundle return myDialog } } interface MyOnClickListener{ fun onSure(string: String) fun onCancle() } } app/src/main/java/safeluck/drive/evaluation/customview/SelectDialogThree.java
@@ -45,9 +45,10 @@ public static final int FIRST = 0; public static final int SECOND = 1; public static final int THIRD = 2; public static final int FORTH= 3; public static final int SELECT_NONE = -1; private int result = SELECT_NONE; private RadioButton rb_1,rb_2,rb_3; private RadioButton rb_1,rb_2,rb_3,rb_4; private ArrayList<String> stringArrayList; @@ -82,10 +83,12 @@ rb_1 = view.findViewById(R.id.rb1); rb_2 = view.findViewById(R.id.rb2); rb_3 = view.findViewById(R.id.rb3); rb_4 = view.findViewById(R.id.rb4); if (stringArrayList != null){ rb_1.setText(stringArrayList.get(0)); rb_2.setText(stringArrayList.get(1)); rb_3.setText(stringArrayList.get(2)); rb_4.setText(stringArrayList.get(3)); } rgb = view.findViewById(R.id.radiogroub); rgb.setOnCheckedChangeListener((RadioGroup group, int checkedId)-> { @@ -101,6 +104,9 @@ case R.id.rb3: result = THIRD; break; case R.id.rb4: result = FORTH; break; default:break; } }); app/src/main/java/safeluck/drive/evaluation/fragment/HomeFragment.java
@@ -24,6 +24,7 @@ import safeluck.drive.evaluation.R; import safeluck.drive.evaluation.bean.ExamPlatformData; import safeluck.drive.evaluation.customview.MyDialog; import safeluck.drive.evaluation.customview.MyInputDialog; /** @@ -110,25 +111,25 @@ break; case R.id.exit_sys: MyDialog myDialog = MyDialog.Companion.newInstance("您将退出系统,请确认数据已保存"); myDialog.setOnClick(new MyDialog.MyOnClickListener() { @Override public void onSure() { AYSdk.getInstance().uninit(); _mActivity.finish(); System.exit(0); } @Override public void onCancle() { } }); myDialog.show(getFragmentManager(),"mydialog"); // MyDialog myDialog = MyDialog.Companion.newInstance("您将退出系统,请确认数据已保存"); // // myDialog.setOnClick(new MyDialog.MyOnClickListener() { // @Override // public void onSure() { // AYSdk.getInstance().uninit(); // _mActivity.finish(); // System.exit(0); // // // } // // @Override // public void onCancle() { // // } // }); // // myDialog.show(getFragmentManager(),"mydialog"); app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java
@@ -66,6 +66,7 @@ import safeluck.drive.evaluation.cEventCenter.CEventCenter; import safeluck.drive.evaluation.cEventCenter.ICEventListener; import safeluck.drive.evaluation.customview.MyInputDialog; import safeluck.drive.evaluation.customview.QRCodeDialog; import safeluck.drive.evaluation.customview.SelectDialog; import safeluck.drive.evaluation.customview.SelectDialogThree; @@ -75,6 +76,7 @@ import safeluck.drive.evaluation.platformMessage.JKMessage0204; import safeluck.drive.evaluation.platformMessage.PlatFormConstant; import safeluck.drive.evaluation.util.Utils; import safeluck.drive.evaluation.widget.StatusDialog; /**单机训练UI * MyApplication2 @@ -575,15 +577,17 @@ // //TODO 发送JKMessage0202 给平台,开始考试 if (btn_start_exam.getText().toString().equalsIgnoreCase("开始训练")){ SelectDialogThree selectDialog = SelectDialogThree.newInstance("场地训练","道路训练","道路训练(不含灯光)"); SelectDialogThree selectDialog = SelectDialogThree.newInstance("场地训练","道路训练","道路训练(不含灯光)","线路采集"); selectDialog.setSelectedListener((int res)->{ if (res != SelectDialog.SELECT_NONE){ if (res== SelectDialogThree.FIRST){ sendJK0202(2); }else if (res== SelectDialogThree.SECOND){ sendJK0202(3); }else { }else if (res == SelectDialogThree.THIRD){ sendJK0202(4); }else{ Toast.makeText(_mActivity, "线路采集", Toast.LENGTH_SHORT).show(); } } }); @@ -599,10 +603,28 @@ case R.id.view_map: String url = getArcGisUrl(ExamPlatformData.getInstance().getExamType()); Log.i(TAG,"map head lulao gps url="+url); startArcGisMapFragment(url); // String url = getArcGisUrl(ExamPlatformData.getInstance().getExamType()); // Log.i(TAG,"map head lulao gps url="+url); // startArcGisMapFragment(url); // StatusDialog.with(_mActivity).setCancelable(true).setPrompt("加载中,请稍后...").setType(StatusDialog.Type.PROGRESS).show(); MyInputDialog myDialog = MyInputDialog.Companion.newInstance("您将退出系统,请确认数据已保存"); myDialog.setOnClick(new MyInputDialog.MyOnClickListener() { @Override public void onSure(String string) { Log.i(TAG,"收到的:"+string); } @Override public void onCancle() { } }); myDialog.show(getFragmentManager(),"mydialog"); break; case R.id.iv_head: MyLog.i(TAG,"学员签到"); app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/BaseSettingFragment.java
New file @@ -0,0 +1,12 @@ package safeluck.drive.evaluation.fragment.rulefragments; import me.yokeyword.fragmentation.SupportFragment; /** * DriveJudge * Created by lzw on 2020/9/14. 10:22:25 * 邮箱:632393724@qq.com * All Rights Saved! Chongqing AnYun Tech co. LTD */ class BaseSettingFragment extends SupportFragment { } app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/FragmentSetting0.java
File was renamed from app/src/main/java/safeluck/drive/evaluation/fragment/LargeItemSettingFragment.java @@ -1,4 +1,4 @@ package safeluck.drive.evaluation.fragment; package safeluck.drive.evaluation.fragment.rulefragments; import android.os.Bundle; import android.view.LayoutInflater; @@ -16,7 +16,7 @@ /** * Created by YoKeyword on 16/2/7. */ public class LargeItemSettingFragment extends SupportFragment { public class FragmentSetting0 extends SupportFragment { private static final String ARG_NUMBER = "arg_number"; private Toolbar mToolbar; @@ -25,10 +25,10 @@ private int mNumber; public static LargeItemSettingFragment newInstance(int number) { LargeItemSettingFragment fragment = new LargeItemSettingFragment(); public static FragmentSetting0 newInstance(String number) { FragmentSetting0 fragment = new FragmentSetting0(); Bundle args = new Bundle(); args.putInt(ARG_NUMBER, number); args.putInt(ARG_NUMBER, Integer.parseInt(number)); fragment.setArguments(args); return fragment; } @@ -38,7 +38,7 @@ super.onCreate(savedInstanceState); Bundle args = getArguments(); if (args != null) { mNumber = args.getInt(ARG_NUMBER); mNumber =Integer.parseInt(args.getString(ARG_NUMBER)) ; } } @@ -65,13 +65,13 @@ mBtnNext.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { start(LargeItemSettingFragment.newInstance(mNumber + 1)); start(FragmentSetting0.newInstance(mNumber + 1+"")); } }); mBtnNextWithFinish.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startWithPop(LargeItemSettingFragment.newInstance(mNumber + 1)); startWithPop(FragmentSetting0.newInstance(mNumber + 1+"")); } }); } app/src/main/java/safeluck/drive/evaluation/fragment/rulefragments/FragmentSetting1.java
New file @@ -0,0 +1,12 @@ package safeluck.drive.evaluation.fragment.rulefragments; import me.yokeyword.fragmentation.SupportFragment; /** * DriveJudge * Created by lzw on 2020/9/14. 10:16:39 * 邮箱:632393724@qq.com * All Rights Saved! Chongqing AnYun Tech co. LTD */ public class FragmentSetting1 extends SupportFragment { } app/src/main/java/safeluck/drive/evaluation/fragment/shop/ContentFragment.java
@@ -44,6 +44,16 @@ if (args != null) { mMenu = args.getString(ARG_MENU); } switch (mMenu){ case "档位相关设置": break; case "常用参数设置": break; case "通用评判设置": break; case "上车起步设置": break; } } @Override @@ -60,20 +70,9 @@ } private void initView(View view) { mTvContent = (TextView) view.findViewById(R.id.tv_content); mBtnNext = (Button) view.findViewById(R.id.btn_next); // mTvContent = (TextView) view.findViewById(R.id.tv_content); mTvContent.setText("Content:\n" + mMenu); mBtnNext.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // 和MsgFragment同级别的跳转 交给MsgFragment处理 if (getParentFragment() instanceof ShopFragment) { // ((ShopFragment) getParentFragment()).start(CycleFragment.newInstance(1)); } } }); } @Override app/src/main/java/safeluck/drive/evaluation/fragment/shop/MenuListFragment.java
@@ -94,7 +94,6 @@ mAdapter.setItemChecked(0); } } private void showContent(int position) { if (position == mCurrentPosition) { return; @@ -105,8 +104,9 @@ mAdapter.setItemChecked(position); ContentFragment fragment = ContentFragment.newInstance(mMenus.get(position)); ((ShopFragment) getParentFragment()).switchContentFragment(fragment); } @Override app/src/main/java/safeluck/drive/evaluation/widget/MyWidgetDialog.java
New file @@ -0,0 +1,186 @@ package safeluck.drive.evaluation.widget; import android.app.Dialog; import android.content.res.Configuration; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Build; import android.os.Bundle; import android.text.TextUtils; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import androidx.annotation.LayoutRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.StyleRes; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.DialogFragment; /** * DriveJudge * Created by lzw on 2020/9/15. 10:49:12 * 邮箱:632393724@qq.com * All Rights Saved! Chongqing AnYun Tech co. LTD */ public class MyWidgetDialog extends DialogFragment { protected DialogParams mDialogParams; @Override public void onStart() { super.onStart(); Window window = getDialog().getWindow(); WindowManager.LayoutParams params = window.getAttributes(); params.width = WindowManager.LayoutParams.WRAP_CONTENT; params.height = WindowManager.LayoutParams.WRAP_CONTENT; hideBottomUIMenu(); window.setAttributes(params); } protected void show(AppCompatActivity activity,String tag){ if (!TextUtils.isEmpty(tag)){ show(activity.getSupportFragmentManager(),tag); }else{ show(activity.getSupportFragmentManager(),activity.getClass().getSimpleName()); } } /** * 隐藏虚拟按键,并且全屏 */ protected void hideBottomUIMenu() { //隐藏虚拟按键,并且全屏 if (Build.VERSION.SDK_INT > 11 && Build.VERSION.SDK_INT < 19) { // lower api View v = getDialog().getWindow().getDecorView(); v.setSystemUiVisibility(View.GONE); } else if (Build.VERSION.SDK_INT >= 19) { //for new api versions. View decorView =getDialog().getWindow().getDecorView(); int uiOptions = (View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN); decorView.setSystemUiVisibility(uiOptions); } } protected boolean isNonEmpty(String content) { return !TextUtils.isEmpty(content); } @Override public void onConfigurationChanged(Configuration newConfig) { dismiss(); super.onConfigurationChanged(newConfig); } @NonNull @Override public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); View dialogLayout = LayoutInflater.from(getContext()).inflate(setLayoutRes(),null); builder.setView(dialogLayout); onViewCreated(dialogLayout, null); return builder.create(); } public class DialogParams { AppCompatActivity activity; int style; int animations; int contentView; String tag; boolean isCancelable; String prompt; int type = -1; } protected int setLayoutRes() { return mDialogParams.contentView; } @StyleRes protected int setAnimations() { return mDialogParams.animations; } @Nullable @Override public final View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { getDialog().setCanceledOnTouchOutside(setCancelable()); Window window = getDialog().getWindow(); int animationsRes = setAnimations(); if (animationsRes != 0 && animationsRes != -1) { window.setWindowAnimations(animationsRes); } setCancelable(setCancelable()); //设置背景透明 window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); int gravity = setGravity(); //即未设置 if (gravity != -1 && gravity != 0) { window.setGravity(gravity); } return super.onCreateView(inflater, container, savedInstanceState); } private int setGravity() { return Gravity.CENTER; } private boolean setCancelable() { return mDialogParams.isCancelable; } public MyWidgetDialog() { this.mDialogParams = new DialogParams(); } protected static class Builder{ private MyWidgetDialog dialog; private DialogParams params; public Builder(AppCompatActivity activity){ dialog = new MyWidgetDialog(); params = dialog.mDialogParams; params.activity = activity; } public Builder setStyle(int val){ params.style = val; return this; } public Builder setAnimations(int val) { params.animations = val; return this; } public Builder setContentView(@LayoutRes int val) { params.contentView = val; return this; } public Builder setCancelable(boolean val) { params.isCancelable = val; return this; } public MyWidgetDialog build() { if (params.contentView == -1) { throw new IllegalArgumentException("Please set setContentView"); } dialog.show(params.activity, params.tag); return dialog; } } protected void show(AppCompatActivity activity) { show(activity.getSupportFragmentManager(), activity.getClass().getSimpleName()); } } app/src/main/java/safeluck/drive/evaluation/widget/StatusDialog.java
New file @@ -0,0 +1,171 @@ package safeluck.drive.evaluation.widget; import android.graphics.PorterDuff; import android.os.Bundle; import android.os.Handler; import android.util.Log; import android.view.View; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.DialogFragment; import java.util.Timer; import java.util.TimerTask; import safeluck.drive.evaluation.R; import safeluck.drive.evaluation.customview.MyDialog; /** * DriveJudge * Created by lzw on 2020/9/15. 10:42:53 * 邮箱:632393724@qq.com * All Rights Saved! Chongqing AnYun Tech co. LTD */ public class StatusDialog extends MyWidgetDialog { private static final String TAG = "StatusDialog"; private Handler mMainHandler = new Handler(); /** * 成功或错误2秒后dismiss */ public static final int DELAY_TIME = 2000; private Timer mDelayTimer; public StatusDialog() { super(); } public static Builder with(AppCompatActivity activity) { return new Builder(activity); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { TextView tvDialogStatusContent = view.findViewById(R.id.tv_dialog_status_prompt); ImageView imgDialogStatusShow = view.findViewById(R.id.img_dialog_status_show); ProgressBar pbDialogStatusShow = view.findViewById(R.id.pb_dialog_status_show); //更换圆形进度条颜色 pbDialogStatusShow.getIndeterminateDrawable() .setColorFilter(getResources().getColor(R.color.colorPrimaryDark), PorterDuff.Mode.SRC_ATOP); //填充数据 if (isNonEmpty(mDialogParams.prompt)) { Log.i(TAG,""+mDialogParams.prompt); tvDialogStatusContent.setText(mDialogParams.prompt); } switch (mDialogParams.type) { case Type.ERROR: pbDialogStatusShow.setVisibility(View.GONE); imgDialogStatusShow.setVisibility(View.VISIBLE); imgDialogStatusShow.setImageResource(R.mipmap.icon_dialog_error); break; case Type.SUCCESS: pbDialogStatusShow.setVisibility(View.GONE); imgDialogStatusShow.setVisibility(View.VISIBLE); imgDialogStatusShow.setImageResource(R.mipmap.icon_dialog_success); break; case Type.PROGRESS: imgDialogStatusShow.setVisibility(View.GONE); pbDialogStatusShow.setVisibility(View.VISIBLE); break; } } public interface Type { int PROGRESS = 0x000000000211; int ERROR = 0x000000000985; int SUCCESS = 0x00000000011; } @Override protected int setLayoutRes() { return R.layout.dialog_status; } @Override public void dismiss() { super.dismiss(); cancelTimer(); } @Override public void onPause() { super.onPause(); cancelTimer(); } private void cancelTimer() { if (mDelayTimer != null) { mDelayTimer.cancel(); } } protected boolean setCancelable() { return mDialogParams.isCancelable; } @Override public void onStart() { super.onStart(); /** * 显示定时间后自动dismiss */ if (mDialogParams.type == Type.SUCCESS || mDialogParams.type == Type.ERROR) { cancelTimer(); mDelayTimer = new Timer(); mDelayTimer.schedule(new TimerTask() { @Override public void run() { mMainHandler.post(new Runnable() { @Override public void run() { dismiss(); } }); } }, DELAY_TIME); } } public static class Builder { AppCompatActivity activity; DialogParams P; StatusDialog progressDialog; public Builder(AppCompatActivity activity) { progressDialog = new StatusDialog(); this.P = progressDialog.mDialogParams; this.activity = activity; } public Builder setPrompt(String val) { P.prompt = val; return this; } public Builder setCancelable(boolean val) { P.isCancelable = val; return this; } public Builder setType(int val) { P.type = val; return this; } public StatusDialog show() { if (P.type == -1) { throw new IllegalArgumentException("Please set type"); } progressDialog.show(activity); return progressDialog; } } } app/src/main/res/drawable/background_alert_dialog.xml
New file @@ -0,0 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@color/dialog_background"/> <corners android:radius="@dimen/dialog_corners"/> </shape> app/src/main/res/drawable/bg_item_select.xml
New file @@ -0,0 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@color/color_0ab0ef" /> <corners android:radius="5dp" /> </shape> app/src/main/res/drawable/btn_item_collect_bg.xml
New file @@ -0,0 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_pressed="true" android:drawable="@drawable/bg_item_select"></item> <item android:drawable="@drawable/btn_exam_item_bg"></item> </selector> app/src/main/res/layout/dialog_status.xml
New file @@ -0,0 +1,69 @@ <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="0dp" android:layout_height="0dp" android:background="@drawable/background_alert_dialog" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintDimensionRatio="7:4" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintWidth_percent="0.6"> <ProgressBar android:id="@+id/pb_dialog_status_show" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" app:layout_constraintBottom_toTopOf="@+id/gl_dialog_status_line" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.7"/> <ImageView android:id="@+id/img_dialog_status_show" android:layout_width="0dp" android:layout_height="0dp" android:scaleType="fitXY" android:src="@mipmap/icon_dialog_success" app:layout_constraintBottom_toTopOf="@+id/gl_dialog_status_line" app:layout_constraintDimensionRatio="1:1" app:layout_constraintHeight_percent="0.3" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.7"/> <androidx.constraintlayout.widget.Guideline android:id="@+id/gl_dialog_status_line" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" app:layout_constraintGuide_percent="0.6"/> <TextView android:id="@+id/tv_dialog_status_prompt" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/dialog_margin_left_right" android:layout_marginStart="@dimen/dialog_margin_left_right" android:ellipsize="end" android:gravity="center" android:maxLines="1" android:text="加载中…" android:textColor="@android:color/black" android:textSize="@dimen/dialog_text_size" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toBottomOf="@+id/gl_dialog_status_line" app:layout_constraintVertical_bias="0.3"/> </androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout> app/src/main/res/layout/fragment_content.xml
@@ -2,10 +2,13 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical"> <TextView android:orientation="vertical"> <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/fl_content_container"/> <!-- <TextView android:id="@+id/tv_content" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -24,6 +27,6 @@ android:layout_marginRight="16dp" android:layout_marginTop="32dp" android:textAllCaps="false" android:text="start_cycler"/> android:text="start_cycler"/>--> </LinearLayout> app/src/main/res/layout/layout_input_dlg.xml
New file @@ -0,0 +1,64 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:background="@drawable/bg_select_dlg" android:orientation="vertical" > <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="@dimen/network_train_textsize20px" android:textColor="@android:color/white" android:layout_margin="@dimen/ui_margin_10dp" android:text="线路名称:"/> <com.google.android.material.textfield.TextInputLayout android:id="@+id/til_password" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="@dimen/ui_margin_10dp"> <com.google.android.material.textfield.TextInputEditText android:id="@+id/tiet_road_num" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="请输入线路名称" android:textColorHint="@android:color/white" android:textColor="@android:color/white" android:inputType="text"/> </com.google.android.material.textfield.TextInputLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginTop="@dimen/ui_margin_10dp" android:text="确定" android:padding="@dimen/ui_margin_20dp" android:textSize="@dimen/network_train_textsize22px" android:background="@drawable/bg_rgb_dlg" android:textColor="@android:color/white" android:id="@+id/btn_sure_"/> <Button android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:padding="@dimen/ui_margin_20dp" android:layout_marginTop="@dimen/ui_margin_10dp" android:text="取消" android:textSize="@dimen/network_train_textsize22px" android:visibility="gone" android:background="@drawable/bg_rgb_dlg" android:textColor="@android:color/white" android:id="@+id/btn_cancle_"/> </LinearLayout> </LinearLayout> app/src/main/res/layout/layout_project_collect.xml
New file @@ -0,0 +1,161 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="@drawable/stu_score_bg"> <TextView android:layout_width="match_parent" android:layout_height="38dp" android:background="@drawable/stu_score_title" android:id="@+id/tv_item" android:gravity="center_vertical" android:textColor="#FFFFFF" android:drawablePadding="5dp" android:paddingLeft="19dp" android:textSize="@dimen/network_train_textsize22px" android:drawableLeft="@mipmap/duobianxing" android:text="项目列表"/> <GridLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:columnCount="5" android:orientation="horizontal" android:rowCount="4"> <Button android:text="@string/pull_over" android:textColor="@color/color_ffffff" android:layout_columnWeight="1" android:layout_marginBottom="10dp" android:layout_marginTop="@dimen/ui_margin_10dp" android:layout_rowWeight="1" android:layout_marginLeft="@dimen/ui_margin_20dp" android:layout_marginRight="@dimen/ui_margin_20dp" android:background="@drawable/btn_item_collect_bg" /> <Button android:text="@string/add_subtract" android:layout_columnWeight="1" android:layout_rowWeight="1" android:layout_marginTop="@dimen/ui_margin_10dp" android:layout_marginLeft="@dimen/ui_margin_20dp" android:layout_marginRight="@dimen/ui_margin_20dp" android:layout_marginBottom="10dp" android:textColor="@color/color_ffffff" android:background="@drawable/btn_item_collect_bg" /> <Button android:text="@string/turn_around" android:layout_marginTop="@dimen/ui_margin_10dp" android:layout_columnWeight="1" android:layout_rowWeight="1" android:layout_marginLeft="@dimen/ui_margin_20dp" android:layout_marginRight="@dimen/ui_margin_20dp" android:layout_marginBottom="10dp" android:textColor="@color/color_ffffff" android:background="@drawable/btn_item_collect_bg" /> <Button android:text="@string/by_crossing" android:layout_marginTop="@dimen/ui_margin_10dp" android:textColor="@color/color_ffffff" android:layout_marginLeft="@dimen/ui_margin_20dp" android:layout_marginRight="@dimen/ui_margin_20dp" android:layout_marginBottom="10dp" android:background="@drawable/btn_item_collect_bg" android:layout_columnWeight="1" android:layout_rowWeight="1" /> <Button android:text="@string/lane_change" android:layout_marginTop="@dimen/ui_margin_10dp" android:layout_marginLeft="@dimen/ui_margin_20dp" android:layout_marginRight="@dimen/ui_margin_20dp" android:layout_marginBottom="10dp" android:layout_columnWeight="1" android:layout_rowWeight="1" android:textColor="@color/color_ffffff" 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_20dp" android:layout_marginRight="@dimen/ui_margin_20dp" android:layout_marginBottom="10dp" android:textColor="@color/color_ffffff" android:background="@drawable/btn_item_collect_bg" /> <Button android:text="@string/over_take" android:layout_marginLeft="@dimen/ui_margin_20dp" android:layout_marginRight="@dimen/ui_margin_20dp" android:layout_marginBottom="10dp" android:textColor="@color/color_ffffff" android:layout_columnWeight="1" android:layout_rowWeight="1" android:background="@drawable/btn_item_collect_bg"/> <Button android:text="@string/school_area" android:layout_marginLeft="@dimen/ui_margin_20dp" android:layout_marginRight="@dimen/ui_margin_20dp" android:layout_marginBottom="10dp" android:textColor="@color/color_ffffff" android:layout_columnWeight="1" android:layout_rowWeight="1" android:background="@drawable/btn_item_collect_bg"/> <Button android:text="@string/bus_area" android:layout_marginLeft="@dimen/ui_margin_20dp" android:layout_marginRight="@dimen/ui_margin_20dp" android:layout_marginBottom="10dp" android:textColor="@color/color_ffffff" android:layout_columnWeight="1" android:layout_rowWeight="1" android:background="@drawable/btn_item_collect_bg"/> <Button android:text="@string/junction_left" android:layout_marginLeft="@dimen/ui_margin_20dp" android:layout_marginRight="@dimen/ui_margin_20dp" android:layout_marginBottom="10dp" android:textColor="@color/color_ffffff" 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_20dp" android:layout_marginRight="@dimen/ui_margin_20dp" android:layout_marginBottom="10dp" android:textColor="@color/color_ffffff" android:layout_columnWeight="1" android:layout_rowWeight="1" android:background="@drawable/btn_item_collect_bg"/> <Button android:text="@string/crosswalk" android:layout_marginLeft="@dimen/ui_margin_20dp" android:layout_marginRight="@dimen/ui_margin_20dp" android:layout_marginBottom="10dp" android:textColor="@color/color_ffffff" android:layout_width="wrap_content" android:layout_columnWeight="1" android:layout_rowWeight="1" android:background="@drawable/btn_item_collect_bg"/> <Button android:text="@string/straight_line" android:textColor="@color/color_ffffff" android:layout_columnWeight="1" android:layout_rowWeight="1" android:layout_marginLeft="@dimen/ui_margin_20dp" android:layout_marginRight="@dimen/ui_margin_20dp" android:layout_marginBottom="10dp" android:background="@drawable/btn_item_collect_bg"/> </GridLayout> </LinearLayout> app/src/main/res/layout/layout_road_collect.xml
New file @@ -0,0 +1,49 @@ <?xml version="1.0" encoding="utf-8"?> <GridLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/GridLayout1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:columnCount="4" android:orientation="horizontal" android:rowCount="6" > <Button android:text="+" /> <Button android:text="1" /> <Button android:text="2" /> <Button android:text="3" /> <Button android:text="-" /> <Button android:text="4" /> <Button android:text="5" /> <Button android:text="6" /> <Button android:text="*" /> <Button android:text="7" /> <Button android:text="8" /> <Button android:text="9" android:background="@drawable/btn_item_collect_bg"/> <Button android:text="/" /> <Button android:layout_width="wrap_content" android:text="." /> <Button android:text="0" android:background="@drawable/btn_item_collect_bg"/> <Button android:text="=" /> </GridLayout> app/src/main/res/layout/layout_select_dlg_three.xml
@@ -3,7 +3,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="260dp" android:layout_height="320dp" android:layout_height="360dp" android:gravity="center" android:background="@drawable/bg_select_dlg" @@ -46,6 +46,14 @@ android:text="路考地图(不含灯光)" android:layout_marginLeft="@dimen/ui_margin_10dp" android:textColor="@android:color/white"/> <RadioButton android:layout_width="match_parent" android:layout_height="@dimen/ui_margin_70dp" android:id="@+id/rb4" android:textSize="@dimen/network_train_textsize24px" android:text="路考地图(不含灯光)" android:layout_marginLeft="@dimen/ui_margin_10dp" android:textColor="@android:color/white"/> </RadioGroup> app/src/main/res/layout/layout_train_fragment.xml
@@ -8,13 +8,14 @@ > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="match_parent" android:id="@+id/ll" android:orientation="vertical"> <include android:layout_marginBottom="2dp" android:layout_width="match_parent" android:layout_height="110dp" android:id="@+id/profile" layout="@layout/profile_layout"/> <include android:layout_marginBottom="2dp" android:layout_width="match_parent" android:layout_height="140dp" layout="@layout/layout_net_train"/> <include android:layout_marginBottom="2dp" android:layout_width="match_parent" android:layout_height="140dp" layout="@layout/layout_net_train" android:visibility="gone" /> <include android:layout_marginBottom="2dp" android:layout_width="match_parent" android:layout_height="match_parent" layout="@layout/layout_stu_score"/> <include android:layout_marginBottom="2dp" android:layout_width="match_parent" android:layout_height="match_parent" layout="@layout/layout_stu_score" android:visibility="gone"/> <include android:layout_marginBottom="2dp" android:layout_width="match_parent" android:layout_height="match_parent" layout="@layout/layout_project_collect"/> </LinearLayout> app/src/main/res/mipmap-xxhdpi/icon_dialog_error.png
app/src/main/res/mipmap-xxhdpi/icon_dialog_success.png
app/src/main/res/values/colors.xml
@@ -5,6 +5,7 @@ <color name="colorAccent">#D81B60</color> <color name="dialog_background">#ffffff</color> <color name="home_bg_color">#137b98</color> <color name="home_version_show">#b47242</color> <color name="train_item_bg">#6a75be</color> app/src/main/res/values/dimens.xml
@@ -22,4 +22,16 @@ <dimen name="ui_margin_45dp">45dp</dimen> <dimen name="ui_margin_35dp">35dp</dimen> <dimen name="ui_margin_70dp">70dp</dimen> <dimen name="dialog_corners">12dp</dimen> <dimen name="dialog_title_size">18sp</dimen> <dimen name="dialog_text_size">18sp</dimen> <dimen name="dialog_divider">0.5sp</dimen> <dimen name="dialog_margin_left_right">25dp</dimen> <dimen name="dialog_content_line_space">8dp</dimen> <dimen name="dialog_item_image_height_width">60dp</dimen> </resources>