Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d282d84 authored by Maryam Dehaini's avatar Maryam Dehaini Committed by Android (Google) Code Review
Browse files

Merge "Capture links in window decoration" into main

parents 2cf971dd 15380dcf
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.graphics.Point;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Build;
import android.os.IBinder;
import android.os.Parcel;
@@ -302,6 +303,19 @@ public class TaskInfo {
     */
    public boolean isTopActivityStyleFloating;

    /**
     * The URI of the intent that generated the top-most activity opened using a URL.
     * @hide
     */
    @Nullable
    public Uri capturedLink;

    /**
     * The time of the last launch of the activity opened using the {@link #capturedLink}.
     * @hide
     */
    public long capturedLinkTimestamp;

    /**
     * Encapsulate specific App Compat information.
     * @hide
@@ -436,6 +450,8 @@ public class TaskInfo {
                && Objects.equals(topActivity, that.topActivity)
                && isTopActivityTransparent == that.isTopActivityTransparent
                && isTopActivityStyleFloating == that.isTopActivityStyleFloating
                && Objects.equals(capturedLink, that.capturedLink)
                && capturedLinkTimestamp == that.capturedLinkTimestamp
                && appCompatTaskInfo.equalsForTaskOrganizer(that.appCompatTaskInfo);
    }

@@ -506,6 +522,8 @@ public class TaskInfo {
        displayAreaFeatureId = source.readInt();
        isTopActivityTransparent = source.readBoolean();
        isTopActivityStyleFloating = source.readBoolean();
        capturedLink = source.readTypedObject(Uri.CREATOR);
        capturedLinkTimestamp = source.readLong();
        appCompatTaskInfo = source.readTypedObject(AppCompatTaskInfo.CREATOR);
    }

@@ -554,6 +572,8 @@ public class TaskInfo {
        dest.writeInt(displayAreaFeatureId);
        dest.writeBoolean(isTopActivityTransparent);
        dest.writeBoolean(isTopActivityStyleFloating);
        dest.writeTypedObject(capturedLink, flags);
        dest.writeLong(capturedLinkTimestamp);
        dest.writeTypedObject(appCompatTaskInfo, flags);
    }

@@ -592,6 +612,8 @@ public class TaskInfo {
                + " displayAreaFeatureId=" + displayAreaFeatureId
                + " isTopActivityTransparent=" + isTopActivityTransparent
                + " isTopActivityStyleFloating=" + isTopActivityStyleFloating
                + " capturedLink=" + capturedLink
                + " capturedLinkTimestamp=" + capturedLinkTimestamp
                + " appCompatTaskInfo=" + appCompatTaskInfo
                + "}";
    }
+19 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2024 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.
  -->

<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="960" android:viewportHeight="960" android:tint="?attr/colorControlNormal">
    <path android:fillColor="@android:color/black" android:pathData="M160,880Q127,880 103.5,856.5Q80,833 80,800L80,440Q80,407 103.5,383.5Q127,360 160,360L240,360L240,160Q240,127 263.5,103.5Q287,80 320,80L800,80Q833,80 856.5,103.5Q880,127 880,160L880,520Q880,553 856.5,576.5Q833,600 800,600L720,600L720,800Q720,833 696.5,856.5Q673,880 640,880L160,880ZM160,800L640,800Q640,800 640,800Q640,800 640,800L640,520L160,520L160,800Q160,800 160,800Q160,800 160,800ZM720,520L800,520Q800,520 800,520Q800,520 800,520L800,240L320,240L320,360L640,360Q673,360 696.5,383.5Q720,407 720,440L720,520Z"/>
</vector>
+19 −0
Original line number Diff line number Diff line
@@ -135,5 +135,24 @@
            android:drawableTint="?androidprv:attr/materialColorOnSurface"
            style="@style/DesktopModeHandleMenuActionButton"/>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/open_in_browser_pill"
        android:layout_width="match_parent"
        android:layout_height="@dimen/desktop_mode_handle_menu_open_in_browser_pill_height"
        android:layout_marginTop="@dimen/desktop_mode_handle_menu_pill_spacing_margin"
        android:layout_marginStart="1dp"
        android:orientation="vertical"
        android:elevation="1dp"
        android:background="@drawable/desktop_mode_decor_handle_menu_background">

        <Button
            android:id="@+id/open_in_browser_button"
            android:contentDescription="@string/open_in_browser_text"
            android:text="@string/open_in_browser_text"
            android:drawableStart="@drawable/desktop_mode_ic_handle_menu_open_in_browser"
            android:drawableTint="?androidprv:attr/materialColorOnSurface"
            style="@style/DesktopModeHandleMenuActionButton"/>
    </LinearLayout>
</LinearLayout>
+4 −1
Original line number Diff line number Diff line
@@ -507,8 +507,11 @@
    <!-- The height of the handle menu's "More Actions" pill in desktop mode. -->
    <dimen name="desktop_mode_handle_menu_more_actions_pill_height">52dp</dimen>

    <!-- The height of the handle menu's "Open in browser" pill in desktop mode. -->
    <dimen name="desktop_mode_handle_menu_open_in_browser_pill_height">52dp</dimen>

    <!-- The height of the handle menu in desktop mode. -->
    <dimen name="desktop_mode_handle_menu_height">328dp</dimen>
    <dimen name="desktop_mode_handle_menu_height">380dp</dimen>

    <!-- The top margin of the handle menu in desktop mode. -->
    <dimen name="desktop_mode_handle_menu_margin_top">4dp</dimen>
+2 −0
Original line number Diff line number Diff line
@@ -280,6 +280,8 @@
    <string name="select_text">Select</string>
    <!-- Accessibility text for the handle menu screenshot button [CHAR LIMIT=NONE] -->
    <string name="screenshot_text">Screenshot</string>
    <!-- Accessibility text for the handle menu open in browser button [CHAR LIMIT=NONE] -->
    <string name="open_in_browser_text">Open in browser</string>
    <!-- Accessibility text for the handle menu close button [CHAR LIMIT=NONE] -->
    <string name="close_text">Close</string>
    <!-- Accessibility text for the handle menu close menu button [CHAR LIMIT=NONE] -->
Loading