From 900a9049010c421ca6298d550847428cff65fa09 Mon Sep 17 00:00:00 2001 From: Hyejin Park <89901283+phj0407@users.noreply.github.com> Date: Tue, 6 Sep 2022 07:01:21 +0900 Subject: [PATCH] [Refactor] Revise EuPI code --- .../com/euphonyio/orderwith/StoreActivity.kt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/euphonyio/orderwith/StoreActivity.kt b/app/src/main/java/com/euphonyio/orderwith/StoreActivity.kt index d7cce8b..7f735a0 100644 --- a/app/src/main/java/com/euphonyio/orderwith/StoreActivity.kt +++ b/app/src/main/java/com/euphonyio/orderwith/StoreActivity.kt @@ -67,11 +67,11 @@ class StoreActivity : ComponentActivity() { EuPIRxManager = EuRxManager(EuOption.ModeType.EUPI) EuPIRxManager.setOnWaveKeyDown(RequestCodeEnum.MENU_REQUEST.code.toInt()) { Toast.makeText(this, "Menu request detected", Toast.LENGTH_SHORT).show() - Log.d(TAG, "mEuPIRxManagerMenu - Receive menu request.") + Log.d(TAG, "EuPIRxManager - Receive menu request.") } EuPIRxManager.setOnWaveKeyDown(RequestCodeEnum.ORDER_REQUEST.code.toInt()) { Toast.makeText(this, "Order request detected", Toast.LENGTH_SHORT).show() - Log.d(TAG, "mEuPIRxManagerOrder - Receive order request.") + Log.d(TAG, "EuPIRxManager - Receive order request.") } var allMenu: List @@ -85,12 +85,9 @@ class StoreActivity : ComponentActivity() { } if (!allMenu.isNullOrEmpty()) { - if (mEuPIRxManagerOrder.listen()) { - Log.d(TAG, "mEuPIRxManagerOrder - listen success") - } - if (mEuPIRxManagerMenu.listen()) { - Log.d(TAG, "mEuPIRxManagerMenu - listen success") - } + if (EuPIRxManager.listen()) { + Log.d(TAG, "EuPIRxManager - listen success") + }else{Log.d(TAG, "EuPIRxManager - listen fail") }else{Log.d(TAG, "Menu is empty")} } @@ -106,8 +103,7 @@ class StoreActivity : ComponentActivity() { private fun stopEuphony() { mTxManager.stop() - mEuPIRxManagerOrder.finish() - mEuPIRxManagerMenu.finish() + EuPIRxManager.finish() } private fun receiveOrder(letters: String, dbUtil: DBUtil) {