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

143 lines
4.3 KiB
TypeScript
Raw Normal View History

2026-08-11 06:20:06 +00:00
// Module ID: 1494
// Function ID: 1495
2026-07-29 08:29:29 +00:00
// Name: getDimensionsStoreStateForEntry
2026-08-11 06:20:06 +00:00
// Dependencies: [17, 1495, 1893, 1628, 1894, 1641, 705, 644, 1629, 2]
2026-07-20 16:05:17 +00:00
2026-08-11 06:20:06 +00:00
// Module 1494 (getDimensionsStoreStateForEntry)
2026-07-23 10:11:24 +00:00
import { Dimensions } from "get ActivityIndicator";
import keys from "keys";
import importDefaultResult from "subscribeToKeyboardUIStore";
2026-08-11 06:20:06 +00:00
import importDefaultResult1 from "module_1629";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
function getDimensionsStoreStateForEntry(appEntryKey) {
2026-07-20 16:05:17 +00:00
let height;
2026-07-29 08:29:29 +00:00
let height2;
2026-07-20 16:05:17 +00:00
let width2;
2026-07-29 08:29:29 +00:00
let width4;
const size = {};
let obj = Dimensions;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(Dimensions.get("window"));
2026-08-11 06:20:06 +00:00
let obj1 = require(1893) /* readWindowSizeForAppEntry */;
2026-07-29 08:29:29 +00:00
const merged1 = Object.assign(obj1.readWindowSizeForAppEntry(appEntryKey));
2026-08-11 06:20:06 +00:00
let obj2 = require(1893) /* 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-11 06:20:06 +00:00
let tmp2Result = tmp2(1628);
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-11 06:20:06 +00:00
tmp2Result = tmp2(1894);
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-11 06:20:06 +00:00
const rect2 = require(1628) /* 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;
let obj = {};
2026-07-29 08:29:29 +00:00
let flag = null != arg0;
2026-08-11 06:20:06 +00:00
const iter = require(1641) /* 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-07-23 10:11:24 +00:00
let obj = keys.create(() => getDimensionsStoreState(undefined));
2026-08-11 06:20:06 +00:00
const subscription = require("module_1629").subscribe(() => {
2026-07-29 08:29:29 +00:00
require(705) /* batchUpdates */.batchUpdates(() => state.setState((arg0) => callback(arg0)));
2026-07-20 16:05:17 +00:00
});
importDefaultResult(() => {
2026-07-29 08:29:29 +00:00
require(705) /* batchUpdates */.batchUpdates(() => state.setState((arg0) => callback(arg0)));
2026-07-20 16:05:17 +00:00
});
const listener = Dimensions.addEventListener("change", () => {
2026-07-29 08:29:29 +00:00
require(705) /* batchUpdates */.batchUpdates(() => state.setState((arg0) => callback(arg0)));
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
const result = require("readWindowSizeForAppEntry").fileFinishedImporting("modules/screen/native/DimensionsStore.android.tsx");
2026-07-20 16:05:17 +00:00
export default obj;