mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-28 16:40:53 +01:00
Allow semi transparent widget color
This commit is contained in:
@@ -49,11 +49,14 @@ public class WidgetSync extends AppWidgetProvider {
|
||||
views.setOnClickPendingIntent(R.id.ivSync, pi);
|
||||
views.setImageViewResource(R.id.ivSync, enabled ? R.drawable.twotone_sync_24 : R.drawable.twotone_sync_disabled_24);
|
||||
|
||||
if (!semi)
|
||||
if (background != Color.TRANSPARENT) {
|
||||
float lum = (float) ColorUtils.calculateLuminance(background);
|
||||
|
||||
if (semi)
|
||||
background = ColorUtils.setAlphaComponent(background, 127);
|
||||
|
||||
views.setInt(R.id.widget, "setBackgroundColor", background);
|
||||
|
||||
if (!semi && background != Color.TRANSPARENT) {
|
||||
float lum = (float) ColorUtils.calculateLuminance(background);
|
||||
if (lum > 0.7f)
|
||||
views.setInt(R.id.ivSync, "setColorFilter", Color.BLACK);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user