@ray-js/ipc-player-integration 0.0.35 → 0.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ui/bottomLeftContent.js +17 -13
- package/lib/ui/ui.js +1 -1
- package/package.json +1 -1
|
@@ -91,6 +91,10 @@ const BottomLeftContent = _ref => {
|
|
|
91
91
|
setScrollResetKey(k => k + 1);
|
|
92
92
|
setScrollLeft(0);
|
|
93
93
|
setScrollTo(undefined);
|
|
94
|
+
scrollLeftRef.current = 0;
|
|
95
|
+
// 清零上一屏的测量值,避免用旧 clientWidth/contentWidth 在重新测量前误判溢出导致箭头闪现
|
|
96
|
+
setClientWidth(0);
|
|
97
|
+
setContentWidth(0);
|
|
94
98
|
}, [screenType]);
|
|
95
99
|
|
|
96
100
|
// 程序化滚动目标只在动画期间短暂受控,之后释放为非受控,避免回弹影响手动拖动
|
|
@@ -152,7 +156,10 @@ const BottomLeftContent = _ref => {
|
|
|
152
156
|
timer = setTimeout(measure, 400);
|
|
153
157
|
});
|
|
154
158
|
};
|
|
155
|
-
|
|
159
|
+
|
|
160
|
+
// 初次延时仅用于等布局沉降;切屏已清零旧测量值,不会用旧值误闪,
|
|
161
|
+
// 故首测尽量快(60ms)让箭头更早出现,后续仍按 400ms 轮询兜底异步内容撑开。
|
|
162
|
+
timer = setTimeout(measure, 60);
|
|
156
163
|
return () => {
|
|
157
164
|
if (timer) clearTimeout(timer);
|
|
158
165
|
};
|
|
@@ -188,21 +195,18 @@ const BottomLeftContent = _ref => {
|
|
|
188
195
|
// 点击右箭头:直接滚动到最右端。
|
|
189
196
|
// 给一个足够大的目标值,交由 ScrollView 自身夹取到真实最右端,避免测量误差导致滚不到底。
|
|
190
197
|
|
|
191
|
-
const coverHeight = screenType === 'vertical' ? shouldHide ? 49 : 48 : shouldHide ?
|
|
198
|
+
const coverHeight = screenType === 'vertical' ? shouldHide ? 49 : 48 : shouldHide ? 59 : 58;
|
|
192
199
|
const containerHeight = screenType === 'vertical' ? 48 : 58;
|
|
193
200
|
|
|
194
201
|
// reservedRight 兼容 number(px)与 string(任意 CSS 长度,例如 "35%")
|
|
195
202
|
const rightCss = typeof reservedRight === 'number' ? `${reservedRight}px` : reservedRight;
|
|
196
203
|
|
|
197
|
-
//
|
|
198
|
-
//
|
|
199
|
-
//
|
|
200
|
-
//
|
|
201
|
-
//
|
|
202
|
-
|
|
203
|
-
// 横屏: 25 + 25 + 16.5 = 66.5,箭头 16 → bottom = 58
|
|
204
|
-
|
|
205
|
-
const hintBottom = screenType === 'vertical' ? 16 : 58;
|
|
204
|
+
// ScrollView 贴 wrap 顶部,icon 在 ScrollView 内通过 align-items 居中到可视行中线。
|
|
205
|
+
// hintBottom 锚定可视行中线(pulse 箭头 16,先按 16 高算 bottom,按钮模式再下移补差):
|
|
206
|
+
// icon 中心距 wrap 底 = paddingBottom + visibleRowHeight/2
|
|
207
|
+
// 竖屏: 0 + 24 = 24 → bottom = 16
|
|
208
|
+
// 横屏: 25 + 16.5 = 41.5 → bottom = 33.5
|
|
209
|
+
const visibleRowHeight = containerHeight - paddingBottomPx;
|
|
206
210
|
// button 模式用半透明圆做点击热区,比 pulse 提示大;下移半个差值以保持图标中心不变
|
|
207
211
|
const hintSize = isButtonHint ? 26 : 16;
|
|
208
212
|
// 竖屏 button 模式给 ScrollView 右侧留一条较窄的“箭头槽”:只裁掉内容最右一小段,
|
|
@@ -283,7 +287,7 @@ const BottomLeftContent = _ref => {
|
|
|
283
287
|
style: {
|
|
284
288
|
display: 'inline-flex',
|
|
285
289
|
flexDirection: 'row',
|
|
286
|
-
height: `${
|
|
290
|
+
height: `${visibleRowHeight}px`,
|
|
287
291
|
alignItems: 'center'
|
|
288
292
|
}
|
|
289
293
|
}, children, /*#__PURE__*/React.createElement(View, {
|
|
@@ -300,7 +304,7 @@ const BottomLeftContent = _ref => {
|
|
|
300
304
|
style: {
|
|
301
305
|
position: 'absolute',
|
|
302
306
|
right: `${hintRight}px`,
|
|
303
|
-
bottom: `${
|
|
307
|
+
bottom: `${paddingBottomPx + visibleRowHeight / 2 - 8 - (hintSize - 16) / 2}px`,
|
|
304
308
|
width: `${hintSize}px`,
|
|
305
309
|
height: `${hintSize}px`,
|
|
306
310
|
display: 'flex',
|
package/lib/ui/ui.js
CHANGED
|
@@ -463,7 +463,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
463
463
|
const res = await getSmartImageQualityState(devId);
|
|
464
464
|
if (!res) return;
|
|
465
465
|
// 调试时使用
|
|
466
|
-
// res = {
|
|
466
|
+
// const res = {
|
|
467
467
|
// isPurchase: false,
|
|
468
468
|
// buttonState: 0,
|
|
469
469
|
// trialRemainingSec: 20,
|