Commit b1819aac authored by UIUANG\Zsc's avatar UIUANG\Zsc

修改DT40和高版本的bug

parent 21d3c2dd
...@@ -15,8 +15,8 @@ android { ...@@ -15,8 +15,8 @@ android {
applicationId "com.ypsx.yppos" applicationId "com.ypsx.yppos"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 30 targetSdkVersion 30
versionCode 100014 versionCode 100017
versionName "1.00.014" versionName "1.00.017"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
{ {
"type": "SINGLE", "type": "SINGLE",
"filters": [], "filters": [],
"versionCode": 100014, "versionCode": 100017,
"versionName": "1.00.014", "versionName": "1.00.017",
"outputFile": "yppos_v100014-1.00.014-release-2021-12-22.apk" "outputFile": "yppos_v100017-1.00.017-release-2021-12-28.apk"
} }
] ]
} }
\ No newline at end of file
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE "/> <uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE "/>
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application <application
android:name=".PosApp" android:name=".PosApp"
......
...@@ -8,7 +8,7 @@ import com.ypsx.base.network.BaseResponse ...@@ -8,7 +8,7 @@ import com.ypsx.base.network.BaseResponse
* 描述 :服务器返回数据的基类 * 描述 :服务器返回数据的基类
* 如果你的项目中有基类,那美滋滋,可以继承BaseResponse,请求时框架可以帮你自动脱壳,自动判断是否请求成功,怎么做: * 如果你的项目中有基类,那美滋滋,可以继承BaseResponse,请求时框架可以帮你自动脱壳,自动判断是否请求成功,怎么做:
* 1.继承 BaseResponse * 1.继承 BaseResponse
* 2.重写isSucces 方法,编写你的业务需求,根据自己的条件判断数据是否请求成功 * 2.重写isSuccess 方法,编写你的业务需求,根据自己的条件判断数据是否请求成功
* 3.重写 getResponseCode、getResponseData、getResponseMsg方法,传入你的 code data msg * 3.重写 getResponseCode、getResponseData、getResponseMsg方法,传入你的 code data msg
*/ */
data class ApiResponse<T>( data class ApiResponse<T>(
......
package com.ypsx.yppos.http.data.bean package com.ypsx.yppos.http.data.bean
/**
* 版本信息
*/
data class AppVersionResponse( data class AppVersionResponse(
val desciption: String? = null, val desciption: String? = null,
val downloadUrl: String, val downloadUrl: String,
......
package com.ypsx.yppos.http.data.bean package com.ypsx.yppos.http.data.bean
/**
* 付款成功
*/
data class CashPaySuccess( data class CashPaySuccess(
var payAmount: Double, var payAmount: Double,
var changeAmount: Double, var changeAmount: Double,
......
package com.ypsx.yppos.http.data.bean package com.ypsx.yppos.http.data.bean
data class InsertOrderProductDTO( data class InsertOrderProductDTO(
var activityPrice: Double = 0.0, var activityPrice: Double = 0.0,
var activitys: List<ActivityInfoDTO>? = null, var activitys: List<ActivityInfoDTO>? = null,
//成交价 //成交价
......
package com.ypsx.yppos.http.data.bean package com.ypsx.yppos.http.data.bean
/**
* 登录信息
*/
data class LoginResponse( data class LoginResponse(
var accessToken:String, var accessToken:String,
var currentTime:String, var currentTime:String,
......
package com.ypsx.yppos.http.data.bean package com.ypsx.yppos.http.data.bean
/**
* 配置信息
*/
data class OptionsResponse( data class OptionsResponse(
var id: String, var id: String,
val key: String, val key: String,
......
package com.ypsx.yppos.http.data.bean package com.ypsx.yppos.http.data.bean
class PluRelation(var plu: String, var id: String) /**
* 扫描13位或18条码对应关系
*/
data class PluRelation(var plu: String, var id: String)
package com.ypsx.yppos.http.data.bean package com.ypsx.yppos.http.data.bean
/**
* 获取pos配置
*/
data class PosConfigResponse( data class PosConfigResponse(
//小票底部文字,最多144个汉字 //小票底部文字,最多144个汉字
var ticketBottom: String? = null, var ticketBottom: String? = null,
......
package com.ypsx.yppos.http.data.bean package com.ypsx.yppos.http.data.bean
/**
* pos命令
*/
data class SimplePosCommandResponse( data class SimplePosCommandResponse(
//命令ID //命令ID
var id: Long, var id: Long,
......
package com.ypsx.yppos.http.data.bean package com.ypsx.yppos.http.data.bean
/**
* 上传订单返回的结果
*/
data class UploadOrderResponse( data class UploadOrderResponse(
// 错误消息 // 错误消息
var errorMessage: String, var errorMessage: String,
......
package com.ypsx.yppos.http.data.entity package com.ypsx.yppos.http.data.entity
/**
* 订单状态
*/
enum class OrderStatusEnum { enum class OrderStatusEnum {
//待付款 //待付款
CREATED, CREATED,
......
package com.ypsx.yppos.http.data.entity package com.ypsx.yppos.http.data.entity
/**
* pos命令状态
*/
enum class PosCommandStatus{ enum class PosCommandStatus{
CREATE, CANCELED, PROCESSING, FAILED, SUCCESS CREATE, CANCELED, PROCESSING, FAILED, SUCCESS
} }
package com.ypsx.yppos.http.data.entity package com.ypsx.yppos.http.data.entity
/**
* pos命令类型
*/
enum class PosCommandType { enum class PosCommandType {
UPLOAD_LOG,UPLOAD_DB UPLOAD_LOG,UPLOAD_DB
} }
\ No newline at end of file
package com.ypsx.yppos.http.data.entity package com.ypsx.yppos.http.data.entity
/**
* 付款方式
*/
enum class PosPayMethod { enum class PosPayMethod {
CARDPAY, CARDPAY,
//扫码聚合支付 //扫码聚合支付
......
package com.ypsx.yppos.http.data.entity package com.ypsx.yppos.http.data.entity
/**
* 商品规格
*/
enum class PosProductStyle { enum class PosProductStyle {
/** /**
*单品 *单品
......
...@@ -2,7 +2,7 @@ package com.ypsx.yppos.http.data.entity ...@@ -2,7 +2,7 @@ package com.ypsx.yppos.http.data.entity
/** /**
* string * string
POS门店商品状态 POS门店商品上下架状态
*/ */
enum class PosShelvesStatus { enum class PosShelvesStatus {
ON, OFF, DELETED ON, OFF, DELETED
......
package com.ypsx.yppos.http.data.entity package com.ypsx.yppos.http.data.entity
/**
* pos机状态
*/
enum class PosStatus{ enum class PosStatus{
/** /**
* 申请中 * 申请中
......
package com.ypsx.yppos.http.data.entity package com.ypsx.yppos.http.data.entity
/**
* 商品活动状态
*/
enum class ProductActivityType { enum class ProductActivityType {
UNKNOWN_ACTIVITY_TYPE, TIMESHARE_ACTIVITY, OTHER_ACTIVITY, UNRECOGNIZED UNKNOWN_ACTIVITY_TYPE, TIMESHARE_ACTIVITY, OTHER_ACTIVITY, UNRECOGNIZED
} }
\ No newline at end of file
...@@ -21,16 +21,4 @@ data class ApplyPosMachineRequest( ...@@ -21,16 +21,4 @@ data class ApplyPosMachineRequest(
//安装目录 //安装目录
var installationDirectory: String var installationDirectory: String
// {
// "brand": "string",
// "installDiskCapacity": "string",
// "installationDirectory": "string",
// "ip": "string",
// "macAddress": "string",
// "port": 0,
// "remark": "string",
// "specification": "string",
// "version": "string"
// }
) )
package com.ypsx.yppos.http.data.request package com.ypsx.yppos.http.data.request
/**
* pos机登录
*/
data class PosLoginRequest( data class PosLoginRequest(
//门店id //门店id
var workingOrgId: String, var workingOrgId: String,
......
package com.ypsx.yppos.http.data.request package com.ypsx.yppos.http.data.request
/**
* 刷新token
*/
data class RefreshTokenRequest( data class RefreshTokenRequest(
var refreshToken:String var refreshToken:String
) )
package com.ypsx.yppos.http.data.request package com.ypsx.yppos.http.data.request
/**
* 回复命令
*/
data class ReplyCommandListRequest( data class ReplyCommandListRequest(
var commandIds: List<String> var commandIds: List<String>
) )
...@@ -53,6 +53,7 @@ class LogService : Service() { ...@@ -53,6 +53,7 @@ class LogService : Service() {
HttpRequestCoroutine.uploadLog(posConfig?.code!!) HttpRequestCoroutine.uploadLog(posConfig?.code!!)
} }
} catch (e: Exception) { } catch (e: Exception) {
job?.cancel()
e.message?.eXLog() e.message?.eXLog()
} }
......
...@@ -55,6 +55,7 @@ class SyncProductService: Service() { ...@@ -55,6 +55,7 @@ class SyncProductService: Service() {
val storeId = posConfig?.storeId!! val storeId = posConfig?.storeId!!
HttpRequestCoroutine.syncProduct(storeId) HttpRequestCoroutine.syncProduct(storeId)
} catch (e: Exception) { } catch (e: Exception) {
job?.cancel()
e.message?.eXLog() e.message?.eXLog()
} }
} }
......
...@@ -66,6 +66,7 @@ class PosBuyRepository { ...@@ -66,6 +66,7 @@ class PosBuyRepository {
getPosBuyDao().insert(posBuy) getPosBuyDao().insert(posBuy)
for (payment in orderResponse.payments) { for (payment in orderResponse.payments) {
payment.payCode = authCode payment.payCode = authCode
payment.toJson().dXLog()
getPosBuyPaymentDao().insert(payment) getPosBuyPaymentDao().insert(payment)
} }
orderResponse.products.toJson().dXLog() orderResponse.products.toJson().dXLog()
......
...@@ -9,12 +9,15 @@ import com.ypsx.yppos.R ...@@ -9,12 +9,15 @@ import com.ypsx.yppos.R
import com.ypsx.yppos.http.data.bean.InsertOrderProductDTO import com.ypsx.yppos.http.data.bean.InsertOrderProductDTO
import com.ypsx.yppos.http.data.entity.PosProductStyle import com.ypsx.yppos.http.data.entity.PosProductStyle
import com.ypsx.yppos.utils.RoundBackgroundColorSpan import com.ypsx.yppos.utils.RoundBackgroundColorSpan
import java.text.DecimalFormat
class OrderProductAdapter(data: ArrayList<InsertOrderProductDTO>) : class OrderProductAdapter(data: ArrayList<InsertOrderProductDTO>) :
BaseQuickAdapter<InsertOrderProductDTO, BaseViewHolder>( BaseQuickAdapter<InsertOrderProductDTO, BaseViewHolder>(
R.layout.item_pos_product, data R.layout.item_pos_product, data
) { ) {
private var decimalFormat: DecimalFormat = DecimalFormat("###################.###########")
override fun convert(holder: BaseViewHolder, item: InsertOrderProductDTO) { override fun convert(holder: BaseViewHolder, item: InsertOrderProductDTO) {
item.run { item.run {
when (style) { when (style) {
...@@ -53,7 +56,7 @@ class OrderProductAdapter(data: ArrayList<InsertOrderProductDTO>) : ...@@ -53,7 +56,7 @@ class OrderProductAdapter(data: ArrayList<InsertOrderProductDTO>) :
PosProductStyle.WEIGHT.name -> { PosProductStyle.WEIGHT.name -> {
holder.setGone(R.id.ll_count, false) holder.setGone(R.id.ll_count, false)
holder.setGone(R.id.tv_weight, true) holder.setGone(R.id.tv_weight, true)
holder.setText(R.id.tv_count, "$quantity") holder.setText(R.id.tv_count, decimalFormat.format(quantity))
} }
else -> { else -> {
......
...@@ -18,6 +18,7 @@ import com.ypsx.yppos.utils.toast ...@@ -18,6 +18,7 @@ import com.ypsx.yppos.utils.toast
import com.ypsx.yppos.viewmodel.state.ChangeQuantityViewModel import com.ypsx.yppos.viewmodel.state.ChangeQuantityViewModel
import razerdp.basepopup.BasePopupWindow import razerdp.basepopup.BasePopupWindow
import java.math.BigDecimal import java.math.BigDecimal
import java.text.DecimalFormat
class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) { class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) {
lateinit var bind: PopupChangeQuantityBinding lateinit var bind: PopupChangeQuantityBinding
...@@ -25,6 +26,7 @@ class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) { ...@@ -25,6 +26,7 @@ class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) {
var onChangeClick: OnChangeClick? =null var onChangeClick: OnChangeClick? =null
private var posProduct: PosProduct? = null private var posProduct: PosProduct? = null
private var insertOrderProductDTO: InsertOrderProductDTO?=null private var insertOrderProductDTO: InsertOrderProductDTO?=null
private var decimalFormat: DecimalFormat = DecimalFormat("###################.###########")
...@@ -92,15 +94,14 @@ class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) { ...@@ -92,15 +94,14 @@ class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) {
} }
bind.vm?.purchaseQuantityName?.set(purchaseQuantityName) bind.vm?.purchaseQuantityName?.set(purchaseQuantityName)
bind.vm?.purchaseQuantity?.set(spec) bind.vm?.purchaseQuantity?.set(spec)
bind.etPurchaseQuantity.setText(spec) // bind.etPurchaseQuantity.setText(spec)
val length = bind.etPurchaseQuantity.text.toString().length // val length = bind.etPurchaseQuantity.text.toString().length
bind.etPurchaseQuantity.setSelection(length) // bind.etPurchaseQuantity.setSelection(length)
bind.etPurchaseQuantity.isFocusable = true; bind.etPurchaseQuantity.isFocusable = true;
bind.etPurchaseQuantity.isFocusableInTouchMode = true; bind.etPurchaseQuantity.isFocusableInTouchMode = true;
bind.etPurchaseQuantity.requestFocus() //获取焦点 bind.etPurchaseQuantity.requestFocus() //获取焦点
} }
fun setOrderProduct(insertOrderProductDTO: InsertOrderProductDTO) { fun setOrderProduct(insertOrderProductDTO: InsertOrderProductDTO) {
this.type = 1 this.type = 1
this.insertOrderProductDTO = insertOrderProductDTO this.insertOrderProductDTO = insertOrderProductDTO
...@@ -110,7 +111,8 @@ class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) { ...@@ -110,7 +111,8 @@ class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) {
when (insertOrderProductDTO.style) { when (insertOrderProductDTO.style) {
PosProductStyle.WEIGHT.name -> { PosProductStyle.WEIGHT.name -> {
purchaseQuantityName = "修改重量" purchaseQuantityName = "修改重量"
spec = insertOrderProductDTO.quantity.toString() spec = decimalFormat.format(insertOrderProductDTO.quantity)
// spec = insertOrderProductDTO.quantity.toString()
bind.vm?.productBarCode?.set("PLU:" + insertOrderProductDTO.mnemonicCode) bind.vm?.productBarCode?.set("PLU:" + insertOrderProductDTO.mnemonicCode)
bind.etPurchaseQuantity.filters = arrayOf(WeighInputFilter()) bind.etPurchaseQuantity.filters = arrayOf(WeighInputFilter())
} }
...@@ -126,11 +128,11 @@ class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) { ...@@ -126,11 +128,11 @@ class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) {
} }
bind.vm?.purchaseQuantityName?.set(purchaseQuantityName) bind.vm?.purchaseQuantityName?.set(purchaseQuantityName)
bind.vm?.purchaseQuantity?.set(spec) bind.vm?.purchaseQuantity?.set(spec)
bind.etPurchaseQuantity.setText(spec) // bind.etPurchaseQuantity.setText(spec)
val length = bind.etPurchaseQuantity.text.toString().length // val length = bind.etPurchaseQuantity.text.toString().length
bind.etPurchaseQuantity.setSelection(length) // bind.etPurchaseQuantity.setSelection(length)
bind.etPurchaseQuantity.isFocusable = true; // bind.etPurchaseQuantity.isFocusable = true;
bind.etPurchaseQuantity.isFocusableInTouchMode = true; // bind.etPurchaseQuantity.isFocusableInTouchMode = true;
bind.etPurchaseQuantity.requestFocus() //获取焦点 bind.etPurchaseQuantity.requestFocus() //获取焦点
} }
...@@ -143,8 +145,16 @@ class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) { ...@@ -143,8 +145,16 @@ class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) {
fun confirm() { fun confirm() {
val purchaseQuantity: String = bind.etPurchaseQuantity.text.toString() val purchaseQuantity: String = bind.etPurchaseQuantity.text.toString()
var purchaseQuantityHint = bind.etPurchaseQuantity.hint.toString()
if (purchaseQuantity.isEmpty()) { if (purchaseQuantity.isEmpty()) {
"重量/数据不能为空".toast() dismiss()
if (type == 0) {
posProduct?.spec = purchaseQuantityHint
onChangeClick?.confirm(posProduct!!,null)
}else{
insertOrderProductDTO?.quantity = purchaseQuantityHint.toDouble()
onChangeClick?.confirm(null,insertOrderProductDTO!!)
}
return return
} }
if (BigDecimal(purchaseQuantity) == BigDecimal.ZERO) { if (BigDecimal(purchaseQuantity) == BigDecimal.ZERO) {
......
...@@ -38,8 +38,12 @@ object PrintUtils { ...@@ -38,8 +38,12 @@ object PrintUtils {
private const val PRNSTS_ERR_DRIVER = -257 //Printer Driver error private const val PRNSTS_ERR_DRIVER = -257 //Printer Driver error
private lateinit var printerManager: PrinterManager private lateinit var printerManager: PrinterManager
fun init() { fun init() {
printerManager = PrinterManager() try {
printerManager.open() printerManager = PrinterManager()
printerManager.open()
} catch (e: Exception) {
"打印机打开失败"
}
} }
...@@ -398,7 +402,11 @@ object PrintUtils { ...@@ -398,7 +402,11 @@ object PrintUtils {
fun close() { fun close() {
printerManager.close() try {
printerManager.close()
} catch (e: Exception) {
}
} }
private fun getSpace(content: String): String? { private fun getSpace(content: String): String? {
...@@ -689,7 +697,7 @@ object PrintUtils { ...@@ -689,7 +697,7 @@ object PrintUtils {
product.quantity, product.quantity,
product.price, product.price,
product.amount product.amount
), 0, height, 384, -1, fontName, fontSize, 0, fontStyle, 0 ), 0, height, 384, -1, fontName, 22, 0, 0, 0
) )
} }
} }
......
...@@ -108,11 +108,24 @@ class RequestMainViewModel : BaseViewModel() { ...@@ -108,11 +108,24 @@ class RequestMainViewModel : BaseViewModel() {
"没找到该商品".toastSign() "没找到该商品".toastSign()
} else { } else {
it.toJson().dXLog() it.toJson().dXLog()
posProduct.postValue(it) when {
// val productItem = it.mnemonicCode.isEmpty() -> {
// ProductItem(it.merchantItemId!!, it.id, it.spec.toDouble(), it.sellPrice) val productItem =
// productItem.toJson().dXLog() ProductItem(it.merchantItemId!!, it.id, it.spec.toDouble(), it.sellPrice)
// productItemData.postValue(productItem) productItem.toJson().dXLog()
productItemData.postValue(productItem)
}
it.mnemonicCode == key -> {
posProduct.postValue(it)
}
else -> {
val productItem =
ProductItem(it.merchantItemId!!, it.id, it.spec.toDouble(), it.sellPrice)
productItem.toJson().dXLog()
productItemData.postValue(productItem)
}
}
} }
}, { }, {
...@@ -170,10 +183,10 @@ class RequestMainViewModel : BaseViewModel() { ...@@ -170,10 +183,10 @@ class RequestMainViewModel : BaseViewModel() {
} }
val amount: Double = product.price.times(product.quantity) ?: 0.0 val amount: Double = product.price.times(product.quantity) ?: 0.0
amountTotal = BigDecimalUtils.forPlus(amountTotal.plus(amount)) amountTotal = BigDecimalUtils.forPlus(amountTotal.plus(amount))
var weightCode="" var weightCode = ""
if (pluList.size > index) { if (pluList.size > index) {
weightCode = weightCode =
if (pluList[index].id == posProduct?.id) pluList[index].plu else "" if (pluList[index].id == posProduct?.id) pluList[index].plu else ""
} }
...@@ -192,7 +205,7 @@ class RequestMainViewModel : BaseViewModel() { ...@@ -192,7 +205,7 @@ class RequestMainViewModel : BaseViewModel() {
price = product.price ?: 0.0, price = product.price ?: 0.0,
quantity = product.quantity ?: 0.0, quantity = product.quantity ?: 0.0,
tailAmount = 0, tailAmount = 0,
weightCode =weightCode, weightCode = weightCode,
name = posProduct.name, name = posProduct.name,
spec = posProduct.spec, spec = posProduct.spec,
unit = posProduct.unit, unit = posProduct.unit,
...@@ -255,7 +268,7 @@ class RequestMainViewModel : BaseViewModel() { ...@@ -255,7 +268,7 @@ class RequestMainViewModel : BaseViewModel() {
var posProduct: PosProduct? = null var posProduct: PosProduct? = null
var listNum = 0 var listNum = 0
for ((index,product) in productPromotions.withIndex()) { for ((index, product) in productPromotions.withIndex()) {
for (item in it) { for (item in it) {
if (product.productId == item.id) { if (product.productId == item.id) {
posProduct = item posProduct = item
...@@ -285,7 +298,7 @@ class RequestMainViewModel : BaseViewModel() { ...@@ -285,7 +298,7 @@ class RequestMainViewModel : BaseViewModel() {
} }
var activityPrice = activityInfo?.activityPrice ?: 0.0 var activityPrice = activityInfo?.activityPrice ?: 0.0
var weightCode="" var weightCode = ""
if (pluList.size > index) { if (pluList.size > index) {
weightCode = weightCode =
...@@ -436,8 +449,10 @@ class RequestMainViewModel : BaseViewModel() { ...@@ -436,8 +449,10 @@ class RequestMainViewModel : BaseViewModel() {
"${CacheUtil.getRealName()}付款成功,保存数据库并打印".dXLog() "${CacheUtil.getRealName()}付款成功,保存数据库并打印".dXLog()
pluList.clear() pluList.clear()
launch({ launch({
val currentTimeMillis = System.currentTimeMillis()
PrintUtils.print(posConfig!!, it) PrintUtils.print(posConfig!!, it)
PosBuyRepository.getInstance().savePosBuy(it, authCode) PosBuyRepository.getInstance().savePosBuy(it, authCode)
"打印和保存数据库使用耗时::${System.currentTimeMillis()-currentTimeMillis}".dXLog()
}, { }, {
"打印完成".dXLog() "打印完成".dXLog()
"打印完成".toastSuccess() "打印完成".toastSuccess()
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
android:lines="1" android:lines="1"
android:paddingVertical="10dp" android:paddingVertical="10dp"
android:paddingStart="10dp" android:paddingStart="10dp"
android:text="@{vm.purchaseQuantity}" android:text=""
android:textColor="#333333" android:textColor="#333333"
android:textColorHint="#999999" android:textColorHint="#999999"
android:textSize="20sp" android:textSize="20sp"
......
package com.ypsx.common.app.ext package com.ypsx.common.app.ext
import android.annotation.SuppressLint
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.list.SingleChoiceListener import com.afollestad.materialdialogs.list.SingleChoiceListener
...@@ -16,6 +17,7 @@ private val hostMap = mapOf( ...@@ -16,6 +17,7 @@ private val hostMap = mapOf(
private val hosts = hostMap.values.toTypedArray() private val hosts = hostMap.values.toTypedArray()
private val names = hostMap.keys.toList() private val names = hostMap.keys.toList()
@SuppressLint("StaticFieldLeak")
private var materialDialog: MaterialDialog? = null private var materialDialog: MaterialDialog? = null
fun AppCompatActivity.showServerHostExt(host:String,success: (String) -> Unit) { fun AppCompatActivity.showServerHostExt(host:String,success: (String) -> Unit) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment