Commit ce44caa4 authored by 赵鹏翔's avatar 赵鹏翔

基础dialog封装,集成到基础包下

parent 4d2b8d91
...@@ -12,7 +12,7 @@ import com.elvishew.xlog.printer.Printer ...@@ -12,7 +12,7 @@ import com.elvishew.xlog.printer.Printer
import com.elvishew.xlog.printer.file.FilePrinter import com.elvishew.xlog.printer.file.FilePrinter
import com.elvishew.xlog.printer.file.backup.NeverBackupStrategy import com.elvishew.xlog.printer.file.backup.NeverBackupStrategy
import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator
import com.fastcashier.lib_common.BaseApplication import com.fastcashier.lib_common.base.BaseApplication
import com.fastcashier.lib_common.function.account.AccountService import com.fastcashier.lib_common.function.account.AccountService
import com.fastcashier.lib_common.function.pay.OrderRecordManageKit import com.fastcashier.lib_common.function.pay.OrderRecordManageKit
import com.fastcashier.lib_common.util.DateUtils import com.fastcashier.lib_common.util.DateUtils
......
...@@ -2,12 +2,10 @@ package com.miya.fastcashier.log ...@@ -2,12 +2,10 @@ package com.miya.fastcashier.log
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.widget.Toast import com.fastcashier.lib_common.util.clickWithTrigger
import com.miya.fastcashier.databinding.ActivityFunctionCenterBinding import com.miya.fastcashier.databinding.ActivityFunctionCenterBinding
import com.miya.fastcashier.ui.BaseActivity import com.miya.fastcashier.ui.BaseActivity
import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.LogFileUtils import com.miya.fastcashier.utils.LogFileUtils
import com.miya.fastcashier.utils.clickWithTrigger
/** /**
* 功能中心 * 功能中心
......
...@@ -2,7 +2,7 @@ package com.miya.fastcashier.net ...@@ -2,7 +2,7 @@ package com.miya.fastcashier.net
import android.text.TextUtils import android.text.TextUtils
import android.util.Log import android.util.Log
import com.fastcashier.lib_common.BaseApplication import com.fastcashier.lib_common.base.BaseApplication
import com.fastcashier.lib_common.function.account.SelfCashierAccountInfo import com.fastcashier.lib_common.function.account.SelfCashierAccountInfo
import com.fastcashier.lib_common.function.account.SelfCashierTerminalConfig import com.fastcashier.lib_common.function.account.SelfCashierTerminalConfig
import com.fastcashier.lib_common.net.ApiConfig import com.fastcashier.lib_common.net.ApiConfig
......
...@@ -10,9 +10,9 @@ import com.blankj.utilcode.util.LogUtils ...@@ -10,9 +10,9 @@ import com.blankj.utilcode.util.LogUtils
import com.fastcashier.lib_common.config.IntentExtra import com.fastcashier.lib_common.config.IntentExtra
import com.fastcashier.lib_common.function.pay.OrderRecordManageKit import com.fastcashier.lib_common.function.pay.OrderRecordManageKit
import com.fastcashier.lib_common.util.StringPriceFormatUtils import com.fastcashier.lib_common.util.StringPriceFormatUtils
import com.fastcashier.lib_common.util.clickWithTrigger
import com.miya.fastcashier.databinding.ActivityAliPayCodeBinding import com.miya.fastcashier.databinding.ActivityAliPayCodeBinding
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.viewmodel.PayViewModel import com.miya.fastcashier.viewmodel.PayViewModel
import com.miya.print.utils.BitmapUtils import com.miya.print.utils.BitmapUtils
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
......
...@@ -15,8 +15,8 @@ import androidx.lifecycle.Observer ...@@ -15,8 +15,8 @@ import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.blankj.utilcode.util.ToastUtils import com.blankj.utilcode.util.ToastUtils
import com.fastcashier.lib_common.function.account.AccountService import com.fastcashier.lib_common.function.account.AccountService
import com.fastcashier.lib_common.util.clickWithTrigger
import com.miya.fastcashier.databinding.ActivityLoginBinding import com.miya.fastcashier.databinding.ActivityLoginBinding
import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.utils.manage.LocalKeyDataMKManageKit import com.miya.fastcashier.utils.manage.LocalKeyDataMKManageKit
import com.miya.fastcashier.viewmodel.LoginViewModel import com.miya.fastcashier.viewmodel.LoginViewModel
import com.permissionx.guolindev.PermissionX import com.permissionx.guolindev.PermissionX
......
...@@ -10,11 +10,12 @@ import androidx.lifecycle.ViewModelProvider ...@@ -10,11 +10,12 @@ import androidx.lifecycle.ViewModelProvider
import com.fastcashier.lib_common.function.account.AccountService import com.fastcashier.lib_common.function.account.AccountService
import com.fastcashier.lib_common.function.pay.OrderRecordManageKit import com.fastcashier.lib_common.function.pay.OrderRecordManageKit
import com.fastcashier.lib_common.function.print.PrintService import com.fastcashier.lib_common.function.print.PrintService
import com.fastcashier.lib_common.ui.dialog.CommonDialog
import com.fastcashier.lib_common.util.DateUtils import com.fastcashier.lib_common.util.DateUtils
import com.fastcashier.lib_common.util.clickWithTrigger
import com.miya.fastcashier.R import com.miya.fastcashier.R
import com.miya.fastcashier.databinding.ActivityMainBinding import com.miya.fastcashier.databinding.ActivityMainBinding
import com.miya.fastcashier.ui.dialog.AuthorizePasswordInputDialog import com.miya.fastcashier.ui.dialog.AuthorizePasswordInputDialog
import com.miya.fastcashier.ui.dialog.CommonDialog
import com.miya.fastcashier.utils.* import com.miya.fastcashier.utils.*
import com.miya.fastcashier.utils.manage.AccountPasswordManageKit import com.miya.fastcashier.utils.manage.AccountPasswordManageKit
import com.miya.fastcashier.utils.manage.LocalKeyDataMKManageKit import com.miya.fastcashier.utils.manage.LocalKeyDataMKManageKit
......
...@@ -7,10 +7,10 @@ import android.widget.Toast ...@@ -7,10 +7,10 @@ import android.widget.Toast
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.fastcashier.lib_common.config.IntentExtra import com.fastcashier.lib_common.config.IntentExtra
import com.fastcashier.lib_common.function.pay.OrderRecordManageKit import com.fastcashier.lib_common.function.pay.OrderRecordManageKit
import com.fastcashier.lib_common.util.clickWithTrigger
import com.miya.fastcashier.databinding.ActivityPayBinding import com.miya.fastcashier.databinding.ActivityPayBinding
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.ScanGunKeyEventHelper import com.miya.fastcashier.utils.ScanGunKeyEventHelper
import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.viewmodel.PayViewModel import com.miya.fastcashier.viewmodel.PayViewModel
import java.util.* import java.util.*
......
...@@ -9,12 +9,12 @@ import com.alibaba.fastjson.JSON ...@@ -9,12 +9,12 @@ import com.alibaba.fastjson.JSON
import com.blankj.utilcode.util.LogUtils import com.blankj.utilcode.util.LogUtils
import com.fastcashier.lib_common.config.IntentExtra import com.fastcashier.lib_common.config.IntentExtra
import com.fastcashier.lib_common.util.StringPriceFormatUtils import com.fastcashier.lib_common.util.StringPriceFormatUtils
import com.fastcashier.lib_common.util.clickWithTrigger
import com.miya.fastcashier.R import com.miya.fastcashier.R
import com.miya.fastcashier.R.mipmap.ic_alipay import com.miya.fastcashier.R.mipmap.ic_alipay
import com.miya.fastcashier.R.mipmap.ic_wxpay import com.miya.fastcashier.R.mipmap.ic_wxpay
import com.miya.fastcashier.databinding.ActivityPayCodeBinding import com.miya.fastcashier.databinding.ActivityPayCodeBinding
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.viewmodel.PayViewModel import com.miya.fastcashier.viewmodel.PayViewModel
import com.miya.print.utils.BitmapUtils import com.miya.print.utils.BitmapUtils
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
......
...@@ -8,8 +8,8 @@ import androidx.lifecycle.ViewModelProvider ...@@ -8,8 +8,8 @@ import androidx.lifecycle.ViewModelProvider
import com.fastcashier.lib_common.config.IntentExtra import com.fastcashier.lib_common.config.IntentExtra
import com.fastcashier.lib_common.function.pay.MiYaPayPlantformPayWayEnum import com.fastcashier.lib_common.function.pay.MiYaPayPlantformPayWayEnum
import com.fastcashier.lib_common.util.StringPriceFormatUtils import com.fastcashier.lib_common.util.StringPriceFormatUtils
import com.fastcashier.lib_common.util.clickWithTrigger
import com.miya.fastcashier.databinding.ActivityPayResultBinding import com.miya.fastcashier.databinding.ActivityPayResultBinding
import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.viewmodel.PrintViewModel import com.miya.fastcashier.viewmodel.PrintViewModel
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
......
...@@ -7,15 +7,15 @@ import android.view.View ...@@ -7,15 +7,15 @@ import android.view.View
import android.widget.Toast import android.widget.Toast
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.fastcashier.lib_common.config.IntentExtra import com.fastcashier.lib_common.config.IntentExtra
import com.fastcashier.lib_common.ui.dialog.CommonDialog
import com.fastcashier.lib_common.util.StringPriceFormatUtils import com.fastcashier.lib_common.util.StringPriceFormatUtils
import com.fastcashier.lib_common.util.clickWithTrigger
import com.miya.fastcashier.R import com.miya.fastcashier.R
import com.miya.fastcashier.databinding.ActivityPriceInputBinding import com.miya.fastcashier.databinding.ActivityPriceInputBinding
import com.miya.fastcashier.ui.dialog.CommonDialog
import com.miya.fastcashier.ui.dialog.PayChooseDialog import com.miya.fastcashier.ui.dialog.PayChooseDialog
import com.miya.fastcashier.ui.dialog.PayChooseDialog.GeneratePayCodeClickListener import com.miya.fastcashier.ui.dialog.PayChooseDialog.GeneratePayCodeClickListener
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.WordUtil import com.miya.fastcashier.utils.WordUtil
import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.viewmodel.PayViewModel import com.miya.fastcashier.viewmodel.PayViewModel
import com.miya.fastcashier.widget.DecimalKeyboard.DELETE import com.miya.fastcashier.widget.DecimalKeyboard.DELETE
import com.miya.fastcashier.widget.DecimalKeyboard.DOT import com.miya.fastcashier.widget.DecimalKeyboard.DOT
......
...@@ -5,12 +5,11 @@ import android.os.Bundle ...@@ -5,12 +5,11 @@ import android.os.Bundle
import android.view.KeyEvent import android.view.KeyEvent
import android.widget.Toast import android.widget.Toast
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.fastcashier.lib_common.ui.dialog.NumberManualDialog
import com.fastcashier.lib_common.util.clickWithTrigger
import com.miya.fastcashier.databinding.ActivityRefundBinding import com.miya.fastcashier.databinding.ActivityRefundBinding
import com.miya.fastcashier.ui.dialog.NumberManualDialog
import com.miya.fastcashier.ui.dialog.NumberManualDialog.NumberInputListener
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.ScanGunKeyEventHelper import com.miya.fastcashier.utils.ScanGunKeyEventHelper
import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.viewmodel.PayViewModel import com.miya.fastcashier.viewmodel.PayViewModel
...@@ -70,7 +69,7 @@ class RefundActivity : BaseActivity() { ...@@ -70,7 +69,7 @@ class RefundActivity : BaseActivity() {
if (numberManualDialog == null) { if (numberManualDialog == null) {
numberManualDialog = NumberManualDialog(this); numberManualDialog = NumberManualDialog(this);
numberManualDialog!!.setNumberInputListener(object : numberManualDialog!!.setNumberInputListener(object :
NumberInputListener { NumberManualDialog.NumberInputListener {
override fun numberInput(number: String) { override fun numberInput(number: String) {
showProgressDialog("正在为您退款..") showProgressDialog("正在为您退款..")
viewModel.payResultQuery(number) viewModel.payResultQuery(number)
......
...@@ -4,9 +4,9 @@ import android.content.Context ...@@ -4,9 +4,9 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
import com.fastcashier.lib_common.util.clickWithTrigger
import com.miya.fastcashier.databinding.ActivityResetAuthorizePasswordBinding import com.miya.fastcashier.databinding.ActivityResetAuthorizePasswordBinding
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.utils.manage.AccountPasswordManageKit import com.miya.fastcashier.utils.manage.AccountPasswordManageKit
class ResetAuthorizePasswordActivity : BaseActivity() { class ResetAuthorizePasswordActivity : BaseActivity() {
......
...@@ -19,6 +19,7 @@ import com.fastcashier.lib_common.function.account.AccountService ...@@ -19,6 +19,7 @@ import com.fastcashier.lib_common.function.account.AccountService
import com.fastcashier.lib_common.function.pay.MiYaPayPlantformPayWayEnum import com.fastcashier.lib_common.function.pay.MiYaPayPlantformPayWayEnum
import com.fastcashier.lib_common.function.print.PrintService import com.fastcashier.lib_common.function.print.PrintService
import com.fastcashier.lib_common.util.StringPriceFormatUtils import com.fastcashier.lib_common.util.StringPriceFormatUtils
import com.fastcashier.lib_common.util.clickWithTrigger
import com.fastcashier.lib_common.util.dp2px import com.fastcashier.lib_common.util.dp2px
import com.google.android.material.tabs.TabLayoutMediator import com.google.android.material.tabs.TabLayoutMediator
import com.miya.fastcashier.R import com.miya.fastcashier.R
...@@ -28,7 +29,6 @@ import com.miya.fastcashier.databinding.ActivitySearchOrderBinding ...@@ -28,7 +29,6 @@ import com.miya.fastcashier.databinding.ActivitySearchOrderBinding
import com.miya.fastcashier.databinding.FragmentSearchOrderBinding import com.miya.fastcashier.databinding.FragmentSearchOrderBinding
import com.miya.fastcashier.databinding.ItemSearchOrderListBinding import com.miya.fastcashier.databinding.ItemSearchOrderListBinding
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.utils.manage.LocalKeyDataMKManageKit import com.miya.fastcashier.utils.manage.LocalKeyDataMKManageKit
import com.miya.fastcashier.viewmodel.SearchOrderViewModel import com.miya.fastcashier.viewmodel.SearchOrderViewModel
......
...@@ -5,17 +5,14 @@ import android.content.Intent ...@@ -5,17 +5,14 @@ import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.view.Gravity import android.view.Gravity
import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager
import com.fastcashier.lib_common.BaseApplication import com.fastcashier.lib_common.ui.dialog.CommonDialog
import com.fastcashier.lib_common.BaseApplication.Companion.getApplication import com.fastcashier.lib_common.util.click
import com.fastcashier.lib_common.util.clickWithTrigger
import com.miya.fastcashier.MiyaApplication import com.miya.fastcashier.MiyaApplication
import com.miya.fastcashier.R import com.miya.fastcashier.R
import com.miya.fastcashier.databinding.ActivitySettingBinding import com.miya.fastcashier.databinding.ActivitySettingBinding
import com.miya.fastcashier.log.FunctionCenterActivity import com.miya.fastcashier.log.FunctionCenterActivity
import com.miya.fastcashier.ui.dialog.AuthorizePasswordInputDialog import com.miya.fastcashier.ui.dialog.AuthorizePasswordInputDialog
import com.miya.fastcashier.ui.dialog.CommonDialog
import com.miya.fastcashier.utils.click
import com.miya.fastcashier.utils.clickWithTrigger
import es.dmoral.toasty.Toasty
class SettingActivity : BaseActivity() { class SettingActivity : BaseActivity() {
......
...@@ -10,9 +10,9 @@ import com.blankj.utilcode.util.LogUtils ...@@ -10,9 +10,9 @@ import com.blankj.utilcode.util.LogUtils
import com.fastcashier.lib_common.config.IntentExtra import com.fastcashier.lib_common.config.IntentExtra
import com.fastcashier.lib_common.function.pay.OrderRecordManageKit import com.fastcashier.lib_common.function.pay.OrderRecordManageKit
import com.fastcashier.lib_common.util.StringPriceFormatUtils import com.fastcashier.lib_common.util.StringPriceFormatUtils
import com.fastcashier.lib_common.util.clickWithTrigger
import com.miya.fastcashier.databinding.ActivityWxPayCodeBinding import com.miya.fastcashier.databinding.ActivityWxPayCodeBinding
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.viewmodel.PayViewModel import com.miya.fastcashier.viewmodel.PayViewModel
import com.miya.print.utils.BitmapUtils import com.miya.print.utils.BitmapUtils
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
......
package com.miya.fastcashier.ui.dialog
import android.app.AlertDialog
import android.app.Dialog
import android.content.Context
import android.content.DialogInterface
import android.view.Gravity
import android.view.WindowManager
import android.widget.TextView
import com.miya.fastcashier.R
import com.miya.fastcashier.utils.clickWithTrigger
class MessageDialog(context: Context) : Dialog(context){
private lateinit var tvMessage: TextView
private lateinit var tvNegative: TextView
private lateinit var tvPositive: TextView
private lateinit var mPositiveButtonListener:DialogInterface.OnClickListener
private lateinit var mNegativeButtonListener:DialogInterface.OnClickListener
private lateinit var mPositiveButtonText:CharSequence
private lateinit var mNegativeButtonText:CharSequence
init {
initWindow()
initView()
}
private fun initView() {
setContentView(R.layout.dialog_message)
tvMessage = findViewById(R.id.tvMessage)
tvNegative = findViewById(R.id.tvNegative)
tvPositive = findViewById(R.id.tvPositive)
tvNegative.clickWithTrigger {
dismiss()
}
tvPositive.clickWithTrigger {
dismiss()
mPositiveButtonListener.onClick(null,1)
}
}
override fun setContentView(layoutResID: Int) {
super.setContentView(R.layout.dialog_message)
tvMessage = findViewById(R.id.tvMessage)
tvNegative = findViewById(R.id.tvNegative)
tvPositive = findViewById(R.id.tvPositive)
}
fun setPositiveButton(text: CharSequence, listener: DialogInterface.OnClickListener): MessageDialog {
this.mPositiveButtonText = text
this.mPositiveButtonListener = listener
return this
}
fun setNegativeButton(text: CharSequence, listener: DialogInterface.OnClickListener): MessageDialog {
this.mNegativeButtonText = text
this.mNegativeButtonListener = listener
return this
}
fun setCustomMessage(message: CharSequence?) : MessageDialog{
tvMessage.text = message
return this
}
private fun initWindow() {
val win = this.window
win!!.decorView.setPadding(0, 0, 0, 0)
val lp = win.attributes
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.WRAP_CONTENT
lp.gravity = Gravity.CENTER
lp.windowAnimations = R.style.AlphaInAndOutStyle
win.attributes = lp
win.setBackgroundDrawableResource(R.color.transparent)
}
}
\ No newline at end of file
...@@ -8,8 +8,8 @@ import android.widget.ImageButton ...@@ -8,8 +8,8 @@ import android.widget.ImageButton
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import com.fastcashier.lib_common.util.clickWithTrigger
import com.miya.fastcashier.R import com.miya.fastcashier.R
import com.miya.fastcashier.utils.clickWithTrigger
class PayChooseDialog(context: Context) : Dialog(context){ class PayChooseDialog(context: Context) : Dialog(context){
......
...@@ -7,8 +7,8 @@ import android.view.WindowManager ...@@ -7,8 +7,8 @@ import android.view.WindowManager
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import com.fastcashier.lib_common.util.StringPriceFormatUtils import com.fastcashier.lib_common.util.StringPriceFormatUtils
import com.fastcashier.lib_common.util.clickWithTrigger
import com.miya.fastcashier.R import com.miya.fastcashier.R
import com.miya.fastcashier.utils.clickWithTrigger
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
/** /**
......
<?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:id="@+id/container"
android:background="@drawable/app_center_dialog_bg"
android:layout_width="match_parent"
android:layout_marginStart="85dp"
android:layout_marginEnd="85dp"
android:layout_marginRight="85dp"
android:layout_height="264dp"
android:layout_marginLeft="85dp">
<TextView
android:id="@+id/tvMessage"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:textColor="#323233"
android:textSize="28sp"
android:text="是否确认退款"
android:layout_marginTop="61dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<View
android:id="@+id/vHorizontalLine"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="164dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="#E8E8E8" />
<View
android:id="@+id/vVerticalLine"
android:layout_width="1dp"
android:layout_height="0dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/vHorizontalLine"
android:background="#E8E8E8" />
<TextView
android:id="@+id/tvNegative"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="取消"
android:textColor="#969799"
android:textSize="28sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/vVerticalLine"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/vHorizontalLine" />
<TextView
android:id="@+id/tvPositive"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/vVerticalLine"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/vHorizontalLine"
android:textColor="#111235"
android:textSize="28sp"
android:text="确定"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<resources> <resources>
<style name="BottomInAndOutStyle">
<item name="android:windowEnterAnimation">@anim/in_bottom</item>
<item name="android:windowExitAnimation">@anim/out_bottom</item>
</style>
<style name="AlphaInAndOutStyle"> <style name="AlphaInAndOutStyle">
<item name="android:windowEnterAnimation">@anim/in_center_alpha</item> <item name="android:windowEnterAnimation">@anim/in_center_alpha</item>
<item name="android:windowExitAnimation">@anim/out_center_alpha</item> <item name="android:windowExitAnimation">@anim/out_center_alpha</item>
...@@ -24,15 +19,6 @@ ...@@ -24,15 +19,6 @@
<item name="android:maxLines">1</item> <item name="android:maxLines">1</item>
</style> </style>
<style name="CommonDialog" parent="android:style/Theme.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:backgroundDimAmount">0.7</item>
</style>
<style name="LFileToolbarTextStyle" parent="ThemeOverlay.AppCompat.Dark.ActionBar"> <style name="LFileToolbarTextStyle" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:textColor">@color/lfile_white</item> <item name="android:textColor">@color/lfile_white</item>
<item name="android:textSize">16sp</item> <item name="android:textSize">16sp</item>
......
package com.fastcashier.lib_common package com.fastcashier.lib_common.base
import androidx.multidex.MultiDexApplication import androidx.multidex.MultiDexApplication
......
package com.fastcashier.lib_common.net package com.fastcashier.lib_common.net
import android.util.Log import android.util.Log
import com.fastcashier.lib_common.BaseApplication.Companion.getApplication import com.fastcashier.lib_common.base.BaseApplication.Companion.getApplication
import com.fastcashier.lib_common.R import com.fastcashier.lib_common.R
import com.fastcashier.lib_common.util.isNetworkConnected import com.fastcashier.lib_common.util.isNetworkConnected
import retrofit2.Call import retrofit2.Call
......
package com.miya.fastcashier.widget; package com.fastcashier.lib_common.ui;
import android.content.Context; import android.content.Context;
import android.util.AttributeSet; import android.util.AttributeSet;
...@@ -7,7 +7,7 @@ import android.view.View; ...@@ -7,7 +7,7 @@ import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import com.miya.fastcashier.R; import com.fastcashier.lib_common.R;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -30,7 +30,7 @@ public class NumKeyboard extends LinearLayout { ...@@ -30,7 +30,7 @@ public class NumKeyboard extends LinearLayout {
public NumKeyboard(Context context, AttributeSet attrs) { public NumKeyboard(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
View view = LayoutInflater.from(context).inflate(R.layout.keyboard_number, this, true); View view = LayoutInflater.from(context).inflate(R.layout.app_layout_keyboard_number, this, true);
buttons = new ArrayList<>(12); buttons = new ArrayList<>(12);
ClickListener clickListener = new ClickListener(); ClickListener clickListener = new ClickListener();
btn_7 = view.findViewById(R.id.btn_7); btn_7 = view.findViewById(R.id.btn_7);
......
package com.miya.fastcashier.ui.dialog package com.fastcashier.lib_common.ui.dialog
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
...@@ -6,13 +6,13 @@ import android.graphics.Color ...@@ -6,13 +6,13 @@ import android.graphics.Color
import android.widget.TextView import android.widget.TextView
import android.text.SpannableString import android.text.SpannableString
import android.view.Gravity import android.view.Gravity
import com.miya.fastcashier.R
import android.os.Bundle import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
import android.view.ViewGroup.MarginLayoutParams import android.view.ViewGroup.MarginLayoutParams
import android.text.method.LinkMovementMethod import android.text.method.LinkMovementMethod
import android.view.View import android.view.View
import com.miya.fastcashier.utils.clickWithTrigger import com.fastcashier.lib_common.R
import com.fastcashier.lib_common.util.clickWithTrigger
class CommonDialog : Dialog { class CommonDialog : Dialog {
protected var tvMessage: TextView? = null protected var tvMessage: TextView? = null
...@@ -54,7 +54,7 @@ class CommonDialog : Dialog { ...@@ -54,7 +54,7 @@ class CommonDialog : Dialog {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
this.setContentView(R.layout.dialog_common) this.setContentView(R.layout.app_dialog_common)
tvMessage = findViewById(R.id.tvMessage) tvMessage = findViewById(R.id.tvMessage)
tvNegative = findViewById(R.id.tvNegative) tvNegative = findViewById(R.id.tvNegative)
tvPositive = findViewById(R.id.tvPositive) tvPositive = findViewById(R.id.tvPositive)
......
package com.miya.fastcashier.ui.dialog package com.fastcashier.lib_common.ui.dialog
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
...@@ -9,13 +9,13 @@ import android.view.WindowManager ...@@ -9,13 +9,13 @@ import android.view.WindowManager
import android.widget.Button import android.widget.Button
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import com.miya.fastcashier.R import com.fastcashier.lib_common.R
import com.miya.fastcashier.widget.NumKeyboard import com.fastcashier.lib_common.ui.NumKeyboard
/** /**
* 手动输入数字 * 数字键盘
*/ */
class NumberManualDialog(context: Context, ) : Dialog(context) { class NumberManualDialog(context: Context) : Dialog(context) {
private lateinit var ivClose: ImageView private lateinit var ivClose: ImageView
private lateinit var etNumber: TextView private lateinit var etNumber: TextView
...@@ -36,7 +36,7 @@ class NumberManualDialog(context: Context, ) : Dialog(context) { ...@@ -36,7 +36,7 @@ class NumberManualDialog(context: Context, ) : Dialog(context) {
} }
private fun initView() { private fun initView() {
setContentView(R.layout.dialog_number_input) setContentView(R.layout.app_dialog_number_input)
ivClose = findViewById(R.id.ivClose) ivClose = findViewById(R.id.ivClose)
ivClose.setOnClickListener { ivClose.setOnClickListener {
dismiss() dismiss()
...@@ -76,9 +76,9 @@ class NumberManualDialog(context: Context, ) : Dialog(context) { ...@@ -76,9 +76,9 @@ class NumberManualDialog(context: Context, ) : Dialog(context) {
else -> { else -> {
tvErrInfo.visibility = View.GONE tvErrInfo.visibility = View.GONE
var currentCode: String = etNumber.text.toString() var currentCode: String = etNumber.text.toString()
if(TextUtils.isEmpty(currentCode)){ if (TextUtils.isEmpty(currentCode)) {
etNumber.setText(it.toString()) etNumber.setText(it.toString())
}else{ } else {
currentCode += it currentCode += it
etNumber.setText(currentCode) etNumber.setText(currentCode)
} }
...@@ -89,7 +89,7 @@ class NumberManualDialog(context: Context, ) : Dialog(context) { ...@@ -89,7 +89,7 @@ class NumberManualDialog(context: Context, ) : Dialog(context) {
} }
fun setNumberInputListener(numberInputListener: NumberInputListener){ fun setNumberInputListener(numberInputListener: NumberInputListener) {
this.numberInputListener = numberInputListener this.numberInputListener = numberInputListener
} }
...@@ -106,6 +106,6 @@ class NumberManualDialog(context: Context, ) : Dialog(context) { ...@@ -106,6 +106,6 @@ class NumberManualDialog(context: Context, ) : Dialog(context) {
} }
interface NumberInputListener { interface NumberInputListener {
fun numberInput(number:String); fun numberInput(number: String);
} }
} }
\ No newline at end of file
package com.miya.fastcashier.utils package com.fastcashier.lib_common.util
import android.view.View import android.view.View
......
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="300"
android:fromYDelta="100%p"
android:toYDelta="0"/>
</set>
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="300"
android:fromYDelta="0"
android:toYDelta="100%p"/>
</set>
...@@ -5,4 +5,5 @@ ...@@ -5,4 +5,5 @@
android:startColor="@color/white" /> android:startColor="@color/white" />
<corners <corners
android:radius="8dp" /> android:radius="8dp" />
</shape> </shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/app_shape_keybord_btn_normal" android:state_pressed="true" />
<item android:drawable="@drawable/app_shape_keybord_btn_pressed" android:state_pressed="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:drawable="@drawable/app_shape_keybord_btn_sure_enable_false"/>
<item android:state_enabled="true" android:drawable="@drawable/app_shape_keybord_btn_sure_enable_true"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:endColor="@color/white"
android:startColor="@color/white" />
<corners
android:topLeftRadius="20dp"
android:topRightRadius="20dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:endColor="@color/white"
android:startColor="@color/white" />
<corners android:radius="8dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:endColor="#E7E7EB"
android:startColor="#E7E7EB" />
<corners android:radius="8dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:endColor="@color/colorPrimary_50"
android:startColor="@color/colorPrimary_50" />
<corners android:radius="8dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:endColor="@color/colorPrimary"
android:startColor="@color/colorPrimary" />
<corners android:radius="8dp" />
</shape>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container" android:id="@+id/container"
android:background="@drawable/app_center_dialog_bg" android:background="@drawable/app_dialog_center_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_marginStart="85dp" android:layout_marginStart="85dp"
android:layout_marginEnd="85dp" android:layout_marginEnd="85dp"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container" android:id="@+id/container"
android:background="@drawable/app_bottom_dialog_bg" android:background="@drawable/app_shape_bottom_dialog_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="497dp"> android:layout_marginTop="497dp">
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
android:layout_marginTop="38dp" android:layout_marginTop="38dp"
android:layout_marginEnd="38dp" android:layout_marginEnd="38dp"
android:padding="7dp" android:padding="7dp"
android:src="@mipmap/ic_close" android:src="@mipmap/app_icon_close"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
android:layout_marginRight="38dp" /> android:layout_marginRight="38dp" />
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
app:layout_constraintStart_toStartOf="@+id/etNumber" app:layout_constraintStart_toStartOf="@+id/etNumber"
app:layout_constraintTop_toBottomOf="@+id/etNumber"/> app:layout_constraintTop_toBottomOf="@+id/etNumber"/>
<com.miya.fastcashier.widget.NumKeyboard <com.fastcashier.lib_common.ui.NumKeyboard
android:id="@+id/numKeyboard" android:id="@+id/numKeyboard"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="15dp" android:layout_margin="15dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/app_keybord_btn_dark" android:background="@drawable/app_selector_keybord_btn_dark"
android:text="1" android:text="1"
android:textColor="#141C30" android:textColor="#141C30"
android:textSize="36sp"/> android:textSize="36sp"/>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
android:layout_margin="15dp" android:layout_margin="15dp"
android:layout_weight="1" android:layout_weight="1"
android:textColor="#141C30" android:textColor="#141C30"
android:background="@drawable/app_keybord_btn_dark" android:background="@drawable/app_selector_keybord_btn_dark"
android:text="2" android:text="2"
android:textSize="36sp" /> android:textSize="36sp" />
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
android:layout_margin="15dp" android:layout_margin="15dp"
android:textColor="#141C30" android:textColor="#141C30"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/app_keybord_btn_dark" android:background="@drawable/app_selector_keybord_btn_dark"
android:text="3" android:text="3"
android:textSize="36sp" /> android:textSize="36sp" />
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="15dp" android:layout_margin="15dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/app_keybord_btn_dark" android:background="@drawable/app_selector_keybord_btn_dark"
android:text="4" android:text="4"
android:textSize="36sp" /> android:textSize="36sp" />
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
android:textColor="#141C30" android:textColor="#141C30"
android:layout_margin="15dp" android:layout_margin="15dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/app_keybord_btn_dark" android:background="@drawable/app_selector_keybord_btn_dark"
android:text="5" android:text="5"
android:textSize="36sp" /> android:textSize="36sp" />
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
android:layout_margin="15dp" android:layout_margin="15dp"
android:layout_weight="1" android:layout_weight="1"
android:textColor="#141C30" android:textColor="#141C30"
android:background="@drawable/app_keybord_btn_dark" android:background="@drawable/app_selector_keybord_btn_dark"
android:text="6" android:text="6"
android:textSize="36sp" /> android:textSize="36sp" />
</LinearLayout> </LinearLayout>
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
android:layout_margin="15dp" android:layout_margin="15dp"
android:textColor="#141C30" android:textColor="#141C30"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/app_keybord_btn_dark" android:background="@drawable/app_selector_keybord_btn_dark"
android:text="7" android:text="7"
android:textSize="36sp" /> android:textSize="36sp" />
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
android:layout_margin="15dp" android:layout_margin="15dp"
android:layout_weight="1" android:layout_weight="1"
android:textColor="#141C30" android:textColor="#141C30"
android:background="@drawable/app_keybord_btn_dark" android:background="@drawable/app_selector_keybord_btn_dark"
android:text="8" android:text="8"
android:textSize="36sp" /> android:textSize="36sp" />
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
android:layout_margin="15dp" android:layout_margin="15dp"
android:layout_weight="1" android:layout_weight="1"
android:textColor="#141C30" android:textColor="#141C30"
android:background="@drawable/app_keybord_btn_dark" android:background="@drawable/app_selector_keybord_btn_dark"
android:text="9" android:text="9"
android:textSize="36sp" /> android:textSize="36sp" />
</LinearLayout> </LinearLayout>
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
style="@style/Base.Widget.AppCompat.Button.Borderless" style="@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/app_keybord_btn_dark" android:background="@drawable/app_selector_keybord_btn_dark"
android:layout_margin="15dp" android:layout_margin="15dp"
android:layout_weight="1"> android:layout_weight="1">
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
android:layout_height="45dp" android:layout_height="45dp"
android:layout_gravity="center" android:layout_gravity="center"
android:scaleType="fitXY" android:scaleType="fitXY"
android:src="@mipmap/ic_delete" /> android:src="@mipmap/app_icon_delete" />
</FrameLayout> </FrameLayout>
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
android:layout_margin="15dp" android:layout_margin="15dp"
android:textColor="#141C30" android:textColor="#141C30"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/app_keybord_btn_dark" android:background="@drawable/app_selector_keybord_btn_dark"
android:text="0" android:text="0"
android:textSize="36sp" /> android:textSize="36sp" />
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
android:layout_weight="1" android:layout_weight="1"
android:textColor="@color/white" android:textColor="@color/white"
android:enabled="false" android:enabled="false"
android:background="@drawable/app_keybord_btn_sure" android:background="@drawable/app_selector_keybord_btn_sure"
android:text="确定" android:text="确定"
android:textSize="36sp" /> android:textSize="36sp" />
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="commonColorPrimary">#FF8000</color>
<color name="colorPrimary">#111235</color>
<color name="colorPrimary_50">#80111235</color>
<color name="white">#FFFFFFFF</color>
<color name="transparent">#00000000</color>
<color name="color_323233">#323233</color>
</resources>
\ No newline at end of file
<resources>
<style name="BottomInAndOutStyle">
<item name="android:windowEnterAnimation">@anim/in_bottom</item>
<item name="android:windowExitAnimation">@anim/out_bottom</item>
</style>
<style name="CommonDialog" parent="android:style/Theme.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:backgroundDimAmount">0.7</item>
</style>
</resources>
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