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

Commit 7a4ac492 authored by Nick Chameyev's avatar Nick Chameyev
Browse files

[Partial Screensharing] Calculate recents thumbnail size

Adds calculating of thumbnail view size in runtime.
Refactors dependency injection to use a subcomponent.
Extracts recents view creation and logic to
a separate controller.

Bug: 240924926
Test: atest com.android.systemui.mediaprojection.appselector.view.TaskPreviewSizeProviderTest
Test: atest com.android.systemui.mediaprojection.appselector.MediaProjectionAppSelectorControllerTest
Change-Id: I0c92e1a39f9fbb415c639b98b19674681167fa39
parent 9bd931c3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:focusable="false"
            android:clickable="false"
            android:gravity="center"
            android:paddingBottom="@*android:dimen/chooser_view_spacing"
            android:paddingLeft="24dp"
+2 −1
Original line number Diff line number Diff line
@@ -23,8 +23,9 @@
    >

    <FrameLayout
        android:id="@+id/media_projection_recent_tasks_container"
        android:layout_width="match_parent"
        android:layout_height="256dp">
        android:layout_height="wrap_content">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/media_projection_recent_tasks_recycler"
+9 −7
Original line number Diff line number Diff line
@@ -18,7 +18,9 @@
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:gravity="center"
    android:orientation="vertical">
    android:orientation="vertical"
    android:clickable="true"
    >

    <ImageView
        android:id="@+id/task_icon"
@@ -27,12 +29,12 @@
        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
    <!-- This view size will be calculated in runtime -->
    <com.android.systemui.mediaprojection.appselector.view.MediaProjectionTaskView
        android:id="@+id/task_thumbnail"
        android:layout_width="100dp"
        android:layout_height="216dp"
        android:scaleType="centerCrop"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="false"
        android:focusable="false"
        />
</LinearLayout>
+3 −0
Original line number Diff line number Diff line
@@ -1457,6 +1457,9 @@
    <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>
    <dimen name="media_projection_app_selector_task_rounded_corners">10dp</dimen>
    <dimen name="media_projection_app_selector_task_icon_size">24dp</dimen>
    <dimen name="media_projection_app_selector_task_icon_margin">8dp</dimen>

    <!-- Dream overlay related dimensions -->
    <dimen name="dream_overlay_status_bar_height">60dp</dimen>
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ import com.android.systemui.flags.FlagsModule;
import com.android.systemui.fragments.FragmentService;
import com.android.systemui.keyguard.data.BouncerViewModule;
import com.android.systemui.log.dagger.LogModule;
import com.android.systemui.media.dagger.MediaProjectionModule;
import com.android.systemui.mediaprojection.appselector.MediaProjectionModule;
import com.android.systemui.model.SysUiState;
import com.android.systemui.navigationbar.NavigationBarComponent;
import com.android.systemui.people.PeopleModule;
Loading