decord/source/modules/screen/native/DimensionsStore.android.tsx

145 lines
4.4 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 1495
// Function ID: 1496
2026-07-29 08:29:29 +00:00
// Name: getDimensionsStoreStateForEntry
2026-08-15 05:55:55 +00:00
// Dependencies: [17, 1496, 1894, 1629, 1895, 1642, 705, 644, 1630, 2]
2026-07-20 16:05:17 +00:00
2026-08-15 05:55:55 +00:00
// Module 1495 (getDimensionsStoreStateForEntry)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import batchUpdates from "batchUpdates" /* 705 */;
import useSafeAreaInsets from "useSafeAreaInsets" /* 1629 */;
import APP_ENTRY_KEYS from "APP_ENTRY_KEYS" /* 1642 */;
import readWindowSizeForAppEntry from "readWindowSizeForAppEntry" /* 1894 */;
import keys from "keys" /* 644 */;
import importDefaultResult from "subscribeToKeyboardUIStore" /* 1496 */;
import importDefaultResult1 from "module_1630" /* 1630 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
function getDimensionsStoreStateForEntry(appEntryKey) {
const size = {};
2026-08-24 06:08:38 +00:00
obj = Dimensions;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(Dimensions.get("window"));
2026-08-24 06:08:38 +00:00
obj1 = readWindowSizeForAppEntry;
2026-07-29 08:29:29 +00:00
const merged1 = Object.assign(obj1.readWindowSizeForAppEntry(appEntryKey));
2026-08-24 06:08:38 +00:00
let obj2 = readWindowSizeForAppEntry;
2026-07-29 08:29:29 +00:00
let size2 = obj2.readScreenSizeForAppEntry(appEntryKey);
if (size2 == null) {
size2 = obj.get("screen");
}
obj2 = arg1;
const fontScale = size.fontScale;
2026-07-20 16:05:17 +00:00
let windowDimensions;
2026-07-29 08:29:29 +00:00
if (arg1 != null) {
windowDimensions = obj2.windowDimensions;
2026-07-20 16:05:17 +00:00
}
let prop;
2026-07-29 08:29:29 +00:00
if (obj2 != null) {
prop = obj2.windowDimensionsIgnoringKeyboard;
}
let width = size.width;
({ width: width2, height } = size2);
2026-08-15 05:55:55 +00:00
let tmp2Result = tmp2(1629);
2026-07-29 08:29:29 +00:00
const rect = tmp2Result.getSafeAreaInsets(appEntryKey);
let tmp8 = height;
let tmp9 = width2;
if (height === width) {
tmp8 = width2;
tmp9 = height;
}
const bound = Math.min(width + rect.left + rect.right, tmp9);
const sum = size.height + rect.top + rect.bottom;
2026-08-15 05:55:55 +00:00
tmp2Result = tmp2(1895);
2026-07-29 08:29:29 +00:00
obj = { appEntryKey };
const bound1 = Math.min(sum - tmp2Result.getSystemKeyboardHeight(obj), tmp8);
width = undefined;
if (windowDimensions != null) {
width = windowDimensions.width;
}
if (width !== bound) {
obj = { width: null, height: null };
obj[0] = bound;
obj[1] = bound1;
windowDimensions = obj;
}
const width3 = size.width;
({ width: width4, height: height2 } = size2);
2026-08-24 06:08:38 +00:00
const rect2 = useSafeAreaInsets.getSafeAreaInsets(appEntryKey);
2026-07-29 08:29:29 +00:00
let tmp14 = height2;
let tmp15 = width4;
if (height2 === width3) {
tmp14 = width4;
tmp15 = height2;
}
const bound2 = Math.min(width3 + rect2.left + rect2.right, tmp15);
const bound3 = Math.min(size.height + rect2.top + rect2.bottom, tmp14);
let width1;
if (prop != null) {
width1 = prop.width;
}
if (width1 !== bound2) {
obj1 = { width: null, height: null };
obj1[0] = bound2;
obj1[1] = bound3;
prop = obj1;
2026-07-20 16:05:17 +00:00
}
let windowDimensions1;
2026-07-29 08:29:29 +00:00
if (obj2 != null) {
windowDimensions1 = obj2.windowDimensions;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (windowDimensions1 === windowDimensions) {
if (obj2.windowDimensionsIgnoringKeyboard === prop) {
return obj2;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj2 = { fontScale, screenIsLandscape: tmp5, windowDimensions, windowDimensionsIgnoringKeyboard: prop };
2026-07-20 16:05:17 +00:00
}
function getDimensionsStoreState(arg0) {
let tmp = arg0;
2026-08-24 06:08:38 +00:00
obj = {};
2026-07-29 08:29:29 +00:00
let flag = null != arg0;
2026-08-24 06:08:38 +00:00
const iter = APP_ENTRY_KEYS.APP_ENTRY_KEYS[Symbol.iterator]();
2026-07-29 08:29:29 +00:00
const nextResult = iter.next();
while (iter !== undefined) {
let tmp3 = nextResult;
let tmp5;
let tmp4 = getDimensionsStoreStateForEntry;
if (tmp != null) {
let tmp6 = nextResult;
tmp5 = tmp.byAppEntry[tmp3];
}
let tmp4Result = tmp4(nextResult, tmp5);
let tmp9 = nextResult;
obj[tmp3] = tmp4Result;
let tmp10;
let tmp8 = tmp4Result;
if (tmp != null) {
let tmp11 = nextResult;
tmp10 = tmp.byAppEntry[tmp3];
}
let tmp12 = tmp4Result;
if (tmp10 !== tmp8) {
flag = false;
}
continue;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!flag) {
obj = { byAppEntry: null };
obj[0] = obj;
2026-07-20 16:05:17 +00:00
tmp = obj;
}
return tmp;
}
2026-08-24 06:08:38 +00:00
const Dimensions = get_ActivityIndicator.Dimensions;
2026-07-23 10:11:24 +00:00
let obj = keys.create(() => getDimensionsStoreState(undefined));
2026-08-24 06:08:38 +00:00
const subscription = importDefaultResult1.subscribe(() => {
batchUpdates.batchUpdates(() => state.setState((arg0) => callback(arg0)));
2026-07-20 16:05:17 +00:00
});
importDefaultResult(() => {
2026-08-24 06:08:38 +00:00
batchUpdates.batchUpdates(() => state.setState((arg0) => callback(arg0)));
2026-07-20 16:05:17 +00:00
});
const listener = Dimensions.addEventListener("change", () => {
2026-08-24 06:08:38 +00:00
batchUpdates.batchUpdates(() => state.setState((arg0) => callback(arg0)));
2026-07-20 16:05:17 +00:00
});
2026-08-24 06:08:38 +00:00
const result = set.fileFinishedImporting("modules/screen/native/DimensionsStore.android.tsx");
2026-07-20 16:05:17 +00:00
export default obj;