diff options
author | Danny Baumann <dannybaumann@web.de> | 2012-05-15 15:02:59 +0200 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2012-05-16 14:49:06 +0200 |
commit | fe0637d325aacdd952a54dee0e8505832f4b7ce4 (patch) | |
tree | 3ae6881627e3bbaa987b9ea7eccc37468ac70c94 | |
parent | aa328b4ec80f2ec94321f76cb3d5eb7351f35ebb (diff) | |
download | frameworks_base-fe0637d325aacdd952a54dee0e8505832f4b7ce4.zip frameworks_base-fe0637d325aacdd952a54dee0e8505832f4b7ce4.tar.gz frameworks_base-fe0637d325aacdd952a54dee0e8505832f4b7ce4.tar.bz2 |
Fix percentage bar not appearing on first try to enable it.
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/CmBatteryMiniIcon.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CmBatteryMiniIcon.java b/packages/SystemUI/src/com/android/systemui/statusbar/CmBatteryMiniIcon.java index 50a0dbe..c90a0a2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/CmBatteryMiniIcon.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/CmBatteryMiniIcon.java @@ -210,9 +210,14 @@ public class CmBatteryMiniIcon extends ImageView { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { final int height = MeasureSpec.getSize(heightMeasureSpec); - setMeasuredDimension(mWidthPx + mMarginRightPx, height); + } + + @Override + protected boolean setFrame(int l, int t, int r, int b) { + boolean changed = super.setFrame(l, t, r, b); updateMatrix(); + return changed; } @Override @@ -300,7 +305,8 @@ public class CmBatteryMiniIcon extends ImageView { public void updateMatrix() { mMatrix.reset(); mMatrix.setTranslate(0, 0); - float scaleFactor=getHeight()/(float)(mMiniIconCache[0].getHeight()); + + float scaleFactor = getHeight() / (float)(mMiniIconCache[0].getHeight()); mMatrix.postScale(mWidthPx, scaleFactor); } } |