浏览代码

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

Pen Li 8 年之前
父节点
当前提交
f7d8965e04
共有 1 个文件被更改,包括 6 次插入7 次删除
  1. 6 7
      Apex Mobile/app/src/main/java/com/usai/apex/KPI/KPICell.java

+ 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);
     }