diff --git a/app/src/main/java/eu/faircode/email/ActivityBase.java b/app/src/main/java/eu/faircode/email/ActivityBase.java index 41f5c5fc13..558150be3b 100644 --- a/app/src/main/java/eu/faircode/email/ActivityBase.java +++ b/app/src/main/java/eu/faircode/email/ActivityBase.java @@ -155,7 +155,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc prefs.registerOnSharedPreferenceChangeListener(this); - int colorPrimaryDark = Helper.resolveColor(this, R.attr.colorPrimaryDark); + int colorPrimaryDark = Helper.resolveColor(this, androidx.appcompat.R.attr.colorPrimaryDark); try { Drawable d = getDrawable(R.drawable.baseline_mail_24); @@ -895,7 +895,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc } public void showActionBar(boolean show) { - ViewGroup abv = findViewById(R.id.action_bar); + ViewGroup abv = findViewById(androidx.appcompat.R.id.action_bar); if (abv == null) return; diff --git a/app/src/main/java/eu/faircode/email/AdapterAttachment.java b/app/src/main/java/eu/faircode/email/AdapterAttachment.java index 7c3677ecb9..49df94bd23 100644 --- a/app/src/main/java/eu/faircode/email/AdapterAttachment.java +++ b/app/src/main/java/eu/faircode/email/AdapterAttachment.java @@ -212,7 +212,7 @@ public class AdapterAttachment extends RecyclerView.Adapter contributors = Contributor.loadContributors(context); for (Contributor contributor : contributors) { diff --git a/app/src/main/java/eu/faircode/email/FragmentAccounts.java b/app/src/main/java/eu/faircode/email/FragmentAccounts.java index 80832a628a..df3288147e 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccounts.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccounts.java @@ -116,7 +116,7 @@ public class FragmentAccounts extends FragmentBase { // Wire controls - int colorPrimary = Helper.resolveColor(getContext(), R.attr.colorPrimary); + int colorPrimary = Helper.resolveColor(getContext(), androidx.appcompat.R.attr.colorPrimary); swipeRefresh.setColorSchemeColors(Color.WHITE, Color.WHITE, Color.WHITE); swipeRefresh.setProgressBackgroundColorSchemeColor(colorPrimary); swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index aba35ec9a2..3745c0a864 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -7384,7 +7384,7 @@ public class FragmentCompose extends FragmentBase { final long id = args.getLong("id"); final boolean show_images = args.getBoolean("show_images", false); - int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary); + int colorPrimary = Helper.resolveColor(context, androidx.appcompat.R.attr.colorPrimary); final int colorBlockquote = Helper.resolveColor(context, R.attr.colorBlockquote, colorPrimary); int quoteGap = context.getResources().getDimensionPixelSize(R.dimen.quote_gap_size); int quoteStripe = context.getResources().getDimensionPixelSize(R.dimen.quote_stripe_width); @@ -7726,7 +7726,7 @@ public class FragmentCompose extends FragmentBase { if (identity != null && nav_color) { Integer color = (identity.color == null ? identity.accountColor : identity.color); bottom_navigation.setBackgroundColor(color == null - ? Helper.resolveColor(context, R.attr.colorPrimary) : color); + ? Helper.resolveColor(context, androidx.appcompat.R.attr.colorPrimary) : color); } Spanned signature = null; diff --git a/app/src/main/java/eu/faircode/email/FragmentDialogAsk.java b/app/src/main/java/eu/faircode/email/FragmentDialogAsk.java index e55bc2d292..72be9baf7c 100644 --- a/app/src/main/java/eu/faircode/email/FragmentDialogAsk.java +++ b/app/src/main/java/eu/faircode/email/FragmentDialogAsk.java @@ -53,7 +53,7 @@ public class FragmentDialogAsk extends FragmentDialogBase { int faq = args.getInt("faq"); final Context context = getContext(); - final int colorError = Helper.resolveColor(context, R.attr.colorError); + final int colorError = Helper.resolveColor(context, androidx.appcompat.R.attr.colorError); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); diff --git a/app/src/main/java/eu/faircode/email/FragmentFolders.java b/app/src/main/java/eu/faircode/email/FragmentFolders.java index 6492cd8678..bc331a4349 100644 --- a/app/src/main/java/eu/faircode/email/FragmentFolders.java +++ b/app/src/main/java/eu/faircode/email/FragmentFolders.java @@ -184,7 +184,7 @@ public class FragmentFolders extends FragmentBase { final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); - int colorPrimary = Helper.resolveColor(getContext(), R.attr.colorPrimary); + int colorPrimary = Helper.resolveColor(getContext(), androidx.appcompat.R.attr.colorPrimary); swipeRefresh.setColorSchemeColors(Color.WHITE, Color.WHITE, Color.WHITE); swipeRefresh.setProgressBackgroundColorSchemeColor(colorPrimary); swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 5ff560101d..d76339c9b7 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -506,8 +506,8 @@ public class FragmentMessages extends FragmentBase swipe_reply = prefs.getBoolean("swipe_reply", false); quick_actions = prefs.getBoolean("quick_actions", true); - colorPrimary = Helper.resolveColor(getContext(), R.attr.colorPrimary); - colorAccent = Helper.resolveColor(getContext(), R.attr.colorAccent); + colorPrimary = Helper.resolveColor(getContext(), androidx.appcompat.R.attr.colorPrimary); + colorAccent = Helper.resolveColor(getContext(), androidx.appcompat.R.attr.colorAccent); colorSeparator = Helper.resolveColor(getContext(), R.attr.colorSeparator); colorWarning = Helper.resolveColor(getContext(), R.attr.colorWarning); @@ -5642,7 +5642,7 @@ public class FragmentMessages extends FragmentBase boolean filter_active = (filter_seen || filter_unflagged || filter_unknown || (language_detection && !TextUtils.isEmpty(filter_language))); - int filterColor = Helper.resolveColor(context, R.attr.colorAccent); + int filterColor = Helper.resolveColor(context, androidx.appcompat.R.attr.colorAccent); float filterLighten = 0.7f - (float) ColorUtils.calculateLuminance(filterColor); if (filterLighten > 0) filterColor = ColorUtils.blendARGB(filterColor, Color.WHITE, filterLighten); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptions.java b/app/src/main/java/eu/faircode/email/FragmentOptions.java index ba4b04ba85..5821329464 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptions.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptions.java @@ -241,7 +241,7 @@ public class FragmentOptions extends FragmentBase { tabLayout.setupWithViewPager(pager); final Context context = getContext(); - int colorAccent = Helper.resolveColor(context, R.attr.colorAccent); + int colorAccent = Helper.resolveColor(context, androidx.appcompat.R.attr.colorAccent); for (int i = 0; i < tabLayout.getTabCount(); i++) { Drawable d = ContextCompat.getDrawable(context, PAGE_ICONS[i]); d.setColorFilter(colorAccent, PorterDuff.Mode.SRC_ATOP); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java index d3a9f62081..ce3a52394e 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java @@ -663,7 +663,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { prefs.edit().putBoolean("navbar_colorize", checked).apply(); setNavigationBarColor( - checked ? Helper.resolveColor(getContext(), R.attr.colorPrimaryDark) : Color.BLACK); + checked ? Helper.resolveColor(getContext(), androidx.appcompat.R.attr.colorPrimaryDark) : Color.BLACK); } }); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java b/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java index 9a6b1f2280..493954c684 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java @@ -139,7 +139,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr final Context context = getContext(); this.textColorTertiary = Helper.resolveColor(context, android.R.attr.textColorTertiary); - this.colorAccent = Helper.resolveColor(context, R.attr.colorAccent); + this.colorAccent = Helper.resolveColor(context, androidx.appcompat.R.attr.colorAccent); } @Override diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index 7beab082dc..b4839c9816 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -876,7 +876,7 @@ public class Helper { if (color == null) { //window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); - window.setStatusBarColor(Helper.resolveColor(window.getContext(), R.attr.colorPrimaryDark)); + window.setStatusBarColor(Helper.resolveColor(window.getContext(), androidx.appcompat.R.attr.colorPrimaryDark)); } else { //window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); //window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); @@ -1108,8 +1108,8 @@ public class Helper { } } else { boolean navbar_colorize = prefs.getBoolean("navbar_colorize", false); - int colorPrimary = resolveColor(context, R.attr.colorPrimary); - int colorPrimaryDark = resolveColor(context, R.attr.colorPrimaryDark); + int colorPrimary = resolveColor(context, androidx.appcompat.R.attr.colorPrimary); + int colorPrimaryDark = resolveColor(context, androidx.appcompat.R.attr.colorPrimaryDark); CustomTabColorSchemeParams.Builder schemes = new CustomTabColorSchemeParams.Builder() .setToolbarColor(colorPrimary) @@ -1792,13 +1792,13 @@ public class Helper { try { if (zoom == 0) ta = context.obtainStyledAttributes( - R.style.TextAppearance_AppCompat_Small, new int[]{android.R.attr.textSize}); + androidx.appcompat.R.style.TextAppearance_AppCompat_Small, new int[]{android.R.attr.textSize}); else if (zoom == 2) ta = context.obtainStyledAttributes( - R.style.TextAppearance_AppCompat_Large, new int[]{android.R.attr.textSize}); + androidx.appcompat.R.style.TextAppearance_AppCompat_Large, new int[]{android.R.attr.textSize}); else ta = context.obtainStyledAttributes( - R.style.TextAppearance_AppCompat_Medium, new int[]{android.R.attr.textSize}); + androidx.appcompat.R.style.TextAppearance_AppCompat_Medium, new int[]{android.R.attr.textSize}); return ta.getDimension(0, 0); } finally { if (ta != null) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index d77af26a44..bdf306fd7e 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -479,7 +479,7 @@ public class HtmlHelper { int textSizeSmall; TypedArray ta = context.obtainStyledAttributes( - R.style.TextAppearance_AppCompat_Small, new int[]{android.R.attr.textSize}); + androidx.appcompat.R.style.TextAppearance_AppCompat_Small, new int[]{android.R.attr.textSize}); if (ta == null) textSizeSmall = Helper.dp2pixels(context, 6); else { @@ -3119,8 +3119,8 @@ public class HtmlHelper { boolean debug = prefs.getBoolean("debug", false); boolean monospaced_pre = prefs.getBoolean("monospaced_pre", false); - final int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary); - final int colorAccent = Helper.resolveColor(context, R.attr.colorAccent); + final int colorPrimary = Helper.resolveColor(context, androidx.appcompat.R.attr.colorPrimary); + final int colorAccent = Helper.resolveColor(context, androidx.appcompat.R.attr.colorAccent); final int colorBlockquote = Helper.resolveColor(context, R.attr.colorBlockquote, colorPrimary); final int colorSeparator = Helper.resolveColor(context, R.attr.colorSeparator); int bulletGap = context.getResources().getDimensionPixelSize(R.dimen.bullet_gap_size); diff --git a/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java b/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java index be7803e04d..8091820f8f 100644 --- a/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java +++ b/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java @@ -123,7 +123,7 @@ public class PopupMenuLifecycle extends PopupMenu { icon = new ColorDrawable(Color.TRANSPARENT); else { icon = icon.getConstantState().newDrawable().mutate(); - int color = Helper.resolveColor(context, R.attr.colorAccent); + int color = Helper.resolveColor(context, androidx.appcompat.R.attr.colorAccent); icon.setTint(color); if (!menuItem.isEnabled()) icon.setAlpha(Math.round(Helper.LOW_LIGHT * 255)); diff --git a/app/src/main/java/eu/faircode/email/StyleHelper.java b/app/src/main/java/eu/faircode/email/StyleHelper.java index 1f8ec10d38..9da7674a63 100644 --- a/app/src/main/java/eu/faircode/email/StyleHelper.java +++ b/app/src/main/java/eu/faircode/email/StyleHelper.java @@ -972,7 +972,7 @@ public class StyleHelper { Context context = etBody.getContext(); Editable edit = etBody.getText(); - int colorAccent = Helper.resolveColor(context, R.attr.colorAccent); + int colorAccent = Helper.resolveColor(context, androidx.appcompat.R.attr.colorAccent); int bulletGap = context.getResources().getDimensionPixelSize(R.dimen.bullet_gap_size); int bulletRadius = context.getResources().getDimensionPixelSize(R.dimen.bullet_radius_size); int bulletIndent = context.getResources().getDimensionPixelSize(R.dimen.bullet_indent_size); @@ -1104,7 +1104,7 @@ public class StyleHelper { Context context = etBody.getContext(); Editable edit = etBody.getText(); - int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary); + int colorPrimary = Helper.resolveColor(context, androidx.appcompat.R.attr.colorPrimary); final int colorBlockquote = Helper.resolveColor(context, R.attr.colorBlockquote, colorPrimary); int quoteGap = context.getResources().getDimensionPixelSize(R.dimen.quote_gap_size); int quoteStripe = context.getResources().getDimensionPixelSize(R.dimen.quote_stripe_width); @@ -1671,13 +1671,13 @@ public class StyleHelper { NumberSpan n = (NumberSpan) span; int bulletGap = context.getResources().getDimensionPixelSize(R.dimen.bullet_gap_size); int bulletIndent = context.getResources().getDimensionPixelSize(R.dimen.bullet_indent_size); - int colorAccent = Helper.resolveColor(context, R.attr.colorAccent); + int colorAccent = Helper.resolveColor(context, androidx.appcompat.R.attr.colorAccent); return (T) new NumberSpan(bulletIndent, bulletGap, colorAccent, n.getTextSize(), n.getLevel(), n.getIndex() + 1); } else if (BulletSpanEx.class.isAssignableFrom(type)) { BulletSpanEx b = (BulletSpanEx) span; int bulletIndent = context.getResources().getDimensionPixelSize(R.dimen.bullet_indent_size); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { - int colorAccent = Helper.resolveColor(context, R.attr.colorAccent); + int colorAccent = Helper.resolveColor(context, androidx.appcompat.R.attr.colorAccent); int bulletGap = context.getResources().getDimensionPixelSize(R.dimen.bullet_gap_size); return (T) new BulletSpanEx(bulletIndent, bulletGap, colorAccent, b.getLevel()); } else @@ -1705,7 +1705,7 @@ public class StyleHelper { static void renumber(Editable text, boolean clean, Context context) { int bulletGap = context.getResources().getDimensionPixelSize(R.dimen.bullet_gap_size); int bulletIndent = context.getResources().getDimensionPixelSize(R.dimen.bullet_indent_size); - int colorAccent = Helper.resolveColor(context, R.attr.colorAccent); + int colorAccent = Helper.resolveColor(context, androidx.appcompat.R.attr.colorAccent); Log.i("Renumber clean=" + clean + " text=" + text); diff --git a/app/src/main/java/eu/faircode/email/TextViewAutoCompleteAction.java b/app/src/main/java/eu/faircode/email/TextViewAutoCompleteAction.java index bc3d2f48c8..dbc757d61e 100644 --- a/app/src/main/java/eu/faircode/email/TextViewAutoCompleteAction.java +++ b/app/src/main/java/eu/faircode/email/TextViewAutoCompleteAction.java @@ -59,7 +59,7 @@ public class TextViewAutoCompleteAction extends AppCompatAutoCompleteTextView { TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TextViewAutoCompleteAction, 0, 0); drawable = a.getDrawable(R.styleable.TextViewAutoCompleteAction_end_drawable); } - int colorControlNormal = Helper.resolveColor(context, R.attr.colorControlNormal); + int colorControlNormal = Helper.resolveColor(context, androidx.appcompat.R.attr.colorControlNormal); drawable.setTint(colorControlNormal); drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); diff --git a/gradle.properties b/gradle.properties index a18b3ae678..549976dbc4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,5 +17,5 @@ org.gradle.warning.mode=all android.useAndroidX=true android.enableJetifier=false android.defaults.buildfeatures.buildconfig=true -android.nonTransitiveRClass=false +android.nonTransitiveRClass=true android.nonFinalResIds=false