Files
frameworks_base/libs/WindowManager/Shell/res/layout/pip_menu.xml
Hongwei Wang 1c2fd3aa7f Polish the PipMenuView when showing the controls
- Decreases the menu action size
- Wraps custom actions into PipMenuActionView and restricts the size
  to be identical to other PiP actions such as settings and dismiss
- Removed unused pip_menu_activity.xml layout

Screenshot: https://screenshot.googleplex.com/6LFk5WJFfC4FQyA.png
Bug: 179312210
Test: Enter PiP and tap to show controls, see screenshot
Change-Id: I9de63be60ff66ee5198785885a28d495f1fb7af3
2021-02-16 14:27:46 -08:00

101 lines
4.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 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.
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Menu layout -->
<FrameLayout
android:id="@+id/menu_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:forceHasOverlappingRendering="false"
android:accessibilityTraversalAfter="@id/dismiss">
<!-- The margins for this container is calculated in the code depending on whether the
actions_container is visible. -->
<FrameLayout
android:id="@+id/expand_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageButton
android:id="@+id/expand_button"
android:layout_width="@dimen/pip_expand_action_size"
android:layout_height="@dimen/pip_expand_action_size"
android:layout_gravity="center"
android:contentDescription="@string/pip_phone_expand"
android:gravity="center"
android:src="@drawable/pip_expand"
android:background="?android:selectableItemBackgroundBorderless" />
</FrameLayout>
<FrameLayout
android:id="@+id/actions_container"
android:layout_width="match_parent"
android:layout_height="@dimen/pip_action_size"
android:layout_gravity="bottom"
android:visibility="invisible">
<LinearLayout
android:id="@+id/actions_group"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:orientation="horizontal"
android:divider="@android:color/transparent"
android:showDividers="middle" />
</FrameLayout>
</FrameLayout>
<LinearLayout
android:id="@+id/top_end_container"
android:layout_gravity="top|end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageButton
android:id="@+id/settings"
android:layout_width="@dimen/pip_action_size"
android:layout_height="@dimen/pip_action_size"
android:contentDescription="@string/pip_phone_settings"
android:gravity="center"
android:src="@drawable/pip_ic_settings"
android:background="?android:selectableItemBackgroundBorderless" />
<ImageButton
android:id="@+id/dismiss"
android:layout_width="@dimen/pip_action_size"
android:layout_height="@dimen/pip_action_size"
android:contentDescription="@string/pip_phone_close"
android:gravity="center"
android:src="@drawable/pip_ic_close_white"
android:background="?android:selectableItemBackgroundBorderless" />
</LinearLayout>
<!--TODO (b/156917828): Add content description for a11y purposes?-->
<ImageButton
android:id="@+id/resize_handle"
android:layout_width="@dimen/pip_resize_handle_size"
android:layout_height="@dimen/pip_resize_handle_size"
android:layout_gravity="top|start"
android:layout_margin="@dimen/pip_resize_handle_margin"
android:padding="@dimen/pip_resize_handle_padding"
android:src="@drawable/pip_resize_handle"
android:background="?android:selectableItemBackgroundBorderless" />
</FrameLayout>