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

Commit 3ec2dd1e authored by Fabián Kozynski's avatar Fabián Kozynski
Browse files

Prevent hole in ControlsActivity with panel

When the TaskView is created, until it displays the app content, it
shows a hole that shows the launcher. Instead, set its alpha to 0 and
only restore it to 1 when the task has finished creating.

Test: manual
Test: atest PanelTaskViewControllerTest
Fixes: 278923156
Change-Id: Ia3cd474e9888e57b258c985c520c3f08b09ee38d
parent 01b56bb0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -41,6 +41,10 @@ class PanelTaskViewController(
    private val hide: () -> Unit = {}
) {

    init {
        taskView.alpha = 0f
    }

    private var detailTaskId = INVALID_TASK_ID

    private val fillInIntent =
@@ -96,6 +100,7 @@ class PanelTaskViewController(

            override fun onTaskCreated(taskId: Int, name: ComponentName?) {
                detailTaskId = taskId
                taskView.alpha = 1f
            }

            override fun onReleased() {
+16 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.controls.ui

import android.app.ActivityOptions
import android.app.PendingIntent
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK
@@ -89,6 +90,11 @@ class PanelTaskViewControllerTest : SysuiTestCase() {
            )
    }

    @Test
    fun testTaskViewStartsWithAlpha0() {
        verify(taskView).alpha = 0f
    }

    @Test
    fun testLaunchTaskViewAttachedListener() {
        underTest.launchTaskView()
@@ -119,6 +125,16 @@ class PanelTaskViewControllerTest : SysuiTestCase() {
        assertThat(optionsCaptor.value.taskAlwaysOnTop).isTrue()
    }

    @Test
    fun testOnTaskCreated_taskViewAlpha1() {
        underTest.launchTaskView()
        verify(taskView).setListener(any(), capture(listenerCaptor))

        listenerCaptor.value.onTaskCreated(1, ComponentName("Test", "TEST"))

        verify(taskView).alpha = 1f
    }

    @Test
    fun testHideRunnableCalledWhenBackOnRoot() {
        underTest.launchTaskView()