Yalantis / uCrop

Image Cropping Library for Android
https://yalantis.com/blog/introducing-ucrop-our-own-image-cropping-library-for-android/
11.89k stars 2.16k forks source link

set EXTRA_STATUS_BAR_COLOR not working #153

Closed xuetenglong closed 7 years ago

xuetenglong commented 8 years ago

android version 5.0.1 UCrop uCrop = UCrop.of(uri1, uri2); uCrop.getIntent(this).putExtra(UCrop.Options.EXTRA_TOOL_BAR_COLOR, ContextCompat.getColor(this, cn.com.jinyinmao.common.R.color.mis_actionbar_color)); uCrop.getIntent(this).putExtra(UCrop.Options.EXTRA_STATUS_BAR_COLOR, ContextCompat.getColor(this, cn.com.jinyinmao.common.R.color.mis_actionbar_color));

statusbar color not change

xuetenglong commented 8 years ago

Mobile phone : Redmi Note2

xuetenglong commented 8 years ago

private void setStatusBarColor(@ColorInt int color) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (getWindow() != null) { getWindow().setStatusBarColor(color); } } }

See the source code should add getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);

shliama commented 8 years ago

@longerxue Hello and thanks for the reported issue. I'll take a look at this problem and add a fix in the next update.

shliama commented 8 years ago

I've added FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS to the current build, it will be available with the next library update very soon.

shliama commented 8 years ago

Please check the latest uCrop version :octocat: Now you can choose between:

Lightweight general solution
compile 'com.yalantis:ucrop:2.2.0' 
Get power of the native code to preserve image quality (+ about 1.5 MB to an apk size)
compile 'com.yalantis:ucrop:2.2.0-native'
TeeRawk commented 7 years ago

resolved