LG Optimus(옵티머스) 폰 상태바 배터리 퍼센트 아이콘 (시스템 파일 수정)
상단바의 베터리 아이콘에 퍼센트를 겹쳐 표시하도록 합니다.
별다른 이미지 수정이나 추가 없이, 기본 베터리 퍼센트 표시 텍스트를 배터리 아이콘에 겹치는 방식입니다.
따라서 옵션에서 배터리 퍼센트 표시가 활성화되어있지 않다면 숫자가 사라집니다.
↑ 중앙
↑ 좌측밀기
↑ 좌측밀기2 (충전중 번개표시를 가리지 않도록 위치 조정)
퍼센트 기호 삭제
system/app/SystemUI.apk/res/values/strings.xml
<string name="status_bar_settings_battery_meter_format">%d%%</string>
를 찾아
<string name="status_bar_settings_battery_meter_format">%d</string>
로 고칩니다.
숫자 겹치기
system/app/SystemUI.apk/res/layout/status_bar.xml 파일에서 아래 두 줄을 원하는 배치로 수정합니다.
<TextView android:textSize="13.0dip" android:textColor="#f2f2f2f2" android:gravity="center_vertical" android:id="@id/level_percent" android:paddingLeft="2.0dip" android:paddingRight="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<ImageView android:id="@id/battery" android:paddingRight="1.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" />
↓ 중앙 (복붙은 http://pastebin.com/W0Caiggw)
<FrameLayout android:layout_width="wrap_content" android:layout_height="fill_parent">
<ImageView android:id="@id/battery"
android:paddingLeft="2.5dip"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" />
<TextView android:textSize="11dip"
android:shadowColor="#000" android:shadowRadius="2"
android:textColor="#fff" android:textStyle="bold"
android:layout_gravity="center" android:id="@id/level_percent" android:tag="NO_R2L"
android:paddingRight="1dip" android:paddingLeft="1dip" android:paddingTop="1dip"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
</FrameLayout>
↓ 좌측밀기 (복붙은 http://pastebin.com/f6ZzWsew)
<FrameLayout android:layout_width="wrap_content" android:layout_height="fill_parent">
<ImageView android:id="@id/battery"
android:paddingRight="1dip"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="right" />
<TextView android:textSize="13.0dip"
android:shadowColor="#000" android:shadowRadius="2"
android:textColor="#fff" android:textStyle="bold"
android:layout_gravity="bottom|right" android:id="@id/level_percent" android:tag="NO_R2L"
android:paddingLeft="1dip" android:paddingRight="10dip" android:paddingBottom="2dip"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
</FrameLayout>
↓ 좌측밀기2 (복붙은 http://pastebin.com/tVH69Bgu)
<FrameLayout android:layout_width="wrap_content" android:layout_height="fill_parent">
<ImageView android:id="@id/battery"
android:paddingRight="1dip"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="right" />
<TextView android:textSize="12.0dip"
android:shadowColor="#000" android:shadowRadius="2"
android:textColor="#fff" android:textStyle="bold"
android:layout_gravity="bottom|right" android:id="@id/level_percent" android:tag="NO_R2L"
android:paddingLeft="1dip" android:paddingRight="11dip" android:paddingBottom="1.5dip"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
</FrameLayout>
↑ 여기 두 줄을 찾아
↑ 원하는 배치로 수정
Optimus LTE II 기준입니다. 다른 기종, 다른 펌웨어 버전에서는 조금 다를 수 있습니다. 센스껏 응용하세요.
Optimus G에서 같은 소스로 적용되는 것을 확인했습니다.
기종이나 폰트 차이로 인해 위치가 안 맞는 경우 TextView의 padding, textSize 수치들을 적절히 수정해야 합니다.