Merged
feat: support automatic selection of high-density image variants. #1395
feat: support automatic selection of high-density image variants. #1395
Merged
xiedairongAdd on Aug 11, 2025
xiedairong
Aug 11, 2025

Description

A requirement has been raised by partners for RNOH to automatically choose optimal images based on pixel density ratios. To address this, we have implemented an automated multi-density image selection feature. Currently, RNOH provides support for four pixel density scale factors: 1x, 2x, 3x, and 4x.

Changes

  • support automatic selection of high-density image variants.

Test Plan

  1. Open the Tester.
  2. Check the ImageTest.

Checklist

likedislike
Pull Request has been successfully merged by huangyouhua.
(Thank you for xiedairong's contribution.)
openharmony_ci
openharmony_ciCollaborators
Aug 11, 2025 Comments:

感谢提交 Pull Requests!
Thanks for submitting a pull request.

likedislike
openharmony_ciopenharmony_ciCollaborators
Aug 11, 2025 Added label: dco检查成功
Xxiedairong
Aug 11, 2025 Associated issue: feat: support automatic selection of high-density image variants.
xiedairong
Aug 11, 2025 Comments:

start build

likedislike
openharmony_ci
openharmony_ciCollaborators
Aug 11, 2025 Comments:

首次触发
门禁构建开始,包含静态检查、代码编译【ohos_react_native_master编译】,预计在60分钟内完成,门禁结果会同步发送到注册邮箱。您可以通过如下链接跟踪门禁进展:http://dcp.openharmony.cn/workbench/cicd/detail/6899687164650f998b17e2bb/runlist

likedislike
openharmony_ciopenharmony_ciCollaborators
Aug 11, 2025 Added label: 编译成功
openharmony_ciopenharmony_ciCollaborators
Aug 11, 2025 Added label: 静态检查成功
openharmony_ciopenharmony_ciCollaborators
Aug 11, 2025 Test passed
openharmony_ci
openharmony_ciCollaborators
Aug 11, 2025 Comments:

代码门禁通过
您可以通过如下链接查看门禁报告:http://dcp.openharmony.cn/workbench/cicd/detail/6899687164650f998b17e2bb/runlist

静态检查:

# check type result report
1 codeCheck pass >>>

编译测试:
# Device build result package
1 ohos_react_native_master success >>>

likedislike
huangyouhua
huangyouhua
Aug 11, 2025 Comments:

@arkadiuszkasprzyk Please review.

likedislike
Arek Kasprzyk
Arek KasprzykAug 11, 2025Start code review2
tester/tests/ImageTest.tsx
@@ -202,0 +215,4 @@
215+ let scale = 0;
216+ for (let i = 0; i < scales.length; i++) {
217+ if (scales[i] >= deviceScale) {
218+ scale = scales[i];
Arek Kasprzyk
Arek KasprzykAug 11, 2025Comments:
  1. The latest scale higher than deviceScale will be used, which I think is wrong. ("3" will be used when "2" should be)
  2. Nit: Consider restructuring your test case to follow Arrange-Act-Assert pattern
likedislike
xiedairong
Aug 14, 2025 Comments:
  1. Yes, I forgot to exit the loop.
  2. This test case does not involve element rendering, so it is not suitable for this mode.
Arek KasprzykArek Kasprzyk
Aug 11, 2025 Set arkadiuszkasprzyk as approver
6 event messages are collapsed here。 See more
openharmony_ciopenharmony_ciCollaborators
Aug 14, 2025 Removed label: 编译成功
openharmony_ci
openharmony_ciCollaborators
Aug 14, 2025 Comments:

代码有更新,重置PR验证状态

likedislike
openharmony_ci
openharmony_ciCollaborators
Aug 14, 2025 Comments:

感谢提交 Pull Requests!
Thanks for submitting a pull request.

likedislike
xiedairong
Aug 14, 2025 Comments:

start build

likedislike
openharmony_ci
openharmony_ciCollaborators
Aug 14, 2025 Comments:

本地或库上代码有更新,全量重新构建,重置所有关联PR的验证状态
门禁构建开始,包含静态检查、代码编译【ohos_react_native_master编译】,预计在60分钟内完成,门禁结果会同步发送到注册邮箱。您可以通过如下链接跟踪门禁进展:http://dcp.openharmony.cn/workbench/cicd/detail/689d83a564650f998bca0431/runlist

likedislike
Xxiedairong
Aug 14, 2025 Resolved final issue
openharmony_ciopenharmony_ciCollaborators
Aug 14, 2025 Added label: 编译成功
openharmony_ciopenharmony_ciCollaborators
Aug 14, 2025 Added label: 静态检查成功
openharmony_ciopenharmony_ciCollaborators
Aug 14, 2025 Test passed
openharmony_ci
openharmony_ciCollaborators
Aug 14, 2025 Comments:

代码门禁通过
您可以通过如下链接查看门禁报告:http://dcp.openharmony.cn/workbench/cicd/detail/689d83a564650f998bca0431/runlist

静态检查:

# check type result report
1 codeCheck pass >>>

编译测试:
# Device build result package
1 ohos_react_native_master success >>>

likedislike
huangyouhuahuangyouhua
Aug 14, 2025 Approval passed
huangyouhuahuangyouhua
Aug 14, 2025 Added squash commit note: feat: support automatic selection of high-density image variants.
JackPan
JackPanAug 14, 2025Start code review2
tester/tests/ImageTest.tsx
@@ -202,0 +222,4 @@
222+ if (!scale) {
223+ scale = scales[scales.length - 1];
224+ }
225+ const filename = `fig-without-poppy${scale === 1 ? '' : '@' + scale + 'x'}.jpeg`;
JackPan
JackPanAug 14, 2025Comments:

fig-without-poppy.jpeg
fig-without-poppy@2x.jpeg
fig-without-poppy@3x.jpeg
这3张图片的来源是哪里,需确认版权

likedislike
xiedairong
Aug 14, 2025 Comments:

从77分支中拷贝过来的

JackPanJackPan
Aug 14, 2025 Set panjinling as tester
JackPanJackPan
Aug 14, 2025 Set panjinling as approver
JackPanJackPan
Aug 14, 2025 Approval passed
Xxiedairong
Aug 14, 2025 Resolved final issue
huangyouhuahuangyouhua
Aug 14, 2025 Closed associated issue
huangyouhuahuangyouhua
Aug 14, 2025 Merged pull request