支付完成倒计时3秒返回首页;秤默认置零取消,打开直接识别物品;人脸识别图片显示拉伸优化;设置页面切换是否收费模式首页逻辑处理;
This commit is contained in:
@@ -17,9 +17,13 @@ import androidx.lifecycle.lifecycleScope
|
||||
import androidx.viewbinding.ViewBinding
|
||||
import com.sw.dualscreen.R
|
||||
import com.sw.dualscreen.model.IActivityResult
|
||||
import com.sw.dualscreen.model.response.PostEvent
|
||||
import com.sw.dualscreen.view.CustomDialog
|
||||
import com.sw.dualscreen.viewmodel.BaseViewModel
|
||||
import kotlinx.coroutines.launch
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import timber.log.Timber
|
||||
|
||||
|
||||
@@ -37,6 +41,7 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
EventBus.getDefault().register(this)
|
||||
enableEdgeToEdge()
|
||||
context = this
|
||||
|
||||
@@ -50,6 +55,11 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
|
||||
registerDataChange()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
EventBus.getDefault().unregister(this)
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
abstract fun getViewModel(): BaseViewModel
|
||||
|
||||
protected abstract fun inflateViewBinding(): VB
|
||||
@@ -122,4 +132,9 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
|
||||
) { result: Boolean ->
|
||||
launchPermissionCallback?.callback(result)
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onPostEvent(event: PostEvent) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user