Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
cts
Commits
febcfac8
Commit
febcfac8
authored
10 years ago
by
Michael Kwan
Browse files
Options
Download
Email Patches
Plain Diff
Added wrapping padding for round screens.
Bug: 18444851 Change-Id: I3b938979c0de280355b43d8965ab28b7c21adb50
parent
bb702a48
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
611 additions
and
512 deletions
+611
-512
apps/CtsVerifier/res/layout-land/sensor_test.xml
apps/CtsVerifier/res/layout-land/sensor_test.xml
+35
-30
apps/CtsVerifier/res/layout-port/sensor_test.xml
apps/CtsVerifier/res/layout-port/sensor_test.xml
+29
-24
apps/CtsVerifier/res/layout/ca_boot_notify.xml
apps/CtsVerifier/res/layout/ca_boot_notify.xml
+47
-43
apps/CtsVerifier/res/layout/ca_main.xml
apps/CtsVerifier/res/layout/ca_main.xml
+61
-58
apps/CtsVerifier/res/layout/cainstallnotify_main.xml
apps/CtsVerifier/res/layout/cainstallnotify_main.xml
+26
-21
apps/CtsVerifier/res/layout/fs_main.xml
apps/CtsVerifier/res/layout/fs_main.xml
+31
-26
apps/CtsVerifier/res/layout/intent_driven_test.xml
apps/CtsVerifier/res/layout/intent_driven_test.xml
+30
-24
apps/CtsVerifier/res/layout/js_charging.xml
apps/CtsVerifier/res/layout/js_charging.xml
+60
-56
apps/CtsVerifier/res/layout/js_connectivity.xml
apps/CtsVerifier/res/layout/js_connectivity.xml
+72
-67
apps/CtsVerifier/res/layout/js_idle.xml
apps/CtsVerifier/res/layout/js_idle.xml
+56
-52
apps/CtsVerifier/res/layout/location_mode_main.xml
apps/CtsVerifier/res/layout/location_mode_main.xml
+26
-21
apps/CtsVerifier/res/layout/pa_main.xml
apps/CtsVerifier/res/layout/pa_main.xml
+17
-12
apps/CtsVerifier/res/layout/pass_fail_list.xml
apps/CtsVerifier/res/layout/pass_fail_list.xml
+21
-15
apps/CtsVerifier/res/layout/poa_main.xml
apps/CtsVerifier/res/layout/poa_main.xml
+16
-11
apps/CtsVerifier/res/layout/pwa_widgets.xml
apps/CtsVerifier/res/layout/pwa_widgets.xml
+6
-3
apps/CtsVerifier/src/android/support/wearable/view/BoxInsetLayout.java
...ier/src/android/support/wearable/view/BoxInsetLayout.java
+78
-49
No files found.
apps/CtsVerifier/res/layout-land/sensor_test.xml
View file @
febcfac8
...
...
@@ -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"
>
<ScrollView
android:id=
"@+id/log_scroll_view"
android:fillViewport=
"true"
android:layout_height=
"match_parent"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
>
<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>
</LinearLayout>
<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"
/>
<
include
layout=
"@layout/snsr_next_button"
/
>
<
/LinearLayout
>
</LinearLayout>
<include
layout=
"@layout/snsr_next_button"
/>
</LinearLayout>
</android.support.wearable.view.BoxInsetLayout>
This diff is collapsed.
Click to expand it.
apps/CtsVerifier/res/layout-port/sensor_test.xml
View file @
febcfac8
...
...
@@ -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"
>
<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"
<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"
>
<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>
This diff is collapsed.
Click to expand it.
apps/CtsVerifier/res/layout/ca_boot_notify.xml
View file @
febcfac8
...
...
@@ -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"
>
<ScrollView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_alignParentTop=
"true"
>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:orientation=
"vertical"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:orientation=
"vertical"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
>
<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/check_cert_desc"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/caboot_check_cert_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/check_creds"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/caboot_check_creds"
/>
<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/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/install"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/caboot_install_cert"
/>
<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/reboot"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/caboot_reboot_desc"
/>
<TextView
android:id=
"@+id/reboot"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/caboot_reboot_desc"
/>
<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/after_reboot"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/caboot_after_boot"
/>
<include
layout=
"@layout/pass_fail_buttons"
/>
<include
layout=
"@layout/pass_fail_buttons"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
</ScrollView>
</LinearLayout>
</android.support.wearable.view.BoxInsetLayout>
This diff is collapsed.
Click to expand it.
apps/CtsVerifier/res/layout/ca_main.xml
View file @
febcfac8
...
...
@@ -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"
>
<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/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/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"
>
<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"
>
<ListView
android:id=
"@+id/ca_tests"
<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"
/>
<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/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>
<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"
/>
<LinearLayout
android:orientation=
"vertical"
android:layout_width=
"fill_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
>
<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>
</LinearLayout>
</LinearLayout>
<include
layout=
"@layout/pass_fail_buttons"
/>
</LinearLayout>
<include
layout=
"@layout/pass_fail_buttons"
/>
</LinearLayout>
</android.support.wearable.view.BoxInsetLayout>
This diff is collapsed.
Click to expand it.
apps/CtsVerifier/res/layout/cainstallnotify_main.xml
View file @
febcfac8
...
...
@@ -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=
"
wrap_content
"
android:
orientation=
"vertical"
>
</LinearLayout>
</ScrollView
>
android:layout_height=
"
0dp
"
android:
layout_weight=
"1"
android:orientation=
"vertical"
android:padding=
"10dip"
>
<include
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"0"
layout=
"@layout/pass_fail_buttons"
/>
<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:layout_weight=
"0"
layout=
"@layout/pass_fail_buttons"
/>
</LinearLayout>
\ No newline at end of file
</LinearLayout>
</android.support.wearable.view.BoxInsetLayout>
This diff is collapsed.
Click to expand it.
apps/CtsVerifier/res/layout/fs_main.xml
View file @
febcfac8
...
...
@@ -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"
>
<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"
/>
<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"
/>
</LinearLayout>
<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"
/>
<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"
/>
<include
layout=
"@layout/pass_fail_buttons"
/>
</LinearLayout>
</android.support.wearable.view.BoxInsetLayout>
This diff is collapsed.
Click to expand it.
apps/CtsVerifier/res/layout/intent_driven_test.xml
View file @
febcfac8
<?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>
This diff is collapsed.
Click to expand it.
apps/CtsVerifier/res/layout/js_charging.xml
View file @
febcfac8
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:a
ndroid
=
"http://schemas.android.com/apk/res
/android
"
<android.support.wearable.view.BoxInsetLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:a
pp
=
"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: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"
android:layout_width=
"wrap_content"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:
src=
"@drawable/fs_indeterminate
"
android:layout_margin
Right
=
"@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: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: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:layout_marginTop=
"@dimen/js_padding"
android:layout_marginBottom=
"@dimen/js_padding"
>
<ImageView
android:id=
"@+id/charging_on_test_image"
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: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_on_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>
<include
layout=
"@layout/pass_fail_buttons"
/>
</LinearLayout>
</ScrollView>
\ No newline at end of file
</ScrollView>
</android.support.wearable.view.BoxInsetLayout>
This diff is collapsed.
Click to expand it.
apps/CtsVerifier/res/layout/js_connectivity.xml
View file @
febcfac8
<?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:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<TextView
android:layout_width=
"match_parent"
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=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
android:layout_height=
"wrap_content"
android:text=
"@string/js_
unmetered_
connectivity_
t
es
t
"
android:
textSize=
"16dp"
/>
</LinearLayout
>
android:text=
"@string/js_connectivity_
d
es
cription_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_any_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_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:text=
"@string/js_any_connectivity_test"
android:textSize=
"16dp"
/>
</LinearLayout>
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_no_connectivity_image"
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/fs_indeterminate"
android:layout_marginRight=
"@dimen/js_padding"
/>
<TextView
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:text=
"@string/js_no_connectivity_test"
android:textSize=
"16dp"
/>
</LinearLayout>
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>
\ No newline at end of file
<include
layout=
"@layout/pass_fail_buttons"
/>
</LinearLayout>
</ScrollView>
</android.support.wearable.view.BoxInsetLayout>
This diff is collapsed.
Click to expand it.
apps/CtsVerifier/res/layout/js_idle.xml
View file @
febcfac8
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:a
ndroid
=
"http://schemas.android.com/apk/res
/android
"
<android.support.wearable.view.BoxInsetLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:a
pp
=
"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:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:
src=
"@drawable/fs_indeterminate
"
android:layout_margin
Right
=
"@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_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_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:src=
"@drawable/fs_indeterminate"
android:layout_marginRight=
"@dimen/js_padding"
/>
<TextView
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:text=
"@string/js_idle_item_idle_on"
android:textSize=
"16dp"
/>
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>
This diff is collapsed.
Click to expand it.
apps/CtsVerifier/res/layout/location_mode_main.xml
View file @
febcfac8
...
...
@@ -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=
"
wrap_content
"
android:
orientation=
"vertical"
>
</LinearLayout>
</ScrollView
>
android:layout_height=
"
0dp
"
android:
layout_weight=
"1"
android:orientation=
"vertical"
android:padding=
"10dip"
>
<include
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"0"
layout=
"@layout/pass_fail_buttons"
/>
<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:layout_weight=
"0"
layout=
"@layout/pass_fail_buttons"
/>
</LinearLayout>
</LinearLayout>
</android.support.wearable.view.BoxInsetLayout>
This diff is collapsed.
Click to expand it.
apps/CtsVerifier/res/layout/pa_main.xml
View file @
febcfac8
...
...
@@ -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"
>
android:layout_height=
"match_parent"
>
<RelativeLayout
app:layout_box=
"all"
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"
/>
<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"
/>
<TextureView
android:id=
"@+id/texture_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_below=
"@id/pass_fail_buttons"
/>
</RelativeLayout>
</RelativeLayout>
</android.support.wearable.view.BoxInsetLayout>
This diff is collapsed.
Click to expand it.
apps/CtsVerifier/res/layout/pass_fail_list.xml
View file @
febcfac8
...
...
@@ -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"
/>
<TextView
android:id=
"@id/android:empty"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
/>
<include
layout=
"@layout/pass_fail_buttons"
/>
<include
layout=
"@layout/pass_fail_buttons"
/>
</LinearLayout>
</LinearLayout>
</android.support.wearable.view.BoxInsetLayout>
This diff is collapsed.
Click to expand it.
apps/CtsVerifier/res/layout/poa_main.xml
View file @
febcfac8
...
...
@@ -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>
This diff is collapsed.
Click to expand it.
apps/CtsVerifier/res/layout/pwa_widgets.xml
View file @
febcfac8
...
...
@@ -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>
</
Frame
Layout>
</
android.support.wearable.view.BoxInset
Layout>
This diff is collapsed.
Click to expand it.
apps/CtsVerifier/src/android/support/wearable/view/BoxInsetLayout.java
View file @
febcfac8
...
...
@@ -18,6 +18,8 @@ package android.support.wearable.view;
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 @@ import android.widget.FrameLayout;
* 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 @@ public class BoxInsetLayout extends FrameLayout {
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 @@ public class BoxInsetLayout extends FrameLayout {
}
// 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 @@ public class BoxInsetLayout extends FrameLayout {
}
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 @@ public class BoxInsetLayout extends FrameLayout {
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
;
// 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
.
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
=
parent
Right
-
width
-
lp
.
righ
tMargin
;
childLeft
=
parent
Left
+
lp
.
lef
tMargin
;
}
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
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment