热键消费
diff --git a/app/src/main/java/com/supwisdom/activities/consume/ConsumeActivity.kt b/app/src/main/java/com/supwisdom/activities/consume/ConsumeActivity.kt
index 5a07853..aa4194b 100644
--- a/app/src/main/java/com/supwisdom/activities/consume/ConsumeActivity.kt
+++ b/app/src/main/java/com/supwisdom/activities/consume/ConsumeActivity.kt
@@ -65,6 +65,8 @@
private var addAmount: Int = 0
@Volatile
private var amount: Int = 0
+ private var payMode: PayMode? = null
+ private val hotkeyPayMap = hashMapOf<Int, Int>()
private var payWay: String? = null
private var counter: LastPayShowTimer? = null
private var lastPayInfo: CardUserInfoBean? = null
@@ -87,9 +89,15 @@
if (isPaying) {
presenter.clickToInterrupt()
} else {
- presenter.clickNoPay()
- amountTxt.text = ""
- AuxScreenController.getInstance().refreshContent(Arrays.asList(" 欢迎光临!", " 请刷卡..."))
+ if (payMode == PayMode.FIXPAY) {
+ checkAmtToPay(amount, true)
+ } else if (payMode == PayMode.HOTKEY) {
+
+ } else {
+ presenter.clickNoPay()
+ amountTxt.text = ""
+ AuxScreenController.getInstance().refreshContent(Arrays.asList(" 欢迎光临!", " 请刷卡..."))
+ }
}
}
@@ -158,65 +166,121 @@
@SuppressLint("SetTextI18n")
override fun dispatchKeyEvent(event: KeyEvent): Boolean {
if (event.action == KeyEvent.ACTION_DOWN) {
- val keyCode = event.keyCode
- when (keyCode) {
- KeyEvent.KEYCODE_BACK -> {
- amountTxt.text = "0"
- presenter.clickNoPay()
- }
- KeyEvent.KEYCODE_0,
- KeyEvent.KEYCODE_1,
- KeyEvent.KEYCODE_2,
- KeyEvent.KEYCODE_3,
- KeyEvent.KEYCODE_4,
- KeyEvent.KEYCODE_5,
- KeyEvent.KEYCODE_6,
- KeyEvent.KEYCODE_7,
- KeyEvent.KEYCODE_8,
- KeyEvent.KEYCODE_9 -> {
- presenter.clickNoPay()
- addValueToEdit(keyCode - KeyEvent.KEYCODE_0)
- }
- KeyEvent.KEYCODE_POUND, KeyEvent.KEYCODE_PERIOD -> {
- presenter.clickNoPay()
- val str = amountTxt.text.toString()
- if (str.length < 8 && str.indexOf('.') < 0) {
- amountTxt.text = "$str."
- showScreenAmount()
- }
- }
- KeyEvent.KEYCODE_NUMPAD_ADD -> {
- //'+'
- addAmount += getCurAmount()
- amountTxt.text = ""
- showScreenAmount()
- }
- KeyEvent.KEYCODE_DPAD_LEFT -> {
- //'F1'
- isBackRuning = true
- jumpActivity(MenuActivity::class.java)
- }
-// KeyEvent.KEYCODE_DPAD_UP ->
- //'F2'
-// KeyEvent.KEYCODE_DPAD_DOWN ->
- //'F3'
- KeyEvent.KEYCODE_DPAD_RIGHT -> {
- //'F4'
- jumpActivity(TransdtlActivity::class.java)
- }
- KeyEvent.KEYCODE_DEL -> {
- //cancel
- presenter.clickNoPay()
- delValueToEdit()
- }
- KeyEvent.KEYCODE_ENTER -> {
- checkAmtToPay()
- }
+ when (payMode) {
+ PayMode.FIXPAY -> fixInputPay(event.keyCode)
+ PayMode.HOTKEY -> hotkeyInputPay(event.keyCode)
+ else -> normalInputPay(event.keyCode)
}
}
return super.dispatchKeyEvent(event)
}
+ private fun fixInputPay(keyCode: Int) {
+ when (keyCode) {
+ KeyEvent.KEYCODE_DPAD_LEFT -> {
+ //'F1'
+ isBackRuning = true
+ jumpActivity(MenuActivity::class.java)
+ }
+ KeyEvent.KEYCODE_DPAD_RIGHT -> {
+ //'F4'
+ jumpActivity(TransdtlActivity::class.java)
+ }
+ }
+ }
+
+ private fun hotkeyInputPay(keyCode: Int) {
+ when (keyCode) {
+ KeyEvent.KEYCODE_0,
+ KeyEvent.KEYCODE_1,
+ KeyEvent.KEYCODE_2,
+ KeyEvent.KEYCODE_3,
+ KeyEvent.KEYCODE_4,
+ KeyEvent.KEYCODE_5,
+ KeyEvent.KEYCODE_6,
+ KeyEvent.KEYCODE_7,
+ KeyEvent.KEYCODE_8,
+ KeyEvent.KEYCODE_9 -> {
+ val key = keyCode - KeyEvent.KEYCODE_0
+ if (hotkeyPayMap.containsKey(key)) {
+ amount = hotkeyPayMap[key]!!
+ checkAmtToPay(amount, false)
+ }
+ }
+ KeyEvent.KEYCODE_DPAD_LEFT -> {
+ //'F1'
+ isBackRuning = true
+ jumpActivity(MenuActivity::class.java)
+ }
+ KeyEvent.KEYCODE_DPAD_RIGHT -> {
+ //'F4'
+ jumpActivity(TransdtlActivity::class.java)
+ }
+ }
+ }
+
+ private fun normalInputPay(keyCode: Int) {
+ when (keyCode) {
+ KeyEvent.KEYCODE_BACK -> {
+ amountTxt.text = "0"
+ presenter.clickNoPay()
+ }
+ KeyEvent.KEYCODE_0,
+ KeyEvent.KEYCODE_1,
+ KeyEvent.KEYCODE_2,
+ KeyEvent.KEYCODE_3,
+ KeyEvent.KEYCODE_4,
+ KeyEvent.KEYCODE_5,
+ KeyEvent.KEYCODE_6,
+ KeyEvent.KEYCODE_7,
+ KeyEvent.KEYCODE_8,
+ KeyEvent.KEYCODE_9 -> {
+ presenter.clickNoPay()
+ addValueToEdit(keyCode - KeyEvent.KEYCODE_0)
+ }
+ KeyEvent.KEYCODE_POUND, KeyEvent.KEYCODE_PERIOD -> {
+ presenter.clickNoPay()
+ val str = amountTxt.text.toString()
+ if (str.length < 8 && str.indexOf('.') < 0) {
+ amountTxt.text = "$str."
+ showScreenAmount()
+ }
+ }
+ KeyEvent.KEYCODE_NUMPAD_ADD -> {
+ //'+'
+ addAmount += getCurAmount()
+ amountTxt.text = ""
+ showScreenAmount()
+ }
+ KeyEvent.KEYCODE_DPAD_LEFT -> {
+ //'F1'
+ isBackRuning = true
+ jumpActivity(MenuActivity::class.java)
+ }
+// KeyEvent.KEYCODE_DPAD_UP ->
+ //'F2'
+// KeyEvent.KEYCODE_DPAD_DOWN ->
+ //'F3'
+ KeyEvent.KEYCODE_DPAD_RIGHT -> {
+ //'F4'
+ jumpActivity(TransdtlActivity::class.java)
+ }
+ KeyEvent.KEYCODE_DEL -> {
+ //cancel
+ presenter.clickNoPay()
+ delValueToEdit()
+ }
+ KeyEvent.KEYCODE_ENTER -> {
+ amount = getCurAmount() + addAmount
+ if (amount > 0) {
+ checkAmtToPay(amount, false)
+ } else {
+ AuxScreenController.getInstance().refreshContent(Arrays.asList("请先输入金额:", "金额不能为0"))
+ }
+ }
+ }
+ }
+
override fun showUserInfo(info: CardUserInfoBean) {
CommonUtil.acquireWakeLock(this)
vCitizenName.text = info.username
@@ -297,16 +361,26 @@
AuxScreenController.getInstance().refreshBottom(DateUtil.getNowDateTime().substring(0, 16))
AuxScreenController.getInstance().refreshContent(Arrays.asList(" 欢迎光临!", " 请刷卡..."))
- val record = SPApplication.getInstance().getPos().getControlPara(PublicDef.CONTROL_FIXAMT)
- if (record != null && PublicDef.CONTROL_NO_FIXPAY_FLAG != record.paraval) {
- try {
- amount = Integer.parseInt(record.paraval)
- amountTxt.text = String.format("%.02f", amount / 100.0f)
- payStatusEnable = true
- presenter.clickToPay(amount)
- showDialogPay()
- } catch (ex: Exception) {
- ex.printStackTrace()
+ SPApplication.getInstance().getPos().getControlPara(PublicDef.CONTROL_FIXAMT)?.also { mode ->
+ when {
+ mode.paraval == PayMode.HOTKEY.desc -> {
+ payMode = PayMode.HOTKEY
+ hotkeyPayMap.clear()
+ SPApplication.getInstance().getPos().getHotkeyPay()?.forEach {
+ hotkeyPayMap[it.key] = it.amount
+ }
+ }
+ mode.paraval == PayMode.NORMAL.desc -> {
+ payMode = PayMode.NORMAL
+ }
+ else -> {
+ payMode = PayMode.FIXPAY
+ try {
+ checkAmtToPay(Integer.parseInt(mode.paraval), true)
+ } catch (ex: Exception) {
+ ex.printStackTrace()
+ }
+ }
}
}
}
@@ -469,23 +543,24 @@
}
}
- private fun checkAmtToPay() {
- amount = getCurAmount() + addAmount
- if (amount > 0) {
+ private fun checkAmtToPay(inputAmt: Int, isFixPay: Boolean) {
+ if (isFixPay) {
AuxScreenController.getInstance()
- .refreshContent(Arrays.asList("等待付款", CommonUtil.showFormatAmount("金额", amount)))
- amountTxt.text = String.format("%.02f", amount / 100.0f)
- payStatusEnable = true
- presenter.clickToPay(amount)
- showDialogPay()
+ .refreshContent(Arrays.asList("定额付款", CommonUtil.showFormatAmount("金额", inputAmt)))
} else {
- AuxScreenController.getInstance().refreshContent(Arrays.asList("请先输入金额:", "金额不能为0"))
+ AuxScreenController.getInstance()
+ .refreshContent(Arrays.asList("等待付款", CommonUtil.showFormatAmount("金额", inputAmt)))
}
+ amount = inputAmt
+ amountTxt.text = String.format("%.02f", inputAmt / 100.0f)
+ payStatusEnable = true
+ presenter.clickToPay(inputAmt)
+ showDialogPay(isFixPay)
}
- private fun showDialogPay() {
+ private fun showDialogPay(isFixPay: Boolean) {
dialogPurchase!!.codePaying = false
- dialogPurchase!!.isFixPay = false
+ dialogPurchase!!.isFixPay = isFixPay
dialogPurchase!!.codePayingNoCancelEnable = false
dialogPurchase!!.show("请刷卡", CommonUtil.showFormatAmount("金额", amount))
}
diff --git a/app/src/main/java/com/supwisdom/activities/consume/ConsumePresenter.kt b/app/src/main/java/com/supwisdom/activities/consume/ConsumePresenter.kt
index b5aeb03..f4fdfad 100644
--- a/app/src/main/java/com/supwisdom/activities/consume/ConsumePresenter.kt
+++ b/app/src/main/java/com/supwisdom/activities/consume/ConsumePresenter.kt
@@ -123,4 +123,10 @@
codePayService.pay(code!!, amount)
}
}
+}
+
+enum class PayMode(val desc: String) {
+ NORMAL("none"),
+ FIXPAY("fixpay"),
+ HOTKEY("hotkey")
}
\ No newline at end of file
diff --git a/app/src/main/java/com/supwisdom/activities/consumeMode/ConsumeModeActivity.kt b/app/src/main/java/com/supwisdom/activities/consumeMode/ConsumeModeActivity.kt
index e7399e5..a31c8ef 100644
--- a/app/src/main/java/com/supwisdom/activities/consumeMode/ConsumeModeActivity.kt
+++ b/app/src/main/java/com/supwisdom/activities/consumeMode/ConsumeModeActivity.kt
@@ -5,17 +5,23 @@
import android.os.CountDownTimer
import android.view.KeyEvent
import android.view.View
+import android.widget.EditText
import android.widget.LinearLayout
+import android.widget.RadioButton
import android.widget.TextView
import com.supwisdom.R
import com.supwisdom.activities.BaseActivity
import com.supwisdom.activities.SPApplication
+import com.supwisdom.activities.consume.PayMode
import com.supwisdom.activities.menu.MenuActivity
import com.supwisdom.auxscreen.AuxScreenController
+import com.supwisdom.entity.HotKeyPayRecord
import com.supwisdom.utils.CommonUtil
import com.supwisdom.utils.DateUtil
import com.supwisdom.utils.PublicDef
+import com.supwisdom.view.SWToast
import java.util.*
+import kotlin.collections.ArrayList
/**
** create by zzq on 2019/7/26
@@ -23,10 +29,16 @@
**/
class ConsumeModeActivity : BaseActivity() {
private lateinit var vPayamt: TextView
+ private lateinit var vNormalMode: TextView
+ private lateinit var vFixMode: TextView
+ private lateinit var vHotkeyMode: TextView
private lateinit var llHotList: LinearLayout
+ private lateinit var llFixMode: LinearLayout
+ private lateinit var llHotMode: LinearLayout
private val pos = SPApplication.getInstance().getPos()
private var keyActive = true
private var shoppwdPass = false
+ private var hotkey = false
private var tmpPwd = ""
override fun onCreate(savedInstanceState: Bundle?) {
@@ -37,13 +49,7 @@
}
private fun initData() {
-
- }
-
- private fun initView() {
- vPayamt = findViewById<TextView>(R.id.tv_consume_mode_payamt)
- llHotList = findViewById<LinearLayout>(R.id.ll_hot_list)
- this.findViewById<TextView>(R.id.tv_hot_add).setOnClickListener {
+ pos.getHotkeyPay()?.forEach {
val item = View.inflate(this, R.layout.item_hotkey_pay, null)
item.findViewById<TextView>(R.id.tv_hot_del).setOnClickListener {
llHotList.removeView(item)
@@ -52,9 +58,91 @@
key.text = "${llHotList.childCount + 1}"
llHotList.addView(item)
}
+ }
+
+ private fun initView() {
+ vPayamt = findViewById<TextView>(R.id.tv_consume_mode_payamt)
+ llHotList = findViewById<LinearLayout>(R.id.ll_hot_list)
+ this.findViewById<TextView>(R.id.tv_hot_add).setOnClickListener {
+ if (llHotList.childCount >= 9) {
+ return@setOnClickListener
+ }
+ val item = View.inflate(this, R.layout.item_hotkey_pay, null)
+ item.findViewById<TextView>(R.id.tv_hot_del).setOnClickListener {
+ llHotList.removeView(item)
+ for (loop in 0 until llHotList.childCount) {
+ val item = llHotList.getChildAt(loop)
+ val key = item.findViewById<TextView>(R.id.tv_hot_key)
+ key.text = "${(loop + 1)}"
+ }
+ }
+ val key = item.findViewById<TextView>(R.id.tv_hot_key)
+ key.text = "${llHotList.childCount + 1}"
+ llHotList.addView(item)
+ }
this.findViewById<TextView>(R.id.tv_hot_save).setOnClickListener {
+ if (llHotList.childCount == 0) {
+ SWToast.show(applicationContext, "请先添加热键", PublicDef.TOAST_SHOW_DOUBT)
+ return@setOnClickListener
+ }
+ val list = ArrayList<HotKeyPayRecord>()
+ for (loop in 0 until llHotList.childCount) {
+ val item = llHotList.getChildAt(loop)
+ val key = item.findViewById<TextView>(R.id.tv_hot_key)
+ val keyboard = key.text.toString()
+ val amt = item.findViewById<EditText>(R.id.tv_hot_amount)
+ val hotamt = CommonUtil.getEditView(amt)
+
+ val record = HotKeyPayRecord()
+ record.key = Integer.parseInt(keyboard)
+ record.amount = CommonUtil.YuanToFen(java.lang.Double.parseDouble(hotamt))
+ list.add(record)
+ }
+ pos.replaceControlPara(PublicDef.CONTROL_FIXAMT, PayMode.HOTKEY.desc)
+ if (!pos.saveHotkeyPay(list)) {
+ SWToast.show(applicationContext, "保持热键失败", PublicDef.TOAST_SHOW_CRY)
+ return@setOnClickListener
+ }
finish()
}
+ this.findViewById<TextView>(R.id.tv_return).setOnClickListener {
+ hotkey = false
+ llHotMode.visibility = View.GONE
+ llFixMode.visibility = View.VISIBLE
+ refreshToSetAmount()
+ }
+ vNormalMode = this.findViewById<RadioButton>(R.id.rb_normal_mode)
+ vFixMode = this.findViewById<RadioButton>(R.id.rb_fix_mode)
+ vHotkeyMode = this.findViewById<RadioButton>(R.id.rb_hot_mode)
+
+ llFixMode = this.findViewById<LinearLayout>(R.id.ll_fix_mode)
+ llHotMode = this.findViewById<LinearLayout>(R.id.ll_hot_mode)
+ }
+
+ @SuppressLint("SetTextI18n")
+ override fun dispatchKeyEvent(event: KeyEvent): Boolean {
+ if (event.action == KeyEvent.ACTION_DOWN) {
+ if (!keyActive) {
+ return super.dispatchKeyEvent(event)
+ }
+ resetCounter(200)
+ if (shoppwdPass) {
+ setFixAmount(event.keyCode)
+ } else {
+ checkShopPwd(event.keyCode)
+ }
+ }
+ return super.dispatchKeyEvent(event)
+ }
+
+ override fun onResume() {
+ super.onResume()
+ shoppwdPass = false
+ hotkey = false
+ keyActive = true
+ llFixMode.visibility = View.VISIBLE
+ llHotMode.visibility = View.GONE
+ refreshToCheckPasswd()
}
private fun checkShopPwd(keyCode: Int) {
@@ -108,6 +196,10 @@
}
private fun setFixAmount(keyCode: Int) {
+ if (hotkey) {
+ AuxScreenController.getInstance().refreshContent(Arrays.asList<String>("请到大屏设置"))
+ return
+ }
when (keyCode) {
KeyEvent.KEYCODE_0,
KeyEvent.KEYCODE_1,
@@ -126,30 +218,14 @@
pos.replaceControlPara(PublicDef.CONTROL_FIXAMT, getFixAmount())
jumpActivity(MenuActivity::class.java)
}
- }
- }
-
- @SuppressLint("SetTextI18n")
- override fun dispatchKeyEvent(event: KeyEvent): Boolean {
- if (event.action == KeyEvent.ACTION_DOWN) {
- if (!keyActive) {
- return super.dispatchKeyEvent(event)
- }
- resetCounter(200)
- if (shoppwdPass) {
- setFixAmount(event.keyCode)
- } else {
- checkShopPwd(event.keyCode)
+ KeyEvent.KEYCODE_DPAD_LEFT -> {
+ //F1
+ hotkey = true
+ llHotMode.visibility = View.VISIBLE
+ llFixMode.visibility = View.GONE
+ AuxScreenController.getInstance().refreshContent(Arrays.asList<String>("请到大屏设置"))
}
}
- return super.dispatchKeyEvent(event)
- }
-
- override fun onResume() {
- super.onResume()
- shoppwdPass = false
- keyActive = true
- refreshToCheckPasswd()
}
private fun refreshToCheckPasswd() {
@@ -159,11 +235,11 @@
}
private fun refreshToSetAmount() {
- val record = pos.getControlPara(PublicDef.CONTROL_FIXAMT)
- if (record != null && PublicDef.CONTROL_NO_FIXPAY_FLAG != record.paraval) {
- vPayamt.text = String.format("%.02f", Integer.parseInt(record.paraval) / 100.0f)
- } else {
- vPayamt.text = PublicDef.CONTROL_NO_FIXPAY_FLAG
+ vPayamt.text = PayMode.NORMAL.desc
+ pos.getControlPara(PublicDef.CONTROL_FIXAMT)?.also {
+ if (PayMode.FIXPAY.desc == it.paraval) {
+ vPayamt.text = String.format("%.02f", Integer.parseInt(it.paraval) / 100.0f)
+ }
}
screenShowAmt()
}
@@ -174,13 +250,12 @@
} catch (e: Exception) {
e.printStackTrace()
}
-
- return PublicDef.CONTROL_NO_FIXPAY_FLAG
+ return PayMode.NORMAL.desc
}
private fun addValueToEdit(value: Int) {
var str = vPayamt.text.toString()
- if ("0" == str || PublicDef.CONTROL_NO_FIXPAY_FLAG == str) {
+ if ("0" == str || PayMode.NORMAL.desc == str) {
str = ""
}
//如果已经有小数点,则小数点后面不能超过两位
@@ -201,9 +276,9 @@
private fun delValueToEdit() {
val str = vPayamt.text.toString()
- if (PublicDef.CONTROL_NO_FIXPAY_FLAG != str) {
+ if (PayMode.NORMAL.desc != str) {
if (str.length <= 1) {
- vPayamt.text = PublicDef.CONTROL_NO_FIXPAY_FLAG
+ vPayamt.text = PayMode.NORMAL.desc
} else {
vPayamt.text = str.substring(0, str.length - 1)
}
@@ -213,7 +288,7 @@
private fun addDotToEdit() {
val str = vPayamt.text.toString()
- if (PublicDef.CONTROL_NO_FIXPAY_FLAG == str) {
+ if (PayMode.NORMAL.desc == str) {
vPayamt.text = "0."
} else {
if (str.length < 8 && str.indexOf('.') < 0) {
@@ -224,14 +299,15 @@
}
private fun screenShowAmt() {
+ AuxScreenController.getInstance().refreshTitle("消费模式设置 F1-热键")
+ AuxScreenController.getInstance().refreshBottom(DateUtil.getNowDateTime())
AuxScreenController.getInstance().refreshContent(
Arrays.asList<String>(
- PublicDef.CONTROL_NO_FIXPAY_FLAG + "-普通消费",
+ PayMode.NORMAL.desc + "-普通消费",
"值-定额消费(元)",
String.format("金额:%s", vPayamt.text.toString())
)
)
-
}
override fun onDestroy() {
diff --git a/app/src/main/java/com/supwisdom/utils/PublicDef.kt b/app/src/main/java/com/supwisdom/utils/PublicDef.kt
index b7c482f..140f9a8 100644
--- a/app/src/main/java/com/supwisdom/utils/PublicDef.kt
+++ b/app/src/main/java/com/supwisdom/utils/PublicDef.kt
@@ -76,10 +76,7 @@
const val CONTROL_FIXAMT = "fixamt"
const val CONTROL_OFFLINE_DAY_DISABLE = "offdaydisable"
const val CONTROL_DEBUG_ENABLE = "debugenable"
- /**
- * 非定额消费标识
- */
- const val CONTROL_NO_FIXPAY_FLAG = "none"
+
/**
* 消费冲正时限
*/
diff --git a/app/src/main/res/drawable/corner_bg_blue.xml b/app/src/main/res/drawable/corner_bg_blue.xml
new file mode 100644
index 0000000..8619a1d
--- /dev/null
+++ b/app/src/main/res/drawable/corner_bg_blue.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+ <solid android:color="@color/light_blue2" />
+ <corners android:radius="8dip" />
+ <stroke
+ android:width="1.0dip"
+ android:color="@color/light_blue2" />
+</shape>
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_consume_mode.xml b/app/src/main/res/layout/activity_consume_mode.xml
index 3ec88c5..653add6 100644
--- a/app/src/main/res/layout/activity_consume_mode.xml
+++ b/app/src/main/res/layout/activity_consume_mode.xml
@@ -8,6 +8,7 @@
style="@style/head_title_text_style"
android:text="消费模式"/>
<RadioGroup
+ android:visibility="gone"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical">
@@ -35,6 +36,12 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:text="普通消费(none)"
+ android:textColor="@color/light_blue2"
+ android:textSize="20sp"/>
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
android:text="定额消费(单位:元)"
android:textColor="@color/light_blue2"
android:textSize="20sp"/>
@@ -67,38 +74,48 @@
android:padding="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="快捷消费(单位:元)"
- android:textColor="@color/light_blue2"
- android:textSize="20sp"/>
<LinearLayout
android:orientation="horizontal"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
+ android:id="@+id/tv_return"
+ android:textSize="25sp"
+ android:text="返回"
+ android:background="@drawable/corner_bg_blue"
+ android:padding="10dp"
+ android:textColor="@color/white"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+ <TextView
android:id="@+id/tv_hot_save"
android:textSize="25sp"
+ android:layout_marginLeft="50dp"
android:text="保存"
- android:background="@drawable/corner_bg_gray"
+ android:background="@drawable/corner_bg_blue"
android:padding="10dp"
- android:textColor="@color/light_blue2"
+ android:textColor="@color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/tv_hot_add"
android:textSize="25sp"
android:text="添加"
- android:layout_marginLeft="100dp"
- android:background="@drawable/corner_bg_gray"
+ android:layout_marginLeft="50dp"
+ android:background="@drawable/corner_bg_blue"
android:padding="10dp"
- android:textColor="@color/light_blue2"
+ android:textColor="@color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
-
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="快捷消费(单位:元)"
+ android:layout_marginTop="10dp"
+ android:textColor="@color/light_blue2"
+ android:textSize="20sp"/>
<LinearLayout
android:id="@+id/ll_hot_list"
android:layout_width="match_parent"
diff --git a/app/src/main/res/layout/item_hotkey_pay.xml b/app/src/main/res/layout/item_hotkey_pay.xml
index 7ba2b51..060a897 100644
--- a/app/src/main/res/layout/item_hotkey_pay.xml
+++ b/app/src/main/res/layout/item_hotkey_pay.xml
@@ -4,6 +4,7 @@
android:background="@color/white"
android:layout_width="match_parent"
android:weightSum="5"
+ android:padding="5dp"
android:layout_marginTop="10dp"
android:layout_height="match_parent">
<TextView
@@ -40,7 +41,7 @@
android:layout_marginLeft="10dp"
android:gravity="center"
android:padding="10dp"
- android:background="@drawable/corner_bg_gray"
- android:textColor="@color/light_blue2"
+ android:background="@drawable/corner_bg_blue"
+ android:textColor="@color/white"
android:textSize="25sp"/>
</LinearLayout>
\ No newline at end of file