From b5f41184da81054f3c0cc7b193c733ce5d937bbb Mon Sep 17 00:00:00 2001 From: yangyakun Date: Tue, 22 Nov 2022 21:35:22 +0800 Subject: [PATCH] =?UTF-8?q?TextView=20setTextSize=20=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E4=BC=A0=E9=80=92=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/och/taxi/ui/TaxiPersonalDialogFragment.java | 5 +++-- .../java/com/mogo/och/taxi/ui/TaxiServerOrdersFragment.java | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiPersonalDialogFragment.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiPersonalDialogFragment.java index 277a26fc8c..137ff803fa 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiPersonalDialogFragment.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiPersonalDialogFragment.java @@ -7,6 +7,7 @@ import android.graphics.Point; import android.graphics.Typeface; import android.os.Build; import android.os.Bundle; +import android.util.TypedValue; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; @@ -219,13 +220,13 @@ public class TaxiPersonalDialogFragment extends TextView textView = (TextView) tab.getCustomView().findViewById(R.id.operation_tab_title); ImageView imageView = (ImageView) tab.getCustomView().findViewById(R.id.operation_tab_line_iv); if (isSelected){ - textView.setTextSize(AutoSizeUtils.dp2px(getContext(),46)); + textView.setTextSize(TypedValue.COMPLEX_UNIT_PX,AutoSizeUtils.dp2px(getContext(),46)); CallerLogger.INSTANCE.d(M_TAXI + TAG,"SelectTv = "+ textView.getText()); textView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); textView.setTextColor(Color.parseColor("#FFFFFF")); imageView.setImageDrawable(getResources().getDrawable(R.drawable.taxi_driver_operation_tab_line)); }else { - textView.setTextSize(AutoSizeUtils.dp2px(getContext(),40)); + textView.setTextSize(TypedValue.COMPLEX_UNIT_PX,AutoSizeUtils.dp2px(getContext(),40)); CallerLogger.INSTANCE.d(M_TAXI + TAG,"unSelectTv = "+ textView.getText()); textView.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL)); textView.setTextColor(Color.parseColor("#A7B6F0")); diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiServerOrdersFragment.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiServerOrdersFragment.java index 05bd955236..91007e4705 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiServerOrdersFragment.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiServerOrdersFragment.java @@ -6,6 +6,7 @@ import android.graphics.Color; import android.graphics.Typeface; import android.os.Build; import android.os.Bundle; +import android.util.TypedValue; import android.view.View; import android.widget.TextView; @@ -27,6 +28,7 @@ import com.mogo.och.taxi.bean.OrderQueryRouteInfoRespBean; import java.util.ArrayList; import java.util.List; +import me.jessyan.autosize.AutoSize; import me.jessyan.autosize.utils.AutoSizeUtils; /** @@ -136,13 +138,13 @@ public class TaxiServerOrdersFragment extends BaseTaxiUIFragment { TextView textView = (TextView) tab.getCustomView().findViewById(R.id.tab_title); if (isSelected){ textView.setBackground(getActivity().getDrawable(R.drawable.taxi_driver_tab_item_bg)); - textView.setTextSize(AutoSizeUtils.dp2px(getContext(),40)); + textView.setTextSize(TypedValue.COMPLEX_UNIT_PX,AutoSizeUtils.dp2px(getContext(),40)); CallerLogger.INSTANCE.d(M_TAXI + TAG,"SelectTv = "+ textView.getText()); textView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); textView.setTextColor(Color.parseColor("#FFFFFF")); }else { textView.setBackground(null); - textView.setTextSize(AutoSizeUtils.dp2px(getContext(),36)); + textView.setTextSize(TypedValue.COMPLEX_UNIT_PX,AutoSizeUtils.dp2px(getContext(),36)); CallerLogger.INSTANCE.d(M_TAXI + TAG,"unSelectTv = "+ textView.getText()); textView.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL)); textView.setTextColor(Color.parseColor("#CCD4F5"));