Shows the ideal way for a game to interact with system UI, hiding the status bar and nav bar while being played, making them visible when paused or otherwise interacting with controls of the game, and determing layout of game controls to not be covered by the status bar or nav bar. Change-Id: Ia192c31321113d81f96c06c7a69a06ef72c4682a
49 lines
2.0 KiB
XML
49 lines
2.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- Copyright (C) 2013 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.
|
|
-->
|
|
|
|
<!-- BEGIN_INCLUDE(complete) -->
|
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
android:layout_width="match_parent" android:layout_height="match_parent"
|
|
>
|
|
<!-- This is the outer area of the entire game screen, extending out under
|
|
system UI elements. -->
|
|
<view class="com.example.android.apis.view.GameActivity$Content"
|
|
android:id="@+id/content"
|
|
android:src="@drawable/frantic"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:scaleType="center"
|
|
/>
|
|
<!-- This is the inner area of the game, not covered by system UI elements.
|
|
Any UI elements that need to be accessible when the game is paused or other
|
|
states where the system UI is shown (such as in menus) should go here. -->
|
|
<FrameLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:fitsSystemWindows="true"
|
|
android:animateLayoutChanges="true"
|
|
>
|
|
<Button
|
|
android:id="@+id/play"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="top|right"
|
|
android:textSize="28dp"
|
|
/>
|
|
</FrameLayout>
|
|
</FrameLayout>
|
|
<!-- END_INCLUDE(complete) -->
|