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

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,6 @@
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android { android {
compileSdkVersion 28 compileSdkVersion 28
defaultConfig { defaultConfig {
@ -17,6 +18,10 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
productFlavors { productFlavors {
} }
} }
@ -30,4 +35,5 @@ dependencies {
// Used for the list preference classes // Used for the list preference classes
implementation 'com.afollestad.material-dialogs:core:0.9.6.0' implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
implementation 'com.afollestad.material-dialogs:commons:0.9.6.0' implementation 'com.afollestad.material-dialogs:commons:0.9.6.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
} }

View file

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

View file

@ -1,11 +1,15 @@
package code.name.monkey.appthemehelper.util; package code.name.monkey.appthemehelper.util;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import androidx.annotation.ColorInt; import android.graphics.drawable.Drawable;
import androidx.annotation.NonNull;
import com.google.android.material.bottomnavigation.BottomNavigationView; import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.navigation.NavigationView; 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) * @author Karim Abou Zeid (kabouzeid)
*/ */
@ -25,6 +29,8 @@ public final class NavigationViewUtil {
selectedColor selectedColor
}); });
navigationView.setItemIconTintList(iconSl); 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) { 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"> tools:ignore="RtlSymmetry,UnusedAttribute">
<ImageView <ImageView
android:id="@+android:id/icon" android:id="@android:id/icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -40,7 +40,6 @@
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:ellipsize="marquee" android:ellipsize="marquee"
android:fadingEdge="horizontal" android:fadingEdge="horizontal"
android:fontFamily="sans-serif"
android:singleLine="true" android:singleLine="true"
android:textSize="@dimen/ate_default_textsize_subheading" android:textSize="@dimen/ate_default_textsize_subheading"
tools:text="Title" /> tools:text="Title" />
@ -53,7 +52,6 @@
android:layout_alignStart="@android:id/title" android:layout_alignStart="@android:id/title"
android:layout_below="@android:id/title" android:layout_below="@android:id/title"
android:layout_marginTop="2dp" android:layout_marginTop="2dp"
android:fontFamily="sans-serif"
android:maxLines="4" android:maxLines="4"
android:textSize="@dimen/ate_default_textsize_body" android:textSize="@dimen/ate_default_textsize_body"
tools:text="Summary" /> tools:text="Summary" />

View file

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