From b17b9aa59bae6d03055f14d937821655dfaffa1f Mon Sep 17 00:00:00 2001 From: Linjiajia <319408893@qq.com> Date: 星期一, 29 一月 2024 23:27:08 +0800 Subject: [PATCH] 1、调整成长经历页面\n2、删除婚姻个人信息 --- app/src/main/java/com/application/zhangshi_app_android/other/MyTitleBarStyle.java | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/application/zhangshi_app_android/other/MyTitleBarStyle.java b/app/src/main/java/com/application/zhangshi_app_android/other/MyTitleBarStyle.java index a5246a7..5d873b9 100644 --- a/app/src/main/java/com/application/zhangshi_app_android/other/MyTitleBarStyle.java +++ b/app/src/main/java/com/application/zhangshi_app_android/other/MyTitleBarStyle.java @@ -2,14 +2,13 @@ import android.content.Context; import android.content.res.ColorStateList; +import android.graphics.Typeface; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.util.TypedValue; -import android.widget.TextView; import androidx.appcompat.content.res.AppCompatResources; -import com.android.app_base.utils.ScreenSizeUtils; import com.application.zhangshi_app_android.R; import com.hjq.bar.style.CommonBarStyle; @@ -19,14 +18,28 @@ * @desc TitleBar缁熶竴鏍峰紡 */ public class MyTitleBarStyle extends CommonBarStyle { + @Override - public TextView createLeftView(Context context) { - return super.createLeftView(context); + public Typeface getTitleTypeface(Context context, int style) { + return Typeface.createFromAsset(context.getAssets(), "roboto_regular.ttf"); + } + + @Override + public Typeface getLeftTitleTypeface(Context context, int style) { + return Typeface.createFromAsset(context.getAssets(), "roboto_regular.ttf"); + } + + @Override + public Typeface getRightTitleTypeface(Context context, int style) { + return Typeface.createFromAsset(context.getAssets(), "roboto_regular.ttf"); } @Override public Drawable getTitleBarBackground(Context context) { - return new ColorDrawable(context.getColor(R.color.color_title_bar_background)); + //鏍规嵁褰撳墠涓婚鑾峰彇涓嶅悓鐨勮儗鏅鑹� + TypedValue typedValue = new TypedValue(); + context.getTheme().resolveAttribute(R.attr.titleBarBackgroundColor, typedValue, true); + return new ColorDrawable(typedValue.data); } @Override @@ -79,4 +92,6 @@ return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 16, context.getResources().getDisplayMetrics()); } + + } -- Gitblit v1.9.1