diff options
author | Shailen Tuli <shailentuli@google.com> | 2016-09-04 14:31:55 -0700 |
---|---|---|
committer | Trevor Johns <trevorjohns@google.com> | 2017-02-27 20:15:01 +0000 |
commit | 2aa89c5a29f849f7d234c9f40554de9a1b712f76 (patch) | |
tree | c302b25a76b481df96469b4135b25e270b08d592 /accessibility/CheckableLayout/Application/src/main/res/layout/activity_main.xml | |
parent | 6328a9cd6c34f46961927759a8735eca8997b7f5 (diff) | |
download | android-2aa89c5a29f849f7d234c9f40554de9a1b712f76.tar.gz |
Created CheckableLayout accessibility sample
Bug: 35802085
Change-Id: I914efeb351c242c570bcdd7e274957c7d9f60278
Diffstat (limited to 'accessibility/CheckableLayout/Application/src/main/res/layout/activity_main.xml')
-rw-r--r-- | accessibility/CheckableLayout/Application/src/main/res/layout/activity_main.xml | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/accessibility/CheckableLayout/Application/src/main/res/layout/activity_main.xml b/accessibility/CheckableLayout/Application/src/main/res/layout/activity_main.xml new file mode 100644 index 00000000..18b0f4b3 --- /dev/null +++ b/accessibility/CheckableLayout/Application/src/main/res/layout/activity_main.xml @@ -0,0 +1,51 @@ +<!-- + Copyright 2016 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. + --> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:paddingBottom="@dimen/activity_vertical_margin" + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="@dimen/activity_horizontal_margin" + android:paddingTop="@dimen/activity_vertical_margin" + tools:context="com.example.android.checkablelayout.MainActivity"> + + + <com.example.android.checkablelayout.CheckableFrameLayout + android:id="@+id/frame_layout" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:focusable="true"> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:contentDescription="@string/birch_leaves" + android:scaleType="centerInside" + android:src="@drawable/birch_leaves" /> + + <!-- + This ImageView uses `android:duplicateParentState` and a drawable tied to + android:state_checked, causing the checked image to display only when the parent is checked. + --> + <ImageView + android:layout_width="@dimen/check_dimen" + android:layout_height="@dimen/check_dimen" + android:layout_gravity="center" + android:duplicateParentState="true" + android:src="@drawable/ic_checkable_item" /> + </com.example.android.checkablelayout.CheckableFrameLayout> + +</LinearLayout> |