Fix bug #10624988 Incorrect mirroring of RAM and Internal Storage for Apps screens in Settings

- well this CL is only for preventing a wrong rendering (the real CL would need to be one latter
and would need to fix the onDraw(Canvas) for LinearColorBar so that it takes care of the layout direction)
- force LTR layout direction on the LinearColorBar, hence preventing the two TextView to render their
text "in the middle".
- use BidiFormatter to wrap number strings

Change-Id: Ie164e5509c0364a81c85a3ac69f97a89f20a4130
This commit is contained in:
Fabrice Di Meglio
2013-09-05 17:02:28 -07:00
parent 5aacc54289
commit 37f3c8f574
4 changed files with 29 additions and 12 deletions

View File

@@ -16,6 +16,7 @@
package com.android.settings.applications;
import android.text.BidiFormatter;
import com.android.internal.util.MemInfoReader;
import com.android.settings.R;
@@ -342,11 +343,14 @@ public class RunningProcessesView extends FrameLayout
mLastBackgroundProcessMemory = mState.mBackgroundProcessMemory;
mLastAvailMemory = availMem;
long freeMem = mLastAvailMemory + mLastBackgroundProcessMemory;
String sizeStr = Formatter.formatShortFileSize(getContext(), freeMem);
BidiFormatter bidiFormatter = BidiFormatter.getInstance();
String sizeStr = bidiFormatter.unicodeWrap(
Formatter.formatShortFileSize(getContext(), freeMem));
mBackgroundProcessText.setText(getResources().getString(
R.string.service_background_processes, sizeStr));
sizeStr = Formatter.formatShortFileSize(getContext(),
mMemInfoReader.getTotalSize() - freeMem);
sizeStr = bidiFormatter.unicodeWrap(
Formatter.formatShortFileSize(getContext(),
mMemInfoReader.getTotalSize() - freeMem));
mForegroundProcessText.setText(getResources().getString(
R.string.service_foreground_processes, sizeStr));
}