Fixes in UsageBarPreference

The widget layout that was used resulted in a clipped usage bar.
It also had a 6dip left offset inherited from the default layout
which adds margin after the text (even if the text is empty here).
Used a custom layout for the whole preference to fix this issue.

Other fixes in the drawing code to prevent accumulative rounding
issues.

Change-Id: Ief9bf85260345355615c9670624d86f0893eb2d2
This commit is contained in:
Gilles Debunne
2011-05-06 14:12:13 -07:00
parent 934d21dc2a
commit 783be0a24f
4 changed files with 28 additions and 19 deletions

View File

@@ -13,17 +13,24 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:paddingRight="?android:attr/scrollbarSize"
android:paddingLeft="@*android:dimen/preference_widget_width">
<com.android.settings.deviceinfo.PercentageBarChart
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
<com.android.settings.deviceinfo.PercentageBarChart
android:id="@+id/percentage_bar_chart"
android:layout_width="match_parent"
android:layout_height="32dip"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:id="@+id/percentage_bar_chart"
android:paddingRight="?android:attr/scrollbarSize"
settings:minTickWidth="6dip"
settings:emptyColor="@color/memory_avail">
</com.android.settings.deviceinfo.PercentageBarChart>
</com.android.settings.deviceinfo.PercentageBarChart>
</LinearLayout>