|
@@ -4,6 +4,7 @@ import android.os.Bundle
|
|
|
import android.view.LayoutInflater
|
|
|
import android.view.View
|
|
|
import android.view.ViewGroup
|
|
|
+import androidx.core.os.bundleOf
|
|
|
import androidx.databinding.DataBindingUtil
|
|
|
import androidx.lifecycle.MutableLiveData
|
|
|
import androidx.lifecycle.ViewModel
|
|
@@ -14,6 +15,7 @@ import com.doverfuelingsolutions.issp.databinding.FragmentNozzleOrdersBinding
|
|
|
import com.doverfuelingsolutions.issp.fusion.FusionManager
|
|
|
import com.doverfuelingsolutions.issp.utils.DFSToastUtil
|
|
|
import com.doverfuelingsolutions.issp.utils.StringUtil
|
|
|
+import com.doverfuelingsolutions.issp.utils.log.DFSLog
|
|
|
import com.doverfuelingsolutions.issp.utils.sp.SPUtil
|
|
|
import com.doverfuelingsolutions.issp.view.MainActivity
|
|
|
import com.doverfuelingsolutions.issp.view.adapter.ChooseListAdapter
|
|
@@ -21,12 +23,18 @@ import com.doverfuelingsolutions.issp.view.adapter.OrderListAdapter
|
|
|
import com.scwang.smart.refresh.header.ClassicsHeader
|
|
|
import com.wayne.www.waynelib.fdc.message.DeviceClass
|
|
|
|
|
|
-class FragmentOrderList private constructor(private val pumpId: Int) : FragmentBasic() {
|
|
|
+class FragmentOrderList private constructor() : FragmentBasic() {
|
|
|
|
|
|
companion object {
|
|
|
- fun build(pumpId: Int) = FragmentOrderList(pumpId)
|
|
|
+ fun build(pumpId: Int): FragmentOrderList {
|
|
|
+ return FragmentOrderList().apply {
|
|
|
+ arguments = bundleOf(Pair("pumpId", pumpId))
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ private var pumpId: Int = -1
|
|
|
+
|
|
|
override val title = StringUtil.get(R.string.select_pay_order)
|
|
|
override val countdownTime: Int = 80
|
|
|
|
|
@@ -38,7 +46,9 @@ class FragmentOrderList private constructor(private val pumpId: Int) : FragmentB
|
|
|
|
|
|
private val orderList = arrayListOf<DeviceClass>()
|
|
|
private val orderListAfterFilter = arrayListOf<DeviceClass>()
|
|
|
- private val orderListAdapter = OrderListAdapter(if (pumpId != -1) orderList else orderListAfterFilter, this::selectOrder)
|
|
|
+ private val orderListAdapter: OrderListAdapter by lazy {
|
|
|
+ OrderListAdapter(if (pumpId != -1) orderList else orderListAfterFilter, this::selectOrder)
|
|
|
+ }
|
|
|
private var selectedPosition: Int? = null
|
|
|
|
|
|
private var selectedName = ""
|
|
@@ -48,6 +58,7 @@ class FragmentOrderList private constructor(private val pumpId: Int) : FragmentB
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
super.onCreate(savedInstanceState)
|
|
|
|
|
|
+ pumpId = arguments?.getInt("pumpId") ?: -1
|
|
|
loadListData()
|
|
|
}
|
|
|
|