mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-29 17:11:12 +01:00
Revised operation handling
This commit is contained in:
@@ -21,6 +21,9 @@ package eu.faircode.email;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.ColorMatrix;
|
||||
import android.graphics.ColorMatrixColorFilter;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -29,6 +32,8 @@ import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public class Helper {
|
||||
static final String TAG = BuildConfig.APPLICATION_ID;
|
||||
|
||||
@@ -40,6 +45,16 @@ public class Helper {
|
||||
return color;
|
||||
}
|
||||
|
||||
static Drawable toDimmed(@NonNull Drawable drawable) {
|
||||
ColorMatrix matrix = new ColorMatrix();
|
||||
matrix.setSaturation(0);
|
||||
ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrix);
|
||||
Drawable mutated = drawable.mutate();
|
||||
mutated.setColorFilter(filter);
|
||||
mutated.setAlpha(128);
|
||||
return mutated;
|
||||
}
|
||||
|
||||
static String localizeFolderName(Context context, String name) {
|
||||
if ("INBOX".equals(name))
|
||||
return context.getString(R.string.title_folder_inbox);
|
||||
|
||||
Reference in New Issue
Block a user