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

Commit d84bec20 authored by Nick Chameyev's avatar Nick Chameyev Committed by Automerger Merge Worker
Browse files

Merge "[Partial Screensharing] Add initial recents selector UI" into tm-qpr-dev am: 66e91066

parents 32b7c278 66e91066
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -1069,7 +1069,12 @@ public class ChooserActivity extends ResolverActivity implements
        }
    }

    private ViewGroup createContentPreviewView(ViewGroup parent) {
    /**
     * Create a view that will be shown in the content preview area
     * @param parent reference to the parent container where the view should be attached to
     * @return content preview view
     */
    protected ViewGroup createContentPreviewView(ViewGroup parent) {
        Intent targetIntent = getTargetIntent();
        int previewType = findPreferredContentPreview(targetIntent, getContentResolver());
        return displayContentPreview(previewType, targetIntent, getLayoutInflater(), parent);
@@ -2653,7 +2658,7 @@ public class ChooserActivity extends ResolverActivity implements

            boolean isExpandable = getResources().getConfiguration().orientation
                    == Configuration.ORIENTATION_PORTRAIT && !isInMultiWindowMode();
            if (directShareHeight != 0 && isSendAction(getTargetIntent())
            if (directShareHeight != 0 && shouldShowContentPreview()
                    && isExpandable) {
                // make sure to leave room for direct share 4->8 expansion
                int requiredExpansionHeight =
@@ -2901,7 +2906,14 @@ public class ChooserActivity extends ResolverActivity implements
        return shouldShowTabs()
                && mMultiProfilePagerAdapter.getListAdapterForUserHandle(
                UserHandle.of(UserHandle.myUserId())).getCount() > 0
                && isSendAction(getTargetIntent());
                && shouldShowContentPreview();
    }

    /**
     * @return true if we want to show the content preview area
     */
    protected boolean shouldShowContentPreview() {
        return isSendAction(getTargetIntent());
    }

    private void updateStickyContentPreview() {
@@ -3234,7 +3246,7 @@ public class ChooserActivity extends ResolverActivity implements
                return 0;
            }

            if (!isSendAction(getTargetIntent())) {
            if (!shouldShowContentPreview()) {
                return 0;
            }

@@ -3265,7 +3277,7 @@ public class ChooserActivity extends ResolverActivity implements
        // There can be at most one row in the listview, that is internally
        // a ViewGroup with 2 rows
        public int getServiceTargetRowCount() {
            if (isSendAction(getTargetIntent())
            if (shouldShowContentPreview()
                    && !ActivityManager.isLowRamDeviceStatic()) {
                return 1;
            }
+3 −2
Original line number Diff line number Diff line
@@ -36,13 +36,14 @@
        android:background="@*android:drawable/bottomsheet_background">

        <ImageView
            android:id="@*android:id/icon"
            android:layout_width="@dimen/media_projection_app_selector_icon_size"
            android:layout_height="@dimen/media_projection_app_selector_icon_size"
            android:layout_marginTop="@*android:dimen/chooser_edge_margin_normal"
            android:layout_marginBottom="@*android:dimen/chooser_edge_margin_normal"
            android:importantForAccessibility="no"
            android:tint="?android:attr/textColorPrimary"/>
            android:tint="?android:attr/textColorPrimary"
            android:src="@drawable/ic_present_to_all"
            />

        <TextView android:id="@*android:id/title"
            android:layout_height="wrap_content"
+54 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2022 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.
  -->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:orientation="vertical"
    android:background="?android:attr/colorBackground"
    >

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="256dp">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/media_projection_recent_tasks_recycler"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone"
            />

        <ProgressBar
            android:id="@+id/media_projection_recent_tasks_loader"
            android:layout_width="@dimen/media_projection_app_selector_loader_size"
            android:layout_height="@dimen/media_projection_app_selector_loader_size"
            android:layout_gravity="center"
            android:indeterminate="true"
            android:indeterminateOnly="true" />
    </FrameLayout>

    <!-- Divider line -->
    <ImageView
        android:layout_width="72dp"
        android:layout_height="2dp"
        android:layout_marginBottom="8dp"
        android:layout_marginTop="24dp"
        android:importantForAccessibility="no"
        android:src="@*android:drawable/ic_drag_handle"
        android:tint="?android:attr/textColorSecondary" />
</LinearLayout>
+38 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2022 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.
  -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:gravity="center"
    android:orientation="vertical">

    <ImageView
        android:id="@+id/task_icon"
        android:layout_width="24dp"
        android:layout_height="24dp"
        android:layout_margin="8dp"
        android:importantForAccessibility="no" />

    <!-- TODO(b/240924926) use a custom view that will handle thumbnail cropping correctly -->
    <!-- TODO(b/240924926) dynamically change the view size based on the screen size -->
    <ImageView
        android:id="@+id/task_thumbnail"
        android:layout_width="100dp"
        android:layout_height="216dp"
        android:scaleType="centerCrop"
        />
</LinearLayout>
+2 −0
Original line number Diff line number Diff line
@@ -1454,6 +1454,8 @@
    <dimen name="fgs_manager_list_top_spacing">12dp</dimen>

    <dimen name="media_projection_app_selector_icon_size">32dp</dimen>
    <dimen name="media_projection_app_selector_recents_padding">16dp</dimen>
    <dimen name="media_projection_app_selector_loader_size">32dp</dimen>

    <!-- Dream overlay related dimensions -->
    <dimen name="dream_overlay_status_bar_height">60dp</dimen>
Loading