font compatible

This commit is contained in:
h4h13 2018-12-05 21:05:22 +05:30
parent 567cf0781f
commit d5f63b91ac
8 changed files with 86 additions and 55 deletions

View file

@ -35,9 +35,6 @@ public class MaterialUtil {
button.setIconTint(colorState);
}
Typeface font = ResourcesCompat.getFont(button.getContext(), R.font.product_sans);
button.setTypeface(font);
}
public static void setTint(TextInputLayout textInputLayout, boolean background) {

View file

@ -1,11 +1,15 @@
package code.name.monkey.appthemehelper.util;
import android.content.res.ColorStateList;
import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import android.graphics.drawable.Drawable;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.navigation.NavigationView;
import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import code.name.monkey.appthemehelper.ThemeStore;
/**
* @author Karim Abou Zeid (kabouzeid)
*/
@ -25,6 +29,8 @@ public final class NavigationViewUtil {
selectedColor
});
navigationView.setItemIconTintList(iconSl);
Drawable drawable = navigationView.getItemBackground();
navigationView.setItemBackground(TintHelper.createTintedDrawable(drawable, ColorUtil.withAlpha(ThemeStore.accentColor(navigationView.getContext()), 0.2f)));
}
public static void setItemTextColors(@NonNull NavigationView navigationView, @ColorInt int normalColor, @ColorInt int selectedColor) {

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
<font
android:font="@font/products_sans_regular"
android:fontStyle="normal"
android:fontWeight="400" />
</font-family>

View file

@ -12,7 +12,7 @@
tools:ignore="RtlSymmetry,UnusedAttribute">
<ImageView
android:id="@+android:id/icon"
android:id="@android:id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@ -40,7 +40,6 @@
android:layout_alignParentStart="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:fontFamily="sans-serif"
android:singleLine="true"
android:textSize="@dimen/ate_default_textsize_subheading"
tools:text="Title" />
@ -53,7 +52,6 @@
android:layout_alignStart="@android:id/title"
android:layout_below="@android:id/title"
android:layout_marginTop="2dp"
android:fontFamily="sans-serif"
android:maxLines="4"
android:textSize="@dimen/ate_default_textsize_body"
tools:text="Summary" />

View file

@ -13,7 +13,7 @@
tools:ignore="RtlSymmetry,UnusedAttribute">
<ImageView
android:id="@+android:id/icon"
android:id="@android:id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@ -41,7 +41,6 @@
android:layout_alignParentStart="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:fontFamily="sans-serif"
android:singleLine="true"
android:textSize="@dimen/ate_default_textsize_subheading"
tools:text="Title" />
@ -54,7 +53,6 @@
android:layout_alignStart="@android:id/title"
android:layout_below="@android:id/title"
android:layout_marginTop="2dp"
android:fontFamily="sans-serif"
android:maxLines="4"
android:textSize="@dimen/ate_default_textsize_body"
tools:text="Summary" />