Files
app_Settings/res/layout/preference_progress_category.xml
Gilles Debunne 648f4f6688 Fixed layout for "Available Devices" in Bluetooth
Bug 5646340.

'Title' and 'scanning' text are on the same line as a PreferenceCategory.
The first one has a 0dp width, compensated by a 1 weight.

When scanning is not displayed, it should be GONE rather than INVISIBLE
to let the title take the whole space.

When both are visible, they should split the space, or else, with long
texts in foreign languages, scanning takes the whole space, leaving the
title with an almost 0 width that generates a very high text because
of wrapping.

Distributing size among the two texts to accomodate for such cases.

Changed padding and alignment to get reasonnable results for Slovenian
language (i.e. very long text), when both title and scanning are displayed.

Strangely, the right scanning alignment is not enforced, although I checked
it is correctly set on the TextView. Not investigating further now since it
may not be desired by UX anyway.

Change-Id: I6b4c6fcbc350d3664749f58eee34ec0867720626
2011-11-22 10:45:18 +01:00

60 lines
2.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Layout used for ProgressCategory in bluetooth settings. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="?android:attr/listSeparatorTextViewStyle"
android:gravity="center_vertical"
android:orientation="horizontal"
>
<!-- This and the other text view have the style of the list separator text view without the background and padding -->
<TextView
style="?android:attr/listSeparatorTextViewStyle"
android:background="@null"
android:paddingLeft="16dip"
android:id="@+android:id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="left|bottom"
/>
<TextView
style="?android:attr/listSeparatorTextViewStyle"
android:background="@null"
android:paddingLeft="0dip"
android:id="@+id/scanning_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="right|bottom"
android:text="@string/progress_scanning"
/>
<ProgressBar
android:id="@+id/scanning_progress"
android:text="@string/progress_scanning"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="16dip"
android:layout_marginRight="16dip"
style="?android:attr/progressBarStyleSmallTitle"
/>
</LinearLayout>