Make sure B/W toast is properly visible

pull/193/head 1.1463
M66B 4 years ago
parent 7a935105c4
commit 16c1a2f778

@ -21,7 +21,6 @@ package eu.faircode.email;
import android.content.Context; import android.content.Context;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Color;
import android.os.Looper; import android.os.Looper;
import android.view.Gravity; import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -68,10 +67,10 @@ public class ToastEx extends Toast {
ToastEx toast = new ToastEx(context); ToastEx toast = new ToastEx(context);
LayoutInflater inflater = LayoutInflater.from(context); LayoutInflater inflater = LayoutInflater.from(context);
View view = inflater.inflate(R.layout.toast, null); View view = inflater.inflate(R.layout.toast, null);
view.setBackground(context.getDrawable(android.R.drawable.toast_frame)); view.setBackgroundColor(Helper.resolveColor(context, android.R.attr.textColorPrimary));
TextView tv = view.findViewById(android.R.id.message); TextView tv = view.findViewById(android.R.id.message);
tv.setTextColor(Color.parseColor("#de000000")); // primary_text_default_material_light tv.setTextColor(Helper.resolveColor(context, android.R.attr.textColorPrimaryInverse)); // primary_text_default_material_light
tv.setText(text); tv.setText(text);
toast.setView(view); toast.setView(view);
toast.setDuration(duration); toast.setDuration(duration);

Loading…
Cancel
Save