font compatible

main
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: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
@ -17,6 +18,10 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
productFlavors {
}
}
@ -30,4 +35,5 @@ dependencies {
// Used for the list preference classes
implementation 'com.afollestad.material-dialogs:core: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);
}
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" />