Fix overlapping problem on notification screen

If we didn't set view and lifecycle for EntityHeaderController,
it only sets "z-order" as 0 for action bar.

So, user sees overlapped problem while user is scrolling view.

For now, we set view and lifecycle as parameter for EntityHeaderController,
then EntityHeaderController can change "z-order" while scrolling view.

Test: visual, robotest
Fixes: 132819126
Change-Id: Ieb01b26e4d6ca4d82f72371620938665de8149a0
This commit is contained in:
tmfang
2019-06-11 13:56:56 +08:00
parent 102d43b5c1
commit 564fcb90ab
2 changed files with 15 additions and 13 deletions

View File

@@ -21,7 +21,6 @@ import static android.app.NotificationManager.IMPORTANCE_NONE;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
@@ -35,8 +34,8 @@ import android.os.UserManager;
import android.view.View;
import androidx.fragment.app.FragmentActivity;
import androidx.preference.PreferenceFragmentCompat;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settingslib.widget.LayoutPreference;
import org.junit.Before;
@@ -70,7 +69,7 @@ public class HeaderPreferenceControllerTest {
shadowApplication.setSystemService(Context.NOTIFICATION_SERVICE, mNm);
shadowApplication.setSystemService(Context.USER_SERVICE, mUm);
mContext = RuntimeEnvironment.application;
PreferenceFragmentCompat fragment = mock(PreferenceFragmentCompat.class);
DashboardFragment fragment = mock(DashboardFragment.class);
when(fragment.getContext()).thenReturn(mContext);
FragmentActivity activity = mock(FragmentActivity.class);
when(activity.getApplicationContext()).thenReturn(mContext);