OsmAnd/OsmAnd/res/layout/download_index.xml
Nelson A. de Oliveira bcab94e54f Fix inefficient layout weight
When only a single widget in a LinearLayout defines a weight, it is more
efficient to assign a width/height of 0dp to it since it will absorb all
the remaining space anyway. With a declared width/height of 0dp it does
not have to measure its own size first.
2013-08-03 10:42:47 -03:00

113 lines
No EOL
4.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/MainLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/ProgressView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginRight="5dp"
android:gravity="center_vertical|left"
android:orientation="horizontal" >
<ProgressBar
android:id="@+id/IndeterminateProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:indeterminate="true"
android:indeterminateOnly="true"
android:visibility="gone" />
<TextView
android:id="@+id/ProgressPercent"
android:layout_width="48dp"
android:layout_alignParentRight="true"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="right|center_vertical"
android:text=""
android:textSize="14sp" />
<TextView
android:id="@+id/ProgressMessage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="3dp"
android:layout_toLeftOf="@id/ProgressPercent"
android:layout_toRightOf="@id/IndeterminateProgressBar"
android:ellipsize="end"
android:gravity="left|center_vertical"
android:singleLine="true"
android:text=""
android:textSize="14sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ProgressBar
android:id="@+id/DeterminateProgressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageView
android:id="@+id/Cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/a_1_navigation_cancel_small_dark" />
</LinearLayout>
</LinearLayout>
<EditText
android:id="@+id/search_box"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:layout_marginBottom="5dp"
android:hint="@string/download_type_to_filter"
android:inputType="textFilter"
android:maxLines="1" />
<ExpandableListView
android:id="@android:id/list"
style="@style/OsmandListView"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="0dp"
android:layout_weight="1"
android:groupIndicator="@android:color/transparent" />
<Button
android:id="@+id/DownloadButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:layout_marginTop="3dp"
android:gravity="center"
android:text="@string/download_files"
android:visibility="gone" />
</LinearLayout>