decord/source/408_useAndroidRippleForView.js

96 lines
2.8 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 408
// Function ID: 5806
// Name: useAndroidRippleForView
2026-07-23 10:11:24 +00:00
// Dependencies: [31, 38, 44, 115]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 408 (useAndroidRippleForView)
2026-07-23 10:11:24 +00:00
import "result";
import { useMemo } from "result";
const require = arg1;
2026-07-20 16:05:17 +00:00
export default function useAndroidRippleForView(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let closure_4;
2026-07-20 16:05:17 +00:00
let foreground;
let obj = arg0;
2026-07-23 10:11:24 +00:00
let closure_0 = arg1;
2026-07-20 16:05:17 +00:00
if (null == arg0) {
obj = {};
}
const color = obj.color;
const borderless = obj.borderless;
const radius = obj.radius;
({ cornerRadius: closure_4, foreground } = obj);
const items = [borderless, color, foreground, radius, arg1];
2026-07-23 10:11:24 +00:00
return radius(() => {
2026-07-20 16:05:17 +00:00
if (null == color) {
if (null == borderless) {
if (null == radius) {
return null;
}
}
}
const tmp3 = color(borderless[1])(color);
let tmp5 = null == tmp3;
if (!tmp5) {
tmp5 = "number" === typeof tmp3;
}
color(borderless[2])(tmp5, "Unexpected color given for Ripple color");
let obj = { type: "RippleAndroid", color: tmp3, borderless: true === borderless, rippleRadius: radius, rippleCornerRadius: closure_4 };
obj = {};
if (true === foreground) {
obj = {};
obj.nativeForegroundAndroid = obj;
let obj1 = obj;
} else {
obj1 = { nativeBackgroundAndroid: obj };
}
obj.viewProps = obj1;
obj.onPressIn = function onPressIn(nativeEvent) {
2026-07-23 10:11:24 +00:00
const current = outer1_0.current;
2026-07-20 16:05:17 +00:00
if (null != current) {
2026-07-23 10:11:24 +00:00
const Commands2 = callback(borderless[3]).Commands;
2026-07-20 16:05:17 +00:00
const locationX = nativeEvent.nativeEvent.locationX;
let num = 0;
if (null != locationX) {
num = locationX;
}
const locationY = nativeEvent.nativeEvent.locationY;
let num2 = 0;
if (null != locationY) {
num2 = locationY;
}
Commands2.hotspotUpdate(current, num, num2);
2026-07-23 10:11:24 +00:00
const Commands = callback(borderless[3]).Commands;
2026-07-20 16:05:17 +00:00
Commands.setPressed(current, true);
}
};
obj.onPressMove = function onPressMove(nativeEvent) {
2026-07-23 10:11:24 +00:00
const current = outer1_0.current;
2026-07-20 16:05:17 +00:00
if (null != current) {
2026-07-23 10:11:24 +00:00
const Commands = callback(borderless[3]).Commands;
2026-07-20 16:05:17 +00:00
const locationX = nativeEvent.nativeEvent.locationX;
let num2 = 0;
if (null != locationX) {
num2 = locationX;
}
const locationY = nativeEvent.nativeEvent.locationY;
let num3 = 0;
if (null != locationY) {
num3 = locationY;
}
Commands.hotspotUpdate(current, num2, num3);
}
};
obj.onPressOut = function onPressOut(arg0) {
2026-07-23 10:11:24 +00:00
const current = outer1_0.current;
2026-07-20 16:05:17 +00:00
if (null != current) {
2026-07-23 10:11:24 +00:00
const Commands = callback(borderless[3]).Commands;
2026-07-20 16:05:17 +00:00
Commands.setPressed(current, false);
}
};
return obj;
}, items);
};