Skip to content

Commit

Permalink
Set uCrop status bar color based on SDK version
Browse files Browse the repository at this point in the history
  • Loading branch information
nbradbury committed Jan 21, 2025
1 parent 478af96 commit 42e2169
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,10 @@ class MySiteFragment : Fragment(R.layout.my_site_fragment),
val context = activity ?: return
val options = UCrop.Options()
options.setShowCropGrid(false)
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.VANILLA_ICE_CREAM) {
@Suppress("DEPRECATION")
options.setStatusBarColor(context.getColorFromAttribute(android.R.attr.statusBarColor))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
options.setStatusBarColor(com.google.android.material.R.attr.colorSurface)
} else {
options.setStatusBarColor(com.google.android.material.R.attr.colorOnSurface)
}
options.setToolbarColor(context.getColorFromAttribute(R.attr.wpColorAppBar))
options.setToolbarWidgetColor(context.getColorFromAttribute(com.google.android.material.R.attr.colorOnSurface))
Expand Down

0 comments on commit 42e2169

Please sign in to comment.