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

52 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-10-06 11:16:32 +00:00
// Module ID: 14298
// Function ID: 14299
// Name: BackPressManager
2026-10-06 11:16:32 +00:00
// Dependencies: [17, 4753, 1616, 1488, 1989, 1369, 2]
2026-07-20 16:05:17 +00:00
2026-10-06 11:16:32 +00:00
// Module 14298 (BackPressManager)
2026-10-03 08:58:59 +00:00
import react_native from "react-native" /* 17 */;
import PlatformUtils from "PlatformUtils" /* 1369 */;
import KeyboardUIStore from "KeyboardUIStore" /* 1488 */;
import KeyboardTypes from "KeyboardTypes" /* 1616 */;
2026-10-06 11:16:32 +00:00
import useKeyboardType from "useKeyboardType" /* 4753 */;
2026-10-03 08:58:59 +00:00
import LifecycleManager from "LifecycleManager" /* 1989 */;
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;