• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2012 The Android Open Source Project
3
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7
8          http://www.apache.org/licenses/LICENSE-2.0
9
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15-->
16
17<!-- BEGIN_INCLUDE(complete) -->
18<!-- This layout is designed for use with FLAG_LAYOUT_IN_OVERSCAN, so its window will
19     be placed into the overscan region of the display (if there is one).  Thus the contents
20     of the top-level view may be obscured around the edges by the display, leaving the
21     edge of the box background used here invisible. -->
22<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
23    android:layout_width="match_parent"
24    android:layout_height="match_parent"
25    android:background="@drawable/box_white">
26
27    <!-- This is still in the same position as the top-level FrameLayout, so the contentx
28        of this TextView may also be obscured. -->
29    <TextView
30        android:layout_width="wrap_content"
31        android:layout_height="wrap_content"
32        android:layout_marginTop="3dp"
33        android:layout_marginLeft="3dp"
34        android:textAppearance="?android:attr/textAppearanceMedium"
35        android:text="Overscan" />
36
37    <!-- This FrameLayout uses android:fitsSystemWindows to have its padding adjusted so
38         that within that space its content is offset to not be obscured by the overscan
39         region (or also system decors that are covering its UI. -->
40    <FrameLayout
41        android:layout_width="match_parent"
42        android:layout_height="match_parent"
43        android:fitsSystemWindows="true">
44
45        <!-- Now that we are within the padding region of the parent FrameLayout, we can
46             safely place content that will be visible to the user. -->
47        <ImageView
48            android:layout_width="match_parent"
49            android:layout_height="match_parent"
50            android:src="@drawable/frantic"
51            android:scaleType="fitXY" />
52        <ImageView
53            android:layout_width="match_parent"
54            android:layout_height="match_parent"
55            android:background="@drawable/box_white" />
56        <TextView
57            android:layout_width="wrap_content"
58            android:layout_height="wrap_content"
59            android:layout_marginTop="3dp"
60            android:layout_marginLeft="3dp"
61            android:textAppearance="?android:attr/textAppearanceMedium"
62            android:text="Content" />
63
64    </FrameLayout>
65
66</FrameLayout>
67<!-- END_INCLUDE(complete) -->
68