App shortcut fixed

This commit is contained in:
h4h13 2018-12-25 20:28:47 +05:30
parent 1425bfe612
commit 0b6f043995
181 changed files with 1616 additions and 2052 deletions

View file

@ -2,14 +2,12 @@ package code.name.monkey.appthemehelper.util;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Typeface;
import androidx.annotation.NonNull;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.textfield.TextInputLayout;
import androidx.annotation.NonNull;
import androidx.core.content.res.ResourcesCompat;
import code.name.monkey.appthemehelper.R;
import code.name.monkey.appthemehelper.ThemeStore;
public class MaterialUtil {
@ -17,6 +15,16 @@ public class MaterialUtil {
setTint(button, background, ThemeStore.accentColor(button.getContext()));
}
public static void setTint(@NonNull MaterialButton button) {
setTint(button, ThemeStore.accentColor(button.getContext()));
}
private static void setTint(MaterialButton button, int accentColor) {
final Context context = button.getContext();
final ColorStateList textColor = ColorStateList.valueOf(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(accentColor)));
button.setTextColor(textColor);
}
public static void setTint(@NonNull MaterialButton button, boolean background, int color) {
//button.setPadding(48, 48, 48, 48);
button.setAllCaps(false);

View file

@ -18,10 +18,6 @@ import android.widget.SeekBar;
import android.widget.Switch;
import android.widget.TextView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.lang.reflect.Field;
import androidx.annotation.CheckResult;
import androidx.annotation.ColorInt;
import androidx.annotation.DrawableRes;
@ -31,6 +27,11 @@ import androidx.appcompat.widget.AppCompatEditText;
import androidx.appcompat.widget.SwitchCompat;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.lang.reflect.Field;
import code.name.monkey.appthemehelper.R;
/**
@ -209,8 +210,7 @@ public final class TintHelper {
}
public static void setTint(@NonNull SeekBar seekBar, @ColorInt int color, boolean useDarker) {
final ColorStateList s1 = getDisabledColorStateList(color,
ContextCompat.getColor(seekBar.getContext(), useDarker ? R.color.ate_control_disabled_dark : R.color.ate_control_disabled_light));
final ColorStateList s1 = getDisabledColorStateList(color, ContextCompat.getColor(seekBar.getContext(), useDarker ? R.color.ate_control_disabled_dark : R.color.ate_control_disabled_light));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
seekBar.setThumbTintList(s1);
seekBar.setProgressTintList(s1);