Xml文件  |  66行  |  2.72 KB

<!--
  ~ Copyright (C) 2019 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
  -->
<!-- Bubble dismiss target consisting of an X icon and the text 'Dismiss'. -->
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="@dimen/pip_dismiss_gradient_height"
    android:layout_gravity="bottom|center_horizontal">

    <LinearLayout
        android:id="@+id/bubble_dismiss_icon_container"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:gravity="center"
        android:paddingBottom="@dimen/bubble_dismiss_target_padding_y"
        android:paddingTop="@dimen/bubble_dismiss_target_padding_y"
        android:paddingLeft="@dimen/bubble_dismiss_target_padding_x"
        android:paddingRight="@dimen/bubble_dismiss_target_padding_x"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/bubble_dismiss_close_icon"
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:src="@drawable/bubble_dismiss_icon" />

        <TextView
            android:id="@+id/bubble_dismiss_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="9dp"
            android:layout_marginBottom="9dp"
            android:layout_marginLeft="8dp"
            android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
            android:textColor="@android:color/white"
            android:shadowColor="@android:color/black"
            android:shadowDx="-1"
            android:shadowDy="1"
            android:shadowRadius="0.01"
            android:text="@string/bubble_dismiss_text" />

    </LinearLayout>

    <FrameLayout
        android:id="@+id/bubble_dismiss_circle"
        android:layout_width="@dimen/bubble_dismiss_encircle_size"
        android:layout_height="@dimen/bubble_dismiss_encircle_size"
        android:layout_gravity="center"
        android:alpha="0"
        android:background="@drawable/bubble_dismiss_circle" />
</FrameLayout>