Skip to content
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

设置状态栏颜色导致提示性文字(mMessageText)消失 #9

Closed
hkq325800 opened this issue Jun 9, 2016 · 6 comments
Closed
Assignees

Comments

@hkq325800
Copy link

系统版本MIUI6.7.1.0 android4.4.4KTU84P
ConfirmPatternActivity、SetPatternActivity中由于以下代码造成mMessageText无法显示
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
对mMessageText设置textcolor也无法解决

@zhanghai
Copy link
Owner

项目里使用的就是普通的 TextView,问题可能不是透明状态栏导致的,而是其他因素。我没有小米设备所以也无法重现。

你这几天有什么进展么?

@hkq325800
Copy link
Author

在pl_base_pattern_activity.xml里面应该在最外面的LinearLayout中加入android:fitsSystemWindows="true"否则不然在android5.0版本以上不仅textView不显示下面的"取消"和"忘记图案"也会被某些机型的虚拟按键挡住

hkq325800 added a commit to ForPullRequest/PatternLock that referenced this issue Jun 15, 2016
@zhanghai
Copy link
Owner

zhanghai commented Jul 4, 2016

嗯……

我个人觉得,或许大家不应该使用 FLAG_TRANSLUCENT_STATUS?它不符合设计规范,也会强制全屏布局;虽然可以在这里加上 fitsSystemWindows,但是这样的话 StatusBar 和 NavigationBar 的背景也就只会是 windowBackground 加上那个 Scrim 了。在我的理解里,大多数应用的行为只需要是只为 5.0+ 使用 status/navigationBarColor 等开启着色就好了,5.0 以下则不实现。

基于这些原因我这段时间里一直不太愿意合并这个 PR(另一个原因是期末太忙没心情打这些以及很多其他的字QAQ)。当然如果你能说服我有这个必要,我也会很感谢地合并的。

@zhanghai zhanghai self-assigned this Jul 4, 2016
@hkq325800
Copy link
Author

Thanks for communicating,I have realized that I shouldn't use chinese on github
I doubt I can't convince you to use FLAG_TRANSLUCENT_STATUS,but I believe that anything existing is reasonable.
Besides,fitsSystemWindows has no harm to this project.
Besides besides,transparent navigation bar can be achieved on Android4.4 too,I have tried almost all ways to tint navigationBar, FLAG_TRANSLUCENT_STATUS is necessary to fit most Roms to complete this in China.

@zhanghai
Copy link
Owner

zhanghai commented Jul 5, 2016

Alright. But in general, something just being reasonable is not sufficient for its being correct.

In this case, if you use FLAG_TRANSLUCENT_STATUS, I would also recommend your doing more customization on the layout (for example for the color under the translucent status bar). A convenient approach provided by the build process is to simply drop in a (slightly modified) file named pl_base_pattern_activity.xml in your project's res/layout{,-land}/, and that will override the layout file from the library when merging resources.

So I'm not going to merge this PR but leave the work to be done by users with their own considerations for customization. Do you think it's ok?

@hkq325800
Copy link
Author

yes,thank you!

@zhanghai zhanghai closed this as completed Jul 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants