decord/alpha/source/modules/routing/native/BackPressManager.tsx

52 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-10-08 09:57:35 +00:00
// Module ID: 14523
// Function ID: 14524
// Name: BackPressManager
2026-10-08 09:57:35 +00:00
// Dependencies: [17, 4947, 1628, 1500, 2001, 1381, 2]
2026-07-20 16:05:17 +00:00
2026-10-08 09:57:35 +00:00
// Module 14523 (BackPressManager)
2026-10-03 08:58:59 +00:00
import react_native from "react-native" /* 17 */;
2026-10-08 09:57:35 +00:00
import PlatformUtils from "PlatformUtils" /* 1381 */;
import KeyboardUIStore from "KeyboardUIStore" /* 1500 */;
import KeyboardTypes from "KeyboardTypes" /* 1628 */;
import useKeyboardType from "useKeyboardType" /* 4947 */;
import LifecycleManager from "LifecycleManager" /* 2001 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-07-20 16:05:17 +00:00
function handleBackPress() {
2026-10-03 08:58:59 +00:00
const obj = useKeyboardType;
const keyboardType = obj.getKeyboardType();
2026-08-24 06:08:38 +00:00
let flag = keyboardType !== KeyboardTypes.KeyboardTypes.SYSTEM;
2026-07-20 16:05:17 +00:00
if (flag) {
2026-10-03 08:58:59 +00:00
const obj2 = { type: KeyboardTypes.KeyboardTypes.SYSTEM };
const setKeyboardType = KeyboardUIStore.setKeyboardType;
KeyboardUIStore;
setKeyboardType(obj2);
2026-07-20 16:05:17 +00:00
flag = true;
}
return flag;
}
2026-10-03 08:58:59 +00:00
const BackHandler = react_native.BackHandler;
class BackPressManager extends LifecycleManager {
_initialize() {
const obj = PlatformUtils;
if (obj.isAndroid()) {
const self = this;
const result = this._initializeGlobalBackPressListener();
}
}
_initializeGlobalBackPressListener() {
this._backPressEventSubscription = BackHandler.addEventListener("hardwareBackPress", handleBackPress);
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
_terminate() {
const _backPressEventSubscription = this._backPressEventSubscription;
if (_backPressEventSubscription != null) {
_backPressEventSubscription.remove();
}
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
}
const prototype = BackPressManager.prototype;
2026-07-29 08:29:29 +00:00
const backPressManager = new BackPressManager();
let result = size.fileFinishedImporting("modules/routing/native/BackPressManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default backPressManager;