mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 03:46:00 +01:00
Added Gmail label colors
This commit is contained in:
@@ -21,6 +21,7 @@ package eu.faircode.email;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.sqlite.SQLiteConstraintException;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
@@ -44,6 +45,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
@@ -658,8 +660,19 @@ public class FragmentFolder extends FragmentBase {
|
||||
ask.setArguments(aargs);
|
||||
ask.setTargetFragment(FragmentFolder.this, REQUEST_SAVE_CHANGES);
|
||||
ask.show(getParentFragmentManager(), "folder:save");
|
||||
} else if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||
} else if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
|
||||
String name = args.getString("name");
|
||||
Integer color = args.getInt("color");
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
String key = "label.color." + name;
|
||||
if (color == Color.TRANSPARENT)
|
||||
prefs.edit().remove(key).apply();
|
||||
else
|
||||
prefs.edit().putInt(key, color).apply();
|
||||
|
||||
getParentFragmentManager().popBackStack();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user