ソースを参照

1.修改Android Apex KPI字体大小适配屏幕。

Pen Li 8 年 前
コミット
f7d8965e04

+ 6 - 7
Apex Mobile/app/src/main/java/com/usai/apex/KPI/KPICell.java

@@ -263,13 +263,12 @@ public class KPICell extends RelativeLayout implements KPIListView.KPIListViewTo
         mWidth = w;
         mHeight = h;
 
-        float ratio = px2dp(getContext(),w) / px2dp(getContext(),720.0f);
-        float textSize = 17.0f;
-        mMonthTV.setTextSize(TypedValue.COMPLEX_UNIT_SP,ratio * textSize);
-        mShipTV.setTextSize(TypedValue.COMPLEX_UNIT_SP,ratio * textSize);
-        mContainerTV.setTextSize(TypedValue.COMPLEX_UNIT_SP,ratio * textSize);
-        mTeuTV.setTextSize(TypedValue.COMPLEX_UNIT_SP,ratio * textSize);
-        mSelectionTV.setTextSize(TypedValue.COMPLEX_UNIT_SP,ratio * textSize);
+        float textSize = 7;
+        mMonthTV.setTextSize(TypedValue.COMPLEX_UNIT_PT,textSize);
+        mShipTV.setTextSize(TypedValue.COMPLEX_UNIT_PT,textSize);
+        mContainerTV.setTextSize(TypedValue.COMPLEX_UNIT_PT,textSize);
+        mTeuTV.setTextSize(TypedValue.COMPLEX_UNIT_PT,textSize);
+        mSelectionTV.setTextSize(TypedValue.COMPLEX_UNIT_PT,textSize);
     }