Quellcode durchsuchen

remove custom font

liukai vor 2 Jahren
Ursprung
Commit
f0a3ef6d01

BIN
cs_baselib/src/main/assets/SF-UI-Text/PingFang_Bold.ttf


BIN
cs_baselib/src/main/assets/SF-UI-Text/PingFang_Medium.ttf


+ 2 - 3
cs_baselib/src/main/java/com/guadou/lib_baselib/font_text_view/TextViewBold.java

@@ -1,7 +1,6 @@
 package com.guadou.lib_baselib.font_text_view;
 
 import android.content.Context;
-import android.graphics.Typeface;
 import android.util.AttributeSet;
 
 import androidx.annotation.Nullable;
@@ -28,7 +27,7 @@ public class TextViewBold extends AppCompatTextView {
     }
 
     private void applyCustomFont(Context context) {
-        Typeface customFont = FontCache.getTypeface("PingFang_Bold.ttf", context);
-        setTypeface(customFont);
+//        Typeface customFont = FontCache.getTypeface("PingFang_Bold.ttf", context);
+//        setTypeface(customFont);
     }
 }

+ 2 - 3
cs_baselib/src/main/java/com/guadou/lib_baselib/font_text_view/TextViewMedium.java

@@ -1,7 +1,6 @@
 package com.guadou.lib_baselib.font_text_view;
 
 import android.content.Context;
-import android.graphics.Typeface;
 import android.util.AttributeSet;
 
 import androidx.annotation.Nullable;
@@ -29,7 +28,7 @@ public class TextViewMedium extends AppCompatTextView {
     }
 
     private void applyCustomFont(Context context) {
-        Typeface customFont = FontCache.getTypeface("PingFang_Medium.ttf", context);
-        setTypeface(customFont);
+//        Typeface customFont = FontCache.getTypeface("PingFang_Medium.ttf", context);
+//        setTypeface(customFont);
     }
 }

+ 7 - 10
cs_baselib/src/main/java/com/guadou/lib_baselib/font_text_view/TypefaceUtil.java

@@ -1,8 +1,5 @@
 package com.guadou.lib_baselib.font_text_view;
 
-import android.content.Context;
-import android.graphics.Typeface;
-
 /**
  * Created by C02TVKSDHV27 on 02/08/2017.
  */
@@ -10,13 +7,13 @@ import android.graphics.Typeface;
 public class TypefaceUtil {
 
 
-    public static Typeface getSFMedium(Context context) {
-        return FontCache.getTypeface("PingFang_Medium.ttf", context);
-    }
-
-    public static Typeface getSFBold(Context context) {
-        return FontCache.getTypeface("PingFang_Bold.ttf", context);
-    }
+//    public static Typeface getSFMedium(Context context) {
+//        return FontCache.getTypeface("PingFang_Medium.ttf", context);
+//    }
+//
+//    public static Typeface getSFBold(Context context) {
+//        return FontCache.getTypeface("PingFang_Bold.ttf", context);
+//    }
 
 
 }

+ 7 - 8
cs_cptServices/src/main/java/com/guadou/cs_cptservices/binding/BindingTextView.kt

@@ -7,7 +7,6 @@ import android.text.Html
 import android.text.TextUtils
 import android.widget.TextView
 import androidx.databinding.BindingAdapter
-import com.guadou.lib_baselib.font_text_view.TypefaceUtil
 
 /**
  * 文本的设置
@@ -68,21 +67,21 @@ fun isCenterLine(textView: TextView, isUnderline: Boolean) {
  */
 @BindingAdapter("typefaceMedium")
 fun typefaceMedium(textView: TextView, boolean: Boolean) {
-    textView.typeface = TypefaceUtil.getSFMedium(textView.context)
+//    textView.typeface = TypefaceUtil.getSFMedium(textView.context)
 }
 
 @BindingAdapter("typefaceBold")
 fun typefaceSFBold(textView: TextView, boolean: Boolean) {
-    textView.typeface = TypefaceUtil.getSFBold(textView.context)
+//    textView.typeface = TypefaceUtil.getSFBold(textView.context)
 }
 
 @BindingAdapter("typefaceMediumOrBold")
 fun typefaceMediumOrBold(textView: TextView, boolean: Boolean) {
-    if (boolean) {  //true为粗体
-        textView.typeface = TypefaceUtil.getSFBold(textView.context)
-    } else {
-        textView.typeface = TypefaceUtil.getSFMedium(textView.context)
-    }
+//    if (boolean) {  //true为粗体
+//        textView.typeface = TypefaceUtil.getSFBold(textView.context)
+//    } else {
+//        textView.typeface = TypefaceUtil.getSFMedium(textView.context)
+//    }
 }
 
 /**