summaryrefslogtreecommitdiffstats
path: root/tests/GridLayoutTest/res
diff options
context:
space:
mode:
authorPhilip Milne <pmilne@google.com>2012-04-04 23:41:34 -0700
committerPhilip Milne <pmilne@google.com>2012-04-13 16:25:08 -0700
commit1557fd7809078e421f751efc7d2539b3efdc54b2 (patch)
tree90f58eac3acab19fa61719219814acc7d6683dcd /tests/GridLayoutTest/res
parentc58a6d2da4790921743bdb4997ee59f8be1632e3 (diff)
downloadframeworks_base-1557fd7809078e421f751efc7d2539b3efdc54b2.zip
frameworks_base-1557fd7809078e421f751efc7d2539b3efdc54b2.tar.gz
frameworks_base-1557fd7809078e421f751efc7d2539b3efdc54b2.tar.bz2
Fix for bug 6110465.
Add layout bound metadata to 9-patch files and make layouts take them into account. This CL contains a proposed API for dealing with layout bounds. This solution exposes: 1. Class: Insets - for storing layout Insets (and later possibly padding). 2. Methods: View:(get/set)LayoutInsets() - for storing layoutBounds. 3. Methods: ViewGroup:(get/set)LayoutMode() - for controlling layoutMode. It also iuncudes the changes to GridLayout to support layout bounds. Change-Id: I60c836b6530b61c5abf37f93ee9c44aad73573f1
Diffstat (limited to 'tests/GridLayoutTest/res')
-rw-r--r--tests/GridLayoutTest/res/drawable/btn_default.xml33
-rw-r--r--tests/GridLayoutTest/res/drawable/my_btn_default_normal.9.pngbin0 -> 1269 bytes
-rwxr-xr-xtests/GridLayoutTest/res/drawable/my_btn_default_normal_disable.9.pngbin0 -> 3601 bytes
-rwxr-xr-xtests/GridLayoutTest/res/drawable/my_btn_default_normal_disable_focused.9.pngbin0 -> 1781 bytes
-rwxr-xr-xtests/GridLayoutTest/res/drawable/my_btn_default_pressed.9.pngbin0 -> 1913 bytes
-rwxr-xr-xtests/GridLayoutTest/res/drawable/my_btn_default_selected.9.pngbin0 -> 1507 bytes
-rw-r--r--tests/GridLayoutTest/res/layout/grid7.xml2
7 files changed, 34 insertions, 1 deletions
diff --git a/tests/GridLayoutTest/res/drawable/btn_default.xml b/tests/GridLayoutTest/res/drawable/btn_default.xml
new file mode 100644
index 0000000..c6cfda0
--- /dev/null
+++ b/tests/GridLayoutTest/res/drawable/btn_default.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_window_focused="false" android:state_enabled="true"
+ android:drawable="@drawable/my_btn_default_normal" />
+ <item android:state_window_focused="false" android:state_enabled="false"
+ android:drawable="@drawable/my_btn_default_normal" />
+ <item android:state_pressed="true"
+ android:drawable="@drawable/my_btn_default_pressed" />
+ <item android:state_focused="true" android:state_enabled="true"
+ android:drawable="@drawable/my_btn_default_selected" />
+ <item android:state_enabled="true"
+ android:drawable="@drawable/my_btn_default_normal" />
+ <item android:state_focused="true"
+ android:drawable="@drawable/my_btn_default_normal_disable_focused" />
+ <item
+ android:drawable="@drawable/my_btn_default_normal_disable" />
+</selector>
diff --git a/tests/GridLayoutTest/res/drawable/my_btn_default_normal.9.png b/tests/GridLayoutTest/res/drawable/my_btn_default_normal.9.png
new file mode 100644
index 0000000..cd0b7d5
--- /dev/null
+++ b/tests/GridLayoutTest/res/drawable/my_btn_default_normal.9.png
Binary files differ
diff --git a/tests/GridLayoutTest/res/drawable/my_btn_default_normal_disable.9.png b/tests/GridLayoutTest/res/drawable/my_btn_default_normal_disable.9.png
new file mode 100755
index 0000000..f4f01c7
--- /dev/null
+++ b/tests/GridLayoutTest/res/drawable/my_btn_default_normal_disable.9.png
Binary files differ
diff --git a/tests/GridLayoutTest/res/drawable/my_btn_default_normal_disable_focused.9.png b/tests/GridLayoutTest/res/drawable/my_btn_default_normal_disable_focused.9.png
new file mode 100755
index 0000000..5376db2
--- /dev/null
+++ b/tests/GridLayoutTest/res/drawable/my_btn_default_normal_disable_focused.9.png
Binary files differ
diff --git a/tests/GridLayoutTest/res/drawable/my_btn_default_pressed.9.png b/tests/GridLayoutTest/res/drawable/my_btn_default_pressed.9.png
new file mode 100755
index 0000000..4312c27
--- /dev/null
+++ b/tests/GridLayoutTest/res/drawable/my_btn_default_pressed.9.png
Binary files differ
diff --git a/tests/GridLayoutTest/res/drawable/my_btn_default_selected.9.png b/tests/GridLayoutTest/res/drawable/my_btn_default_selected.9.png
new file mode 100755
index 0000000..06b7790
--- /dev/null
+++ b/tests/GridLayoutTest/res/drawable/my_btn_default_selected.9.png
Binary files differ
diff --git a/tests/GridLayoutTest/res/layout/grid7.xml b/tests/GridLayoutTest/res/layout/grid7.xml
index b9e58d7..0e5be0c 100644
--- a/tests/GridLayoutTest/res/layout/grid7.xml
+++ b/tests/GridLayoutTest/res/layout/grid7.xml
@@ -17,7 +17,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
- android:columnCount="2"
+
<Space
android:layout_row="0"
android:layout_column="0"