Fix inconsist color filling on collapsing toolbar
Some pages are updating the background color for action bar after action bar is created, which will break the animation of collapsing toolbar. It also causes the different color filled in the status bar and collapsing toolbar area separately. Removing the styleActionbar method from EntityHeaderController can fix this issue. Fix: 187019164 Test: robotests && visual verified 1) Settings -> Apps -> See all apps -> pick up either app -> Mobile data & Wi-Fi 2) Scrolling the content and see if the toolbar has the different color between status bar and toolbar Change-Id: Ic0842b9e6c48662872694534a3696c4b8900481f
This commit is contained in:
@@ -26,13 +26,11 @@ import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.UserHandle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -302,30 +300,6 @@ public class EntityHeaderControllerTest {
|
||||
.isEqualTo(View.GONE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void styleActionBar_invalidObjects_shouldNotCrash() {
|
||||
mController = EntityHeaderController.newInstance(mActivity, mFragment, null);
|
||||
mController.styleActionBar(null);
|
||||
|
||||
when(mActivity.getActionBar()).thenReturn(null);
|
||||
mController.styleActionBar(mActivity);
|
||||
|
||||
verify(mActivity).getActionBar();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void styleActionBar_setElevationAndBackground() {
|
||||
final ActionBar actionBar = mActivity.getActionBar();
|
||||
|
||||
mController = EntityHeaderController.newInstance(mActivity, mFragment, null);
|
||||
mController.styleActionBar(mActivity);
|
||||
|
||||
verify(actionBar).setElevation(0);
|
||||
// Enforce a color drawable as background here, as image based drawables might not be
|
||||
// wide enough to cover entire action bar.
|
||||
verify(actionBar).setBackgroundDrawable(any(ColorDrawable.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void initAppHeaderController_appHeaderNull_useFragmentContext() {
|
||||
mController = EntityHeaderController.newInstance(mActivity, mFragment, null);
|
||||
|
Reference in New Issue
Block a user