|
@ -32,6 +32,8 @@ import com.blankj.utilcode.util.NetworkUtils; // 网络工具类 |
|
|
import com.bumptech.glide.Glide; |
|
|
import com.bumptech.glide.Glide; |
|
|
import com.bumptech.glide.load.resource.bitmap.CircleCrop; |
|
|
import com.bumptech.glide.load.resource.bitmap.CircleCrop; |
|
|
import com.bumptech.glide.request.RequestOptions; |
|
|
import com.bumptech.glide.request.RequestOptions; |
|
|
|
|
|
import com.ouxuan.oxface.device.voice.VoicePlayerManager; |
|
|
|
|
|
import com.ouxuan.oxface.device.voice.VoiceType; |
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.util.Date; |
|
|
import java.util.Date; |
|
@ -77,6 +79,9 @@ public class OrderSelectionActivity extends AppCompatActivity { |
|
|
private GateUnavailableDialog gateUnavailableDialog; |
|
|
private GateUnavailableDialog gateUnavailableDialog; |
|
|
private GateABController gateController; |
|
|
private GateABController gateController; |
|
|
|
|
|
|
|
|
|
|
|
// 添加语音播放管理器 |
|
|
|
|
|
private VoicePlayerManager voicePlayerManager; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
protected void onCreate(Bundle savedInstanceState) { |
|
|
protected void onCreate(Bundle savedInstanceState) { |
|
|
super.onCreate(savedInstanceState); |
|
|
super.onCreate(savedInstanceState); |
|
@ -106,7 +111,8 @@ public class OrderSelectionActivity extends AppCompatActivity { |
|
|
initData(); |
|
|
initData(); |
|
|
setupListeners(); |
|
|
setupListeners(); |
|
|
startCountdown(); |
|
|
startCountdown(); |
|
|
|
|
|
|
|
|
|
|
|
// 初始化语音播放管理器 |
|
|
|
|
|
initVoicePlayerManager(); |
|
|
// 注册强制关闭广播接收器 |
|
|
// 注册强制关闭广播接收器 |
|
|
registerForceCloseReceiver(); |
|
|
registerForceCloseReceiver(); |
|
|
|
|
|
|
|
@ -136,7 +142,24 @@ public class OrderSelectionActivity extends AppCompatActivity { |
|
|
// 更新店铺信息 |
|
|
// 更新店铺信息 |
|
|
updateStoreInfo(); |
|
|
updateStoreInfo(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 初始化语音播放管理器 |
|
|
|
|
|
*/ |
|
|
|
|
|
private void initVoicePlayerManager() { |
|
|
|
|
|
try { |
|
|
|
|
|
voicePlayerManager = VoicePlayerManager.getInstance(); |
|
|
|
|
|
voicePlayerManager.initialize(this); |
|
|
|
|
|
|
|
|
|
|
|
LogManager.logInfo(TAG, "语音播放管理器初始化完成"); |
|
|
|
|
|
|
|
|
|
|
|
// 播放"请选择订单确认核销"语音 |
|
|
|
|
|
if (voicePlayerManager != null) { |
|
|
|
|
|
voicePlayerManager.playVoice(VoiceType.SELECT_ORDER_CONFIRM); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
LogManager.logError(TAG, "语音播放管理器初始化失败", e); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
private void initData() { |
|
|
private void initData() { |
|
|
// 获取传入的数据 |
|
|
// 获取传入的数据 |
|
|
Intent intent = getIntent(); |
|
|
Intent intent = getIntent(); |
|
@ -596,6 +619,13 @@ public class OrderSelectionActivity extends AppCompatActivity { |
|
|
super.onDestroy(); |
|
|
super.onDestroy(); |
|
|
stopCountdown(); |
|
|
stopCountdown(); |
|
|
|
|
|
|
|
|
|
|
|
// 释放语音播放器资源 |
|
|
|
|
|
if (voicePlayerManager != null) { |
|
|
|
|
|
voicePlayerManager.release(); |
|
|
|
|
|
voicePlayerManager = null; |
|
|
|
|
|
LogManager.logInfo(TAG, "语音播放器资源已释放"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Fix 9.2: 不再需要清理门禁状态监听器(已改用广播方式) |
|
|
// Fix 9.2: 不再需要清理门禁状态监听器(已改用广播方式) |
|
|
|
|
|
|
|
|
// 释放门禁弹窗资源 |
|
|
// 释放门禁弹窗资源 |
|
|