Skip to content

The status bar color on Android is incorrect #10278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
Jiangshuon opened this issue Jan 30, 2024 · 12 comments
Closed
3 tasks done

The status bar color on Android is incorrect #10278

Jiangshuon opened this issue Jan 30, 2024 · 12 comments
Assignees
Labels
Milestone

Comments

@Jiangshuon
Copy link
Contributor

Jiangshuon commented Jan 30, 2024

最新版移动端顶栏显示不正常(一直为黑色)

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

默认主题、关闭所有css情况下也一样

26777b3569e9c6bb9a6933f9e6f0d39

Expected result

Screenshot or screen recording presentation

No response

Version environment

- Version: 最新
- Operating System: 
- Browser (if used):

Log file

More information

No response

@88250
Copy link
Member

88250 commented Jan 31, 2024

我这里测试 Android 版本正常:

Screenshot_2024-01-31-09-50-06-450_org b3log siyu

@88250
Copy link
Member

88250 commented Feb 1, 2024

老铁,试过重新安装吗?

@Jiangshuon
Copy link
Contributor Author

没呢大佬,我等下周新版本试试,安卓重装太费事了

@QQQOrange
Copy link

我这里测试 Android 版本正常:

Screenshot_2024-01-31-09-50-06-450_org b3log siyu

我也出现这种情况,默认主题的日间模式没问题,但是夜间模式的任务栏和主题色不一样,也是安卓

@QQQOrange
Copy link

老铁,试过重新安装吗?

第三方主题的日间模式任务栏也是和楼主说的一样

@QQQOrange
Copy link

我这里测试 Android 版本正常:

Screenshot_2024-01-31-09-50-06-450_org b3log siyu

Screenshot_20240203_074651.jpg

Screenshot_20240203_074707.jpg

第一张是写味主题,第二张是默认主题。

@QQQOrange
Copy link

我这里测试 Android 版本正常:

Screenshot_2024-01-31-09-50-06-450_org b3log siyu

Screenshot_20240203_074920.jpg

这是日间模式的第三方主题。

@88250
Copy link
Member

88250 commented Feb 3, 2024

找到问题了,下个版本解决,谢谢。

@88250 88250 changed the title 最新版移动端顶栏显示不正常(一直为黑色) The status bar color on Android is incorrect Feb 3, 2024
@88250 88250 added the Bug label Feb 3, 2024
@88250 88250 added this to the 2.12.7 milestone Feb 3, 2024
@88250 88250 assigned 88250 and unassigned Vanessa219 Feb 3, 2024
88250 added a commit to siyuan-note/siyuan-android that referenced this issue Feb 3, 2024
@88250 88250 closed this as completed Feb 3, 2024
@mustakshif
Copy link
Contributor

v3.0.8 还是有第三方主题在亮色模式下状态栏变黑的情况,如使用pink-room主题的绿色配色方案后重新进入应用会复现:
screenshot

状态栏的颜色是取自 --b3-theme-background 吗,我发现如果该 css 变量的值是 hex 颜色的话状态栏颜色就和背景色一致,如果是 rgb、hsl 等状态栏就是黑的

@88250
Copy link
Member

88250 commented Apr 9, 2024

我发现如果该 css 变量的值是 hex 颜色的话状态栏颜色就和背景色一致,如果是 rgb、hsl 等状态栏就是黑的

有可能是这部分代码还有问题 https://github.com/siyuan-note/siyuan-android/blob/ef6e616bbf5e8b28ba2555ae24e0d2bec23fe4de/app/src/main/java/org/b3log/siyuan/JSAndroid.java#L162

方便的话请试着帮忙排查,谢谢。

@mustakshif
Copy link
Contributor

我发现如果该 css 变量的值是 hex 颜色的话状态栏颜色就和背景色一致,如果是 rgb、hsl 等状态栏就是黑的

有可能是这部分代码还有问题 https://github.com/siyuan-note/siyuan-android/blob/ef6e616bbf5e8b28ba2555ae24e0d2bec23fe4de/app/src/main/java/org/b3log/siyuan/JSAndroid.java#L162

方便的话请试着帮忙排查,谢谢。

小白一枚,我没学过java和安卓开发,不太懂😂。

不过看代码应该是解决了rgb色彩的解析,但我测试了一下还是会变成默认的深灰色:
rgb

--b3-theme-background: rgb(245, 177, 177);

hsl颜色没有解析,所以也是默认:
hsl

--b3-theme-background: hsl(0, 77%, 83%);

hex颜色值能正常解析,可以跟随主题背景色:
WechatIMG36

--b3-theme-background: #f5b2b2;

……其他色彩空间应该不能解析了。
https://github.com/siyuan-note/siyuan-android/blob/ef6e616bbf5e8b28ba2555ae24e0d2bec23fe4de/app/src/main/java/org/b3log/siyuan/JSAndroid.java#L187
这里,感觉简单的解决方式就是亮色模式的默认值设为白色,而深色模式时默认值为深灰,这样就不用考虑主题作者用什么色彩空间了

@88250
Copy link
Member

88250 commented Apr 10, 2024

暂时用 hex 吧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants