diff --git a/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt index 11d3284..bd23995 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt @@ -80,7 +80,7 @@ inputLengthView.text = "${text.length}/100" if (text.length > 100) { inputLengthView.setTextColor(R.color.redTextColor.convertColor(context)) - "请输入少于100个字".show(context) + "现场情况字符不能超过100个字符".show(context) } else { inputLengthView.setTextColor(R.color.subTextColor.convertColor(context)) } diff --git a/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt index 11d3284..bd23995 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt @@ -80,7 +80,7 @@ inputLengthView.text = "${text.length}/100" if (text.length > 100) { inputLengthView.setTextColor(R.color.redTextColor.convertColor(context)) - "请输入少于100个字".show(context) + "现场情况字符不能超过100个字符".show(context) } else { inputLengthView.setTextColor(R.color.subTextColor.convertColor(context)) } diff --git a/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt index 95d568f..8bd9917 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt @@ -84,7 +84,7 @@ inputLengthView.text = "${text.length}/100" if (text.length > 100) { inputLengthView.setTextColor(R.color.redTextColor.convertColor(context)) - "请输入少于100个字".show(context) + "现场情况字符不能超过100个字符".show(context) } else { inputLengthView.setTextColor(R.color.subTextColor.convertColor(context)) } diff --git a/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt index 11d3284..bd23995 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt @@ -80,7 +80,7 @@ inputLengthView.text = "${text.length}/100" if (text.length > 100) { inputLengthView.setTextColor(R.color.redTextColor.convertColor(context)) - "请输入少于100个字".show(context) + "现场情况字符不能超过100个字符".show(context) } else { inputLengthView.setTextColor(R.color.subTextColor.convertColor(context)) } diff --git a/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt index 95d568f..8bd9917 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt @@ -84,7 +84,7 @@ inputLengthView.text = "${text.length}/100" if (text.length > 100) { inputLengthView.setTextColor(R.color.redTextColor.convertColor(context)) - "请输入少于100个字".show(context) + "现场情况字符不能超过100个字符".show(context) } else { inputLengthView.setTextColor(R.color.subTextColor.convertColor(context)) } diff --git a/app/src/main/java/com/casic/app/smartwell/widgets/SingleChoiceDialog.kt b/app/src/main/java/com/casic/app/smartwell/widgets/SingleChoiceDialog.kt index 8ab08c6..8f6fc6c 100644 --- a/app/src/main/java/com/casic/app/smartwell/widgets/SingleChoiceDialog.kt +++ b/app/src/main/java/com/casic/app/smartwell/widgets/SingleChoiceDialog.kt @@ -46,8 +46,12 @@ super.onCreate(savedInstanceState) configDialogLayout() setContentView(R.layout.dialog_single_choice) - setCancelable(true) - setCanceledOnTouchOutside(true) + setCancelable(false) + setCanceledOnTouchOutside(false) + + val dismissView = findViewById(R.id.dismissView) + dismissView.setOnClickListener { dismiss() } + val itemListView = findViewById(R.id.itemListView) itemListView.adapter = ItemListAdapter() itemListView.onItemClickListener = AdapterView.OnItemClickListener { _, _, position, _ -> @@ -99,7 +103,12 @@ view = convertView holder = view.tag as ItemViewHolder } - holder.choiceItemView!!.text = choiceItems!![position] + if (position == choiceItems!!.size - 1) { + holder.choiceItemView!!.setBackgroundResource(com.pengxh.app.multilib.R.drawable.sheet_item_bottom_selector) + } else { + holder.choiceItemView!!.setBackgroundResource(com.pengxh.app.multilib.R.drawable.sheet_item_middle_selector) + } + holder.choiceItemView!!.text = choiceItems[position] holder.choiceItemView!!.textSize = 18f //需要动态设置item的高度 val param = AbsListView.LayoutParams( @@ -114,5 +123,4 @@ internal class ItemViewHolder { var choiceItemView: TextView? = null } - } \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt index 11d3284..bd23995 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt @@ -80,7 +80,7 @@ inputLengthView.text = "${text.length}/100" if (text.length > 100) { inputLengthView.setTextColor(R.color.redTextColor.convertColor(context)) - "请输入少于100个字".show(context) + "现场情况字符不能超过100个字符".show(context) } else { inputLengthView.setTextColor(R.color.subTextColor.convertColor(context)) } diff --git a/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt index 95d568f..8bd9917 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt @@ -84,7 +84,7 @@ inputLengthView.text = "${text.length}/100" if (text.length > 100) { inputLengthView.setTextColor(R.color.redTextColor.convertColor(context)) - "请输入少于100个字".show(context) + "现场情况字符不能超过100个字符".show(context) } else { inputLengthView.setTextColor(R.color.subTextColor.convertColor(context)) } diff --git a/app/src/main/java/com/casic/app/smartwell/widgets/SingleChoiceDialog.kt b/app/src/main/java/com/casic/app/smartwell/widgets/SingleChoiceDialog.kt index 8ab08c6..8f6fc6c 100644 --- a/app/src/main/java/com/casic/app/smartwell/widgets/SingleChoiceDialog.kt +++ b/app/src/main/java/com/casic/app/smartwell/widgets/SingleChoiceDialog.kt @@ -46,8 +46,12 @@ super.onCreate(savedInstanceState) configDialogLayout() setContentView(R.layout.dialog_single_choice) - setCancelable(true) - setCanceledOnTouchOutside(true) + setCancelable(false) + setCanceledOnTouchOutside(false) + + val dismissView = findViewById(R.id.dismissView) + dismissView.setOnClickListener { dismiss() } + val itemListView = findViewById(R.id.itemListView) itemListView.adapter = ItemListAdapter() itemListView.onItemClickListener = AdapterView.OnItemClickListener { _, _, position, _ -> @@ -99,7 +103,12 @@ view = convertView holder = view.tag as ItemViewHolder } - holder.choiceItemView!!.text = choiceItems!![position] + if (position == choiceItems!!.size - 1) { + holder.choiceItemView!!.setBackgroundResource(com.pengxh.app.multilib.R.drawable.sheet_item_bottom_selector) + } else { + holder.choiceItemView!!.setBackgroundResource(com.pengxh.app.multilib.R.drawable.sheet_item_middle_selector) + } + holder.choiceItemView!!.text = choiceItems[position] holder.choiceItemView!!.textSize = 18f //需要动态设置item的高度 val param = AbsListView.LayoutParams( @@ -114,5 +123,4 @@ internal class ItemViewHolder { var choiceItemView: TextView? = null } - } \ No newline at end of file diff --git a/app/src/main/res/anim/action_dialog_hide.xml b/app/src/main/res/anim/action_dialog_hide.xml index 8bb3844..119726b 100644 --- a/app/src/main/res/anim/action_dialog_hide.xml +++ b/app/src/main/res/anim/action_dialog_hide.xml @@ -1,7 +1,12 @@ - + android:fromXScale="1.0" + android:fromYScale="1.0" + android:interpolator="@android:anim/accelerate_decelerate_interpolator" + android:pivotX="50%" + android:pivotY="0%" + android:toXScale="0.0" + android:toYScale="0.0" /> \ No newline at end of file diff --git a/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt index 11d3284..bd23995 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/InHandleDetailActivity.kt @@ -80,7 +80,7 @@ inputLengthView.text = "${text.length}/100" if (text.length > 100) { inputLengthView.setTextColor(R.color.redTextColor.convertColor(context)) - "请输入少于100个字".show(context) + "现场情况字符不能超过100个字符".show(context) } else { inputLengthView.setTextColor(R.color.subTextColor.convertColor(context)) } diff --git a/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt index 95d568f..8bd9917 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/NotConfirmedDetailActivity.kt @@ -84,7 +84,7 @@ inputLengthView.text = "${text.length}/100" if (text.length > 100) { inputLengthView.setTextColor(R.color.redTextColor.convertColor(context)) - "请输入少于100个字".show(context) + "现场情况字符不能超过100个字符".show(context) } else { inputLengthView.setTextColor(R.color.subTextColor.convertColor(context)) } diff --git a/app/src/main/java/com/casic/app/smartwell/widgets/SingleChoiceDialog.kt b/app/src/main/java/com/casic/app/smartwell/widgets/SingleChoiceDialog.kt index 8ab08c6..8f6fc6c 100644 --- a/app/src/main/java/com/casic/app/smartwell/widgets/SingleChoiceDialog.kt +++ b/app/src/main/java/com/casic/app/smartwell/widgets/SingleChoiceDialog.kt @@ -46,8 +46,12 @@ super.onCreate(savedInstanceState) configDialogLayout() setContentView(R.layout.dialog_single_choice) - setCancelable(true) - setCanceledOnTouchOutside(true) + setCancelable(false) + setCanceledOnTouchOutside(false) + + val dismissView = findViewById(R.id.dismissView) + dismissView.setOnClickListener { dismiss() } + val itemListView = findViewById(R.id.itemListView) itemListView.adapter = ItemListAdapter() itemListView.onItemClickListener = AdapterView.OnItemClickListener { _, _, position, _ -> @@ -99,7 +103,12 @@ view = convertView holder = view.tag as ItemViewHolder } - holder.choiceItemView!!.text = choiceItems!![position] + if (position == choiceItems!!.size - 1) { + holder.choiceItemView!!.setBackgroundResource(com.pengxh.app.multilib.R.drawable.sheet_item_bottom_selector) + } else { + holder.choiceItemView!!.setBackgroundResource(com.pengxh.app.multilib.R.drawable.sheet_item_middle_selector) + } + holder.choiceItemView!!.text = choiceItems[position] holder.choiceItemView!!.textSize = 18f //需要动态设置item的高度 val param = AbsListView.LayoutParams( @@ -114,5 +123,4 @@ internal class ItemViewHolder { var choiceItemView: TextView? = null } - } \ No newline at end of file diff --git a/app/src/main/res/anim/action_dialog_hide.xml b/app/src/main/res/anim/action_dialog_hide.xml index 8bb3844..119726b 100644 --- a/app/src/main/res/anim/action_dialog_hide.xml +++ b/app/src/main/res/anim/action_dialog_hide.xml @@ -1,7 +1,12 @@ - + android:fromXScale="1.0" + android:fromYScale="1.0" + android:interpolator="@android:anim/accelerate_decelerate_interpolator" + android:pivotX="50%" + android:pivotY="0%" + android:toXScale="0.0" + android:toYScale="0.0" /> \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_single_choice.xml b/app/src/main/res/layout/dialog_single_choice.xml index d9819c8..a959a53 100644 --- a/app/src/main/res/layout/dialog_single_choice.xml +++ b/app/src/main/res/layout/dialog_single_choice.xml @@ -3,18 +3,31 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/bg_layout" - android:orientation="vertical" - android:padding="8dp"> + android:orientation="vertical"> - + android:layout_height="@dimen/titleViewHeight"> + + + + +