am febcfac8: Added wrapping padding for round screens.
* commit 'febcfac83f727ff9d8d4d36aaa99f626cc6cf186':
Added wrapping padding for round screens.
diff --git a/apps/CtsVerifier/res/layout-land/sensor_test.xml b/apps/CtsVerifier/res/layout-land/sensor_test.xml
index 293b4b0..f547978 100644
--- a/apps/CtsVerifier/res/layout-land/sensor_test.xml
+++ b/apps/CtsVerifier/res/layout-land/sensor_test.xml
@@ -13,41 +13,46 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- >
-
- <LinearLayout
- android:orientation="horizontal"
+<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <LinearLayout app:layout_box="all"
+ android:orientation="vertical"
android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1">
+ android:layout_height="match_parent"
+ >
- <ScrollView
- android:id="@+id/log_scroll_view"
- android:fillViewport="true"
- android:layout_height="match_parent"
- android:layout_width="0dp"
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
android:layout_weight="1">
- <LinearLayout
- android:id="@+id/log_layout"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
+ <ScrollView
+ android:id="@+id/log_scroll_view"
+ android:fillViewport="true"
+ android:layout_height="match_parent"
+ android:layout_width="0dp"
+ android:layout_weight="1">
- </ScrollView>
+ <LinearLayout
+ android:id="@+id/log_layout"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"/>
- <android.opengl.GLSurfaceView android:id="@+id/gl_surface_view"
- android:visibility="gone"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1"/>
+ </ScrollView>
+
+ <android.opengl.GLSurfaceView android:id="@+id/gl_surface_view"
+ android:visibility="gone"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"/>
+
+ </LinearLayout>
+
+ <include layout="@layout/snsr_next_button" />
</LinearLayout>
-
- <include layout="@layout/snsr_next_button" />
-
-</LinearLayout>
+</android.support.wearable.view.BoxInsetLayout>
diff --git a/apps/CtsVerifier/res/layout-port/sensor_test.xml b/apps/CtsVerifier/res/layout-port/sensor_test.xml
index eac5357..b4eca4d 100644
--- a/apps/CtsVerifier/res/layout-port/sensor_test.xml
+++ b/apps/CtsVerifier/res/layout-port/sensor_test.xml
@@ -13,30 +13,35 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
+<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <LinearLayout app:layout_box="all"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
- <ScrollView android:id="@+id/log_scroll_view"
- android:fillViewport="true"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:layout_width="match_parent">
+ <ScrollView android:id="@+id/log_scroll_view"
+ android:fillViewport="true"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:layout_width="match_parent">
- <LinearLayout android:id="@+id/log_layout"
- android:orientation="vertical"
- android:layout_height="match_parent"
+ <LinearLayout android:id="@+id/log_layout"
+ android:orientation="vertical"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"/>
+
+ </ScrollView>
+
+ <android.opengl.GLSurfaceView android:id="@+id/gl_surface_view"
+ android:visibility="gone"
+ android:layout_height="0dp"
+ android:layout_weight="1"
android:layout_width="match_parent"/>
- </ScrollView>
+ <include layout="@layout/snsr_next_button"/>
- <android.opengl.GLSurfaceView android:id="@+id/gl_surface_view"
- android:visibility="gone"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:layout_width="match_parent"/>
-
- <include layout="@layout/snsr_next_button"/>
-
-</LinearLayout>
+ </LinearLayout>
+</android.support.wearable.view.BoxInsetLayout>
diff --git a/apps/CtsVerifier/res/layout/ca_boot_notify.xml b/apps/CtsVerifier/res/layout/ca_boot_notify.xml
index e9309d4..0ceece1 100644
--- a/apps/CtsVerifier/res/layout/ca_boot_notify.xml
+++ b/apps/CtsVerifier/res/layout/ca_boot_notify.xml
@@ -14,56 +14,60 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical" android:layout_width="fill_parent"
- android:layout_height="fill_parent">
-
- <ScrollView
+<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentTop="true" >
+ android:layout_height="match_parent">
+ <LinearLayout app:layout_box="all"
+ android:orientation="vertical" android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content">
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentTop="true" >
- <TextView
- android:id="@+id/check_cert_desc"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/caboot_check_cert_installed"/>
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
- <Button android:id="@+id/check_creds"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/caboot_check_creds" />
+ <TextView
+ android:id="@+id/check_cert_desc"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/caboot_check_cert_installed"/>
- <TextView
- android:id="@+id/need_to_install_cert"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/caboot_if_not_installed"/>
+ <Button android:id="@+id/check_creds"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/caboot_check_creds" />
- <Button android:id="@+id/install"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/caboot_install_cert" />
+ <TextView
+ android:id="@+id/need_to_install_cert"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/caboot_if_not_installed"/>
- <TextView
- android:id="@+id/reboot"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/caboot_reboot_desc"/>
+ <Button android:id="@+id/install"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/caboot_install_cert" />
- <TextView
- android:id="@+id/after_reboot"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/caboot_after_boot"/>
+ <TextView
+ android:id="@+id/reboot"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/caboot_reboot_desc"/>
- <include layout="@layout/pass_fail_buttons" />
+ <TextView
+ android:id="@+id/after_reboot"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/caboot_after_boot"/>
+
+ <include layout="@layout/pass_fail_buttons" />
+ </LinearLayout>
+ </ScrollView>
</LinearLayout>
- </ScrollView>
-</LinearLayout>
+</android.support.wearable.view.BoxInsetLayout>
diff --git a/apps/CtsVerifier/res/layout/ca_main.xml b/apps/CtsVerifier/res/layout/ca_main.xml
index 467ed01..274430d 100644
--- a/apps/CtsVerifier/res/layout/ca_main.xml
+++ b/apps/CtsVerifier/res/layout/ca_main.xml
@@ -14,65 +14,68 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical" android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <LinearLayout app:layout_box="all"
+ android:orientation="vertical" android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal" android:layout_width="fill_parent"
- android:layout_height="wrap_content">
- <!--Button android:id="@+id/focusmodesbutton" android:layout_width="0px"
- android:layout_height="wrap_content" android:text="@string/ca_focus_modes_label"
- android:layout_weight="1" /-->
- <Button android:id="@+id/findcheckerboardbutton" android:layout_width="0px"
- android:layout_height="wrap_content" android:text="@string/ca_find_checkerboard_label"
- android:layout_weight="1" />
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal" android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+ <!--Button android:id="@+id/focusmodesbutton" android:layout_width="0px"
+ android:layout_height="wrap_content" android:text="@string/ca_focus_modes_label"
+ android:layout_weight="1" /-->
+ <Button android:id="@+id/findcheckerboardbutton" android:layout_width="0px"
+ android:layout_height="wrap_content" android:text="@string/ca_find_checkerboard_label"
+ android:layout_weight="1" />
- <Button android:id="@+id/meteringbutton" android:layout_width="0px"
- android:layout_height="wrap_content" android:text="@string/ca_metering_label"
- android:layout_weight="1" />
+ <Button android:id="@+id/meteringbutton" android:layout_width="0px"
+ android:layout_height="wrap_content" android:text="@string/ca_metering_label"
+ android:layout_weight="1" />
- <Button android:id="@+id/exposurecompensationbutton" android:layout_width="0px"
- android:layout_height="wrap_content" android:text="@string/ca_exposure_test_label"
- android:layout_weight="1"/>
+ <Button android:id="@+id/exposurecompensationbutton" android:layout_width="0px"
+ android:layout_height="wrap_content" android:text="@string/ca_exposure_test_label"
+ android:layout_weight="1"/>
- <Button android:id="@+id/whitebalancebutton" android:layout_width="0px"
- android:layout_height="wrap_content" android:text="@string/ca_wb_test_label"
- android:layout_weight="1" />
+ <Button android:id="@+id/whitebalancebutton" android:layout_width="0px"
+ android:layout_height="wrap_content" android:text="@string/ca_wb_test_label"
+ android:layout_weight="1" />
- <Button android:id="@+id/lockbutton" android:layout_width="0px"
- android:layout_height="wrap_content" android:text="@string/ca_lock_test_label"
- android:layout_weight="1" />
- </LinearLayout>
+ <Button android:id="@+id/lockbutton" android:layout_width="0px"
+ android:layout_height="wrap_content" android:text="@string/ca_lock_test_label"
+ android:layout_weight="1" />
+ </LinearLayout>
- <LinearLayout android:orientation="horizontal"
- android:layout_width="fill_parent" android:layout_height="0px"
- android:layout_weight="1">
+ <LinearLayout android:orientation="horizontal"
+ android:layout_width="fill_parent" android:layout_height="0px"
+ android:layout_weight="1">
- <SurfaceView android:id="@+id/cameraview" android:layout_height="fill_parent"
- android:layout_width="wrap_content"
- android:layout_weight="0" />
+ <SurfaceView android:id="@+id/cameraview" android:layout_height="fill_parent"
+ android:layout_width="wrap_content"
+ android:layout_weight="0" />
- <LinearLayout android:orientation="vertical"
- android:layout_width="fill_parent" android:layout_height="match_parent"
- android:layout_weight="1">
+ <LinearLayout android:orientation="vertical"
+ android:layout_width="fill_parent" android:layout_height="match_parent"
+ android:layout_weight="1">
- <ListView android:id="@+id/ca_tests"
+ <ListView android:id="@+id/ca_tests"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_marginLeft="10px"/>
+
+ <ImageView android:id="@+id/resultview" android:layout_height="wrap_content"
android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:layout_marginLeft="10px"/>
+ android:layout_weight="1" />
+ </LinearLayout>
- <ImageView android:id="@+id/resultview" android:layout_height="wrap_content"
- android:layout_width="fill_parent"
- android:layout_weight="1" />
+ </LinearLayout>
+
+ <include layout="@layout/pass_fail_buttons" />
+
</LinearLayout>
-
- </LinearLayout>
-
- <include layout="@layout/pass_fail_buttons" />
-
-</LinearLayout>
-
+</android.support.wearable.view.BoxInsetLayout>
diff --git a/apps/CtsVerifier/res/layout/cainstallnotify_main.xml b/apps/CtsVerifier/res/layout/cainstallnotify_main.xml
index 16882bd..6cb6160 100644
--- a/apps/CtsVerifier/res/layout/cainstallnotify_main.xml
+++ b/apps/CtsVerifier/res/layout/cainstallnotify_main.xml
@@ -14,32 +14,37 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:padding="10dip" >
-
- <ScrollView
- android:id="@+id/ca_notify_test_scroller"
+ android:layout_height="match_parent">
+ <LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
+ android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dip" >
- <LinearLayout
- android:id="@+id/ca_notify_test_items"
+ <ScrollView
+ android:id="@+id/ca_notify_test_scroller"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:orientation="vertical"
+ android:padding="10dip" >
+
+ <LinearLayout
+ android:id="@+id/ca_notify_test_items"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+ </LinearLayout>
+ </ScrollView>
+
+ <include
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical" >
- </LinearLayout>
- </ScrollView>
+ android:layout_weight="0"
+ layout="@layout/pass_fail_buttons" />
- <include
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="0"
- layout="@layout/pass_fail_buttons" />
-
-</LinearLayout>
\ No newline at end of file
+ </LinearLayout>
+</android.support.wearable.view.BoxInsetLayout>
diff --git a/apps/CtsVerifier/res/layout/fs_main.xml b/apps/CtsVerifier/res/layout/fs_main.xml
index 7473f0f..8a78c81 100644
--- a/apps/CtsVerifier/res/layout/fs_main.xml
+++ b/apps/CtsVerifier/res/layout/fs_main.xml
@@ -13,29 +13,34 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
+<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <LinearLayout app:layout_box="all"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
- <TextView android:id="@+id/fs_warnings"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/empty"/>
+ <TextView android:id="@+id/fs_warnings"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/empty"/>
- <ListView android:id="@id/android:list"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="#000000"
- android:layout_weight="1"
- android:drawSelectorOnTop="false"/>
+ <ListView android:id="@id/android:list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="#000000"
+ android:layout_weight="1"
+ android:drawSelectorOnTop="false"/>
- <TextView android:id="@id/android:empty"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="#000000"
- android:text="@string/fs_no_data"/>
+ <TextView android:id="@id/android:empty"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="#000000"
+ android:text="@string/fs_no_data"/>
- <include layout="@layout/pass_fail_buttons" />
+ <include layout="@layout/pass_fail_buttons" />
-</LinearLayout>
+ </LinearLayout>
+</android.support.wearable.view.BoxInsetLayout>
diff --git a/apps/CtsVerifier/res/layout/intent_driven_test.xml b/apps/CtsVerifier/res/layout/intent_driven_test.xml
index 00c1cf6..bd9e4ca 100644
--- a/apps/CtsVerifier/res/layout/intent_driven_test.xml
+++ b/apps/CtsVerifier/res/layout/intent_driven_test.xml
@@ -1,30 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
-
- <ScrollView
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1">
- <TextView android:id="@+id/info"
+ android:layout_height="match_parent">
+ <LinearLayout app:layout_box="all"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:padding="5dp"
- android:text="@string/dc_start_alarm_test_info"/>
- </ScrollView>
+ android:layout_height="match_parent"
+ android:orientation="vertical">
- <LinearLayout android:id="@+id/buttons"
- android:orientation="horizontal"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1">
+ <TextView android:id="@+id/info"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textSize="18sp"
+ android:padding="5dp"
+ android:text="@string/dc_start_alarm_test_info"/>
+ </ScrollView>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <include layout="@layout/pass_fail_buttons"/>
- </LinearLayout>
-</LinearLayout>
+ <LinearLayout android:id="@+id/buttons"
+ android:orientation="horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <include layout="@layout/pass_fail_buttons"/>
+ </LinearLayout>
+ </LinearLayout>
+</android.support.wearable.view.BoxInsetLayout>
diff --git a/apps/CtsVerifier/res/layout/js_charging.xml b/apps/CtsVerifier/res/layout/js_charging.xml
index 5552111..8d9ed1d 100644
--- a/apps/CtsVerifier/res/layout/js_charging.xml
+++ b/apps/CtsVerifier/res/layout/js_charging.xml
@@ -1,72 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
-
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
- <LinearLayout
- android:orientation="vertical"
+ <ScrollView app:layout_box="all"
android:layout_width="match_parent"
android:layout_height="match_parent">
- <TextView
+ <LinearLayout
+ android:orientation="vertical"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/js_test_description"
- android:layout_margin="@dimen/js_padding"/>
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="@dimen/js_padding"
- android:text="@string/js_charging_description_1"
- android:textStyle="bold"/>
- <Button
- android:id="@+id/js_charging_start_test_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="@string/js_start_test_text"
- android:onClick="startTest"
- android:enabled="false"/>
+ android:layout_height="match_parent">
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/js_test_description"
+ android:layout_margin="@dimen/js_padding"/>
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/js_padding"
+ android:text="@string/js_charging_description_1"
+ android:textStyle="bold"/>
+ <Button
+ android:id="@+id/js_charging_start_test_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:text="@string/js_start_test_text"
+ android:onClick="startTest"
+ android:enabled="false"/>
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/js_padding"
- android:layout_marginBottom="@dimen/js_padding">
- <ImageView
- android:id="@+id/charging_off_test_image"
+ <LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:src="@drawable/fs_indeterminate"
- android:layout_marginRight="@dimen/js_padding"/>
+ android:layout_marginTop="@dimen/js_padding"
+ android:layout_marginBottom="@dimen/js_padding">
+ <ImageView
+ android:id="@+id/charging_off_test_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/fs_indeterminate"
+ android:layout_marginRight="@dimen/js_padding"/>
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/js_charging_off_test"
+ android:textSize="16dp"/>
+ </LinearLayout>
<TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/js_padding"
+ android:text="@string/js_charging_description_2"
+ android:textStyle="bold"/>
+ <LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/js_charging_off_test"
- android:textSize="16dp"/>
+ android:layout_marginTop="@dimen/js_padding"
+ android:layout_marginBottom="@dimen/js_padding">
+ <ImageView
+ android:id="@+id/charging_on_test_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/fs_indeterminate"
+ android:layout_marginRight="@dimen/js_padding"/>
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/js_charging_on_test"
+ android:textSize="16dp"/>
+ </LinearLayout>
+ <include layout="@layout/pass_fail_buttons" />
</LinearLayout>
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="@dimen/js_padding"
- android:text="@string/js_charging_description_2"
- android:textStyle="bold"/>
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/js_padding"
- android:layout_marginBottom="@dimen/js_padding">
- <ImageView
- android:id="@+id/charging_on_test_image"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/fs_indeterminate"
- android:layout_marginRight="@dimen/js_padding"/>
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/js_charging_on_test"
- android:textSize="16dp"/>
- </LinearLayout>
- <include layout="@layout/pass_fail_buttons" />
- </LinearLayout>
-</ScrollView>
\ No newline at end of file
+ </ScrollView>
+</android.support.wearable.view.BoxInsetLayout>
diff --git a/apps/CtsVerifier/res/layout/js_connectivity.xml b/apps/CtsVerifier/res/layout/js_connectivity.xml
index e0fc740..b0e2824 100644
--- a/apps/CtsVerifier/res/layout/js_connectivity.xml
+++ b/apps/CtsVerifier/res/layout/js_connectivity.xml
@@ -1,86 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
- <LinearLayout
- android:orientation="vertical" android:layout_width="match_parent"
+ <ScrollView app:layout_box="all"
+ android:layout_width="match_parent"
android:layout_height="match_parent">
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/js_test_description"
- android:layout_margin="@dimen/js_padding"/>
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/js_connectivity_description_1"
- android:layout_margin="@dimen/js_padding"
- android:textStyle="bold"/>
-
- <Button
- android:id="@+id/js_connectivity_start_test_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="@string/js_start_test_text"
- android:onClick="startTest"
- android:enabled="false"/>
-
<LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/js_padding"
- android:layout_marginBottom="@dimen/js_padding">
- <ImageView
- android:id="@+id/connectivity_off_test_unmetered_image"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/fs_indeterminate"
- android:layout_marginRight="@dimen/js_padding"/>
+ android:orientation="vertical" android:layout_width="match_parent"
+ android:layout_height="match_parent">
<TextView
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/js_unmetered_connectivity_test"
- android:textSize="16dp"/>
- </LinearLayout>
+ android:text="@string/js_test_description"
+ android:layout_margin="@dimen/js_padding"/>
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/js_padding"
- android:layout_marginBottom="@dimen/js_padding">
- <ImageView
- android:id="@+id/connectivity_off_test_any_connectivity_image"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/fs_indeterminate"
- android:layout_marginRight="@dimen/js_padding"/>
<TextView
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/js_any_connectivity_test"
- android:textSize="16dp"/>
- </LinearLayout>
+ android:text="@string/js_connectivity_description_1"
+ android:layout_margin="@dimen/js_padding"
+ android:textStyle="bold"/>
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/js_padding"
- android:layout_marginBottom="@dimen/js_padding">
- <ImageView
- android:id="@+id/connectivity_off_test_no_connectivity_image"
+ <Button
+ android:id="@+id/js_connectivity_start_test_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:src="@drawable/fs_indeterminate"
- android:layout_marginRight="@dimen/js_padding"/>
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/js_no_connectivity_test"
- android:textSize="16dp"/>
- </LinearLayout>
+ android:layout_gravity="center"
+ android:text="@string/js_start_test_text"
+ android:onClick="startTest"
+ android:enabled="false"/>
- <include layout="@layout/pass_fail_buttons" />
- </LinearLayout>
-</ScrollView>
\ No newline at end of file
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/js_padding"
+ android:layout_marginBottom="@dimen/js_padding">
+ <ImageView
+ android:id="@+id/connectivity_off_test_unmetered_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/fs_indeterminate"
+ android:layout_marginRight="@dimen/js_padding"/>
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/js_unmetered_connectivity_test"
+ android:textSize="16dp"/>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/js_padding"
+ android:layout_marginBottom="@dimen/js_padding">
+ <ImageView
+ android:id="@+id/connectivity_off_test_any_connectivity_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/fs_indeterminate"
+ android:layout_marginRight="@dimen/js_padding"/>
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/js_any_connectivity_test"
+ android:textSize="16dp"/>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/js_padding"
+ android:layout_marginBottom="@dimen/js_padding">
+ <ImageView
+ android:id="@+id/connectivity_off_test_no_connectivity_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/fs_indeterminate"
+ android:layout_marginRight="@dimen/js_padding"/>
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/js_no_connectivity_test"
+ android:textSize="16dp"/>
+ </LinearLayout>
+
+ <include layout="@layout/pass_fail_buttons" />
+ </LinearLayout>
+ </ScrollView>
+</android.support.wearable.view.BoxInsetLayout>
diff --git a/apps/CtsVerifier/res/layout/js_idle.xml b/apps/CtsVerifier/res/layout/js_idle.xml
index 453b638..4277173 100644
--- a/apps/CtsVerifier/res/layout/js_idle.xml
+++ b/apps/CtsVerifier/res/layout/js_idle.xml
@@ -1,67 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
-
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
- <LinearLayout
- android:orientation="vertical"
+ <ScrollView app:layout_box="all"
android:layout_width="match_parent"
android:layout_height="match_parent">
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/js_test_description"
- android:layout_margin="@dimen/js_padding"/>
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/js_idle_description_1"
- android:layout_margin="@dimen/js_padding"
- android:textStyle="bold"/>
-
- <Button
- android:id="@+id/js_idle_start_test_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="@string/js_start_test_text"
- android:onClick="startTest"
- android:enabled="false"/>
-
<LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/js_padding"
- android:layout_marginBottom="@dimen/js_padding">
- <ImageView
- android:id="@+id/idle_off_test_image"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/fs_indeterminate"
- android:layout_marginRight="@dimen/js_padding"/>
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<TextView
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/js_idle_item_idle_off"
- android:textSize="16dp"/>
- </LinearLayout>
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/js_padding"
- android:layout_marginBottom="@dimen/js_padding">
- <ImageView
- android:id="@+id/idle_on_test_image"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/fs_indeterminate"
- android:layout_marginRight="@dimen/js_padding"/>
+ android:text="@string/js_test_description"
+ android:layout_margin="@dimen/js_padding"/>
<TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/js_idle_description_1"
+ android:layout_margin="@dimen/js_padding"
+ android:textStyle="bold"/>
+
+ <Button
+ android:id="@+id/js_idle_start_test_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/js_idle_item_idle_on"
- android:textSize="16dp"/>
+ android:layout_gravity="center"
+ android:text="@string/js_start_test_text"
+ android:onClick="startTest"
+ android:enabled="false"/>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/js_padding"
+ android:layout_marginBottom="@dimen/js_padding">
+ <ImageView
+ android:id="@+id/idle_off_test_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/fs_indeterminate"
+ android:layout_marginRight="@dimen/js_padding"/>
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/js_idle_item_idle_off"
+ android:textSize="16dp"/>
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/js_padding"
+ android:layout_marginBottom="@dimen/js_padding">
+ <ImageView
+ android:id="@+id/idle_on_test_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/fs_indeterminate"
+ android:layout_marginRight="@dimen/js_padding"/>
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/js_idle_item_idle_on"
+ android:textSize="16dp"/>
+ </LinearLayout>
+ <include layout="@layout/pass_fail_buttons" />
</LinearLayout>
- <include layout="@layout/pass_fail_buttons" />
- </LinearLayout>
-</ScrollView>
\ No newline at end of file
+ </ScrollView>
+</android.support.wearable.view.BoxInsetLayout>
diff --git a/apps/CtsVerifier/res/layout/location_mode_main.xml b/apps/CtsVerifier/res/layout/location_mode_main.xml
index fde6aba..1768434 100644
--- a/apps/CtsVerifier/res/layout/location_mode_main.xml
+++ b/apps/CtsVerifier/res/layout/location_mode_main.xml
@@ -14,32 +14,37 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:padding="10dip" >
-
- <ScrollView
- android:id="@+id/test_scroller"
+ android:layout_height="match_parent">
+ <LinearLayout app:layout_box="all"
android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
+ android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dip" >
- <LinearLayout
- android:id="@+id/test_items"
+ <ScrollView
+ android:id="@+id/test_scroller"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:orientation="vertical"
+ android:padding="10dip" >
+
+ <LinearLayout
+ android:id="@+id/test_items"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+ </LinearLayout>
+ </ScrollView>
+
+ <include
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical" >
- </LinearLayout>
- </ScrollView>
+ android:layout_weight="0"
+ layout="@layout/pass_fail_buttons" />
- <include
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="0"
- layout="@layout/pass_fail_buttons" />
-
-</LinearLayout>
+ </LinearLayout>
+</android.support.wearable.view.BoxInsetLayout>
diff --git a/apps/CtsVerifier/res/layout/pa_main.xml b/apps/CtsVerifier/res/layout/pa_main.xml
index 76cb7d4..832af71 100644
--- a/apps/CtsVerifier/res/layout/pa_main.xml
+++ b/apps/CtsVerifier/res/layout/pa_main.xml
@@ -13,19 +13,24 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
- android:layout_height="match_parent" >
-
- <include
- android:id="@+id/pass_fail_buttons"
- android:layout_gravity="top"
- layout="@layout/pass_fail_buttons" />
-
- <TextureView
- android:id="@+id/texture_view"
+ android:layout_height="match_parent">
+ <RelativeLayout app:layout_box="all"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_below="@id/pass_fail_buttons" />
+ android:layout_height="match_parent" >
-</RelativeLayout>
+ <include
+ android:id="@+id/pass_fail_buttons"
+ android:layout_gravity="top"
+ layout="@layout/pass_fail_buttons" />
+
+ <TextureView
+ android:id="@+id/texture_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_below="@id/pass_fail_buttons" />
+
+ </RelativeLayout>
+</android.support.wearable.view.BoxInsetLayout>
diff --git a/apps/CtsVerifier/res/layout/pass_fail_list.xml b/apps/CtsVerifier/res/layout/pass_fail_list.xml
index 0b247f4..cdd40e1 100644
--- a/apps/CtsVerifier/res/layout/pass_fail_list.xml
+++ b/apps/CtsVerifier/res/layout/pass_fail_list.xml
@@ -13,24 +13,30 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- >
+<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
- <ListView android:id="@id/android:list"
+ <LinearLayout app:layout_box="all"
+ android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_weight="1"
- />
+ >
- <TextView android:id="@id/android:empty"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- />
+ <ListView android:id="@id/android:list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ />
- <include layout="@layout/pass_fail_buttons" />
+ <TextView android:id="@id/android:empty"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ />
-</LinearLayout>
+ <include layout="@layout/pass_fail_buttons" />
+
+ </LinearLayout>
+</android.support.wearable.view.BoxInsetLayout>
diff --git a/apps/CtsVerifier/res/layout/poa_main.xml b/apps/CtsVerifier/res/layout/poa_main.xml
index 578a6a6..41bade0 100644
--- a/apps/CtsVerifier/res/layout/poa_main.xml
+++ b/apps/CtsVerifier/res/layout/poa_main.xml
@@ -13,17 +13,22 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
+<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <LinearLayout app:layout_box="all"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
- <include layout="@layout/pass_fail_buttons" />
+ <include layout="@layout/pass_fail_buttons" />
- <TextView
- android:id="@+id/poa_status_text"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:textAppearance="@style/InstructionsFont" />
+ <TextView
+ android:id="@+id/poa_status_text"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:textAppearance="@style/InstructionsFont" />
-</LinearLayout>
\ No newline at end of file
+ </LinearLayout>
+</android.support.wearable.view.BoxInsetLayout>
diff --git a/apps/CtsVerifier/res/layout/pwa_widgets.xml b/apps/CtsVerifier/res/layout/pwa_widgets.xml
index 4bfcec6..537fc32 100644
--- a/apps/CtsVerifier/res/layout/pwa_widgets.xml
+++ b/apps/CtsVerifier/res/layout/pwa_widgets.xml
@@ -13,16 +13,19 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
- android:layout_height="match_parent" >
+ android:layout_height="match_parent">
<TextureView
+ app:layout_box="all"
android:id="@+id/texture_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
+ app:layout_box="all"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
@@ -70,4 +73,4 @@
</LinearLayout>
</LinearLayout>
-</FrameLayout>
+</android.support.wearable.view.BoxInsetLayout>
diff --git a/apps/CtsVerifier/src/android/support/wearable/view/BoxInsetLayout.java b/apps/CtsVerifier/src/android/support/wearable/view/BoxInsetLayout.java
index 95bac11..81e6dd0 100644
--- a/apps/CtsVerifier/src/android/support/wearable/view/BoxInsetLayout.java
+++ b/apps/CtsVerifier/src/android/support/wearable/view/BoxInsetLayout.java
@@ -18,6 +18,8 @@
import com.android.cts.verifier.R;
+import android.annotation.TargetApi;
+import android.os.Build;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Rect;
@@ -38,6 +40,7 @@
* The {@code layout_box} attribute is ignored on a device with a rectangular
* screen.
*/
+@TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
public class BoxInsetLayout extends FrameLayout {
private static float FACTOR = 0.146467f; //(1 - sqrt(2)/2)/2
@@ -187,9 +190,9 @@
int totalMargin = 0;
// BoxInset is a padding. Ignore margin when we want to do BoxInset.
if (mLastKnownRound && ((lp.boxedEdges & LayoutParams.BOX_LEFT) != 0)) {
- totalPadding = boxInset;
+ totalPadding += boxInset;
} else {
- totalMargin = plwf + lp.leftMargin;
+ totalMargin += plwf + lp.leftMargin;
}
if (mLastKnownRound && ((lp.boxedEdges & LayoutParams.BOX_RIGHT) != 0)) {
totalPadding += boxInset;
@@ -206,10 +209,12 @@
}
// adjust height
+ totalPadding = 0;
+ totalMargin = 0;
if (mLastKnownRound && ((lp.boxedEdges & LayoutParams.BOX_TOP) != 0)) {
- totalPadding = boxInset;
+ totalPadding += boxInset;
} else {
- totalMargin = ptwf + lp.topMargin;
+ totalMargin += ptwf + lp.topMargin;
}
if (mLastKnownRound && ((lp.boxedEdges & LayoutParams.BOX_BOTTOM) != 0)) {
totalPadding += boxInset;
@@ -236,7 +241,7 @@
}
private void layoutBoxChildren(int left, int top, int right, int bottom,
- boolean forceLeftGravity) {
+ boolean forceLeftGravity) {
final int count = getChildCount();
int boxInset = (int)(FACTOR * Math.max(right - left, bottom - top));
@@ -272,55 +277,79 @@
int paddingTop = child.getPaddingTop();
int paddingBottom = child.getPaddingBottom();
- switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) {
- case Gravity.CENTER_HORIZONTAL:
- childLeft = parentLeft + (parentRight - parentLeft - width) / 2 +
- lp.leftMargin - lp.rightMargin;
- break;
- case Gravity.RIGHT:
- if (!forceLeftGravity) {
- if (mLastKnownRound
- && ((lp.boxedEdges & LayoutParams.BOX_RIGHT) != 0)) {
- paddingRight = boxInset;
- childLeft = right - left - width;
- } else {
- childLeft = parentRight - width - lp.rightMargin;
- }
+ // If the child's width is match_parent, we ignore gravity and set boxInset padding
+ // on both sides, with a left position of 0.
+ if (lp.width == LayoutParams.MATCH_PARENT) {
+ if (mLastKnownRound && ((lp.boxedEdges & LayoutParams.BOX_LEFT) != 0)) {
+ paddingLeft = boxInset;
+ }
+ if (mLastKnownRound && ((lp.boxedEdges & LayoutParams.BOX_RIGHT) != 0)) {
+ paddingRight = boxInset;
+ }
+ childLeft = 0;
+ } else {
+ switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) {
+ case Gravity.CENTER_HORIZONTAL:
+ childLeft = parentLeft + (parentRight - parentLeft - width) / 2 +
+ lp.leftMargin - lp.rightMargin;
break;
- }
- case Gravity.LEFT:
- default:
- if (mLastKnownRound && ((lp.boxedEdges & LayoutParams.BOX_LEFT) != 0)) {
- paddingLeft = boxInset;
- childLeft = 0;
- } else {
- childLeft = parentLeft + lp.leftMargin;
- }
+ case Gravity.RIGHT:
+ if (!forceLeftGravity) {
+ if (mLastKnownRound
+ && ((lp.boxedEdges & LayoutParams.BOX_RIGHT) != 0)) {
+ paddingRight = boxInset;
+ childLeft = right - left - width;
+ } else {
+ childLeft = parentRight - width - lp.rightMargin;
+ }
+ break;
+ }
+ case Gravity.LEFT:
+ default:
+ if (mLastKnownRound && ((lp.boxedEdges & LayoutParams.BOX_LEFT) != 0)) {
+ paddingLeft = boxInset;
+ childLeft = 0;
+ } else {
+ childLeft = parentLeft + lp.leftMargin;
+ }
+ }
}
- switch (verticalGravity) {
- case Gravity.TOP:
- if (mLastKnownRound && ((lp.boxedEdges & LayoutParams.BOX_TOP) != 0)) {
- paddingTop = boxInset;
- childTop = 0;
- } else {
+ // If the child's height is match_parent, we ignore gravity and set boxInset padding
+ // on both top and bottom, with a top position of 0.
+ if (lp.height == LayoutParams.MATCH_PARENT) {
+ if (mLastKnownRound && ((lp.boxedEdges & LayoutParams.BOX_TOP) != 0)) {
+ paddingTop = boxInset;
+ }
+ if (mLastKnownRound && ((lp.boxedEdges & LayoutParams.BOX_BOTTOM) != 0)) {
+ paddingBottom = boxInset;
+ }
+ childTop = 0;
+ } else {
+ switch (verticalGravity) {
+ case Gravity.TOP:
+ if (mLastKnownRound && ((lp.boxedEdges & LayoutParams.BOX_TOP) != 0)) {
+ paddingTop = boxInset;
+ childTop = 0;
+ } else {
+ childTop = parentTop + lp.topMargin;
+ }
+ break;
+ case Gravity.CENTER_VERTICAL:
+ childTop = parentTop + (parentBottom - parentTop - height) / 2 +
+ lp.topMargin - lp.bottomMargin;
+ break;
+ case Gravity.BOTTOM:
+ if (mLastKnownRound && ((lp.boxedEdges & LayoutParams.BOX_BOTTOM) != 0)) {
+ paddingBottom = boxInset;
+ childTop = bottom - top - height;
+ } else {
+ childTop = parentBottom - height - lp.bottomMargin;
+ }
+ break;
+ default:
childTop = parentTop + lp.topMargin;
- }
- break;
- case Gravity.CENTER_VERTICAL:
- childTop = parentTop + (parentBottom - parentTop - height) / 2 +
- lp.topMargin - lp.bottomMargin;
- break;
- case Gravity.BOTTOM:
- if (mLastKnownRound && ((lp.boxedEdges & LayoutParams.BOX_BOTTOM) != 0)) {
- paddingBottom = boxInset;
- childTop = bottom - top - height;
- } else {
- childTop = parentBottom - height - lp.bottomMargin;
- }
- break;
- default:
- childTop = parentTop + lp.topMargin;
+ }
}
child.setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom);