diff --git a/app/src/main/java/eu/faircode/email/AdapterLog.java b/app/src/main/java/eu/faircode/email/AdapterLog.java index fd579b33c7..2d639fc348 100644 --- a/app/src/main/java/eu/faircode/email/AdapterLog.java +++ b/app/src/main/java/eu/faircode/email/AdapterLog.java @@ -20,16 +20,15 @@ package eu.faircode.email; */ import android.content.Context; -import android.graphics.Typeface; import android.text.SpannableStringBuilder; import android.text.style.ForegroundColorSpan; -import android.text.style.StyleSpan; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.lifecycle.Lifecycle; import androidx.lifecycle.LifecycleObserver; @@ -50,8 +49,14 @@ public class AdapterLog extends RecyclerView.Adapter { private LayoutInflater inflater; private int textColorSecondary; - private int colorAccent; - private int colorWarning; + private int solarizedYellow; + private int solarizedOrange; + private int solarizedRed; + private int solarizedMagenta; + private int solarizedViolet; + private int solarizedBlue; + private int solarizedCyan; + private int solarizedGreen; private Long account = null; private Long folder = null; @@ -80,20 +85,28 @@ public class AdapterLog extends RecyclerView.Adapter { case General: break; case Statistics: - ssb.setSpan(new StyleSpan(Typeface.ITALIC), 0, ssb.length(), 0); + ssb.setSpan(new ForegroundColorSpan(solarizedGreen), 0, ssb.length(), 0); break; case Scheduling: - case Account: - ssb.setSpan(new ForegroundColorSpan(colorWarning), 0, ssb.length(), 0); + ssb.setSpan(new ForegroundColorSpan(solarizedYellow), 0, ssb.length(), 0); break; case Network: + ssb.setSpan(new ForegroundColorSpan(solarizedOrange), 0, ssb.length(), 0); + break; + case Account: + ssb.setSpan(new ForegroundColorSpan(solarizedMagenta), 0, ssb.length(), 0); + break; case Protocol: ssb.setSpan(new ForegroundColorSpan(textColorSecondary), 0, ssb.length(), 0); break; case Classification: + ssb.setSpan(new ForegroundColorSpan(solarizedViolet), 0, ssb.length(), 0); + break; case Notification: + ssb.setSpan(new ForegroundColorSpan(solarizedBlue), 0, ssb.length(), 0); + break; case Rules: - ssb.setSpan(new ForegroundColorSpan(colorAccent), 0, ssb.length(), 0); + ssb.setSpan(new ForegroundColorSpan(solarizedCyan), 0, ssb.length(), 0); break; } tvData.setText(ssb); @@ -107,8 +120,14 @@ public class AdapterLog extends RecyclerView.Adapter { this.inflater = LayoutInflater.from(parentFragment.getContext()); this.textColorSecondary = Helper.resolveColor(context, android.R.attr.textColorSecondary); - this.colorAccent = Helper.resolveColor(context, R.attr.colorAccent); - this.colorWarning = Helper.resolveColor(context, R.attr.colorWarning); + this.solarizedYellow = ContextCompat.getColor(context, R.color.solarizedYellow); + this.solarizedOrange = ContextCompat.getColor(context, R.color.solarizedOrange); + this.solarizedRed = ContextCompat.getColor(context, R.color.solarizedRed); + this.solarizedMagenta = ContextCompat.getColor(context, R.color.solarizedMagenta); + this.solarizedViolet = ContextCompat.getColor(context, R.color.solarizedViolet); + this.solarizedBlue = ContextCompat.getColor(context, R.color.solarizedBlue); + this.solarizedCyan = ContextCompat.getColor(context, R.color.solarizedCyan); + this.solarizedGreen = ContextCompat.getColor(context, R.color.solarizedGreen); this.TF = Helper.getTimeInstance(context); diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index f3aa9dceeb..d1af2b4995 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -152,4 +152,13 @@ #ff7f7f7f #ffff0000 #00000000 + + #b58900 + #cb4b16 + #d33682 + #dc322f + #6c71c4 + #268bd2 + #2aa198 + #859900