version:6.5
fix: update:增加自动接听,语音播报,拨号提示音,悬浮按钮
This commit is contained in:
@@ -1,15 +1,24 @@
|
||||
package com.uiuios.aios.base;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import androidx.annotation.CallSuper;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.base.rx.BaseRxActivity;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
|
||||
|
||||
public abstract class BaseTransparentActivity extends BaseRxActivity {
|
||||
private static final String TAG = BaseTransparentActivity.class.getSimpleName();
|
||||
|
||||
|
||||
private MMKV mmkv = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
public BaseTransparentActivity() {
|
||||
super();
|
||||
@@ -54,4 +63,25 @@ public abstract class BaseTransparentActivity extends BaseRxActivity {
|
||||
public boolean setfitWindow() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
switch (keyCode) {
|
||||
case KeyEvent.KEYCODE_VOLUME_UP://增大系统媒体音量
|
||||
case KeyEvent.KEYCODE_VOLUME_DOWN://减小系统媒体音量
|
||||
return getVolumeKeyStatus();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
public boolean getVolumeKeyStatus() {
|
||||
boolean disableKey = mmkv.decodeBool(CommonConfig.DISABLE_VOLUME_KEY, false);
|
||||
Log.e(TAG, "getVolumeKeyStatus: disableKey = " + disableKey);
|
||||
if (disableKey){
|
||||
Toaster.showLong("音量键已被禁用");
|
||||
}
|
||||
return disableKey;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user