Merge "Set navBarDarkIntensity based on dark theme in SUW" into sc-v2-dev

This commit is contained in:
TreeHugger Robot 2021-12-15 23:42:06 +00:00 committed by Android (Google) Code Review
commit f9f90d6dc2
1 changed files with 7 additions and 10 deletions

View File

@ -40,6 +40,7 @@ import android.annotation.IdRes;
import android.annotation.LayoutRes; import android.annotation.LayoutRes;
import android.content.pm.ActivityInfo.Config; import android.content.pm.ActivityInfo.Config;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.Region; import android.graphics.Region;
import android.graphics.Region.Op; import android.graphics.Region.Op;
@ -60,7 +61,6 @@ import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AlphaUpdateListener; import com.android.launcher3.anim.AlphaUpdateListener;
import com.android.launcher3.taskbar.TaskbarNavButtonController.TaskbarButton; import com.android.launcher3.taskbar.TaskbarNavButtonController.TaskbarButton;
import com.android.launcher3.util.MultiValueAlpha; import com.android.launcher3.util.MultiValueAlpha;
import com.android.launcher3.util.Themes;
import com.android.quickstep.AnimatedFloat; import com.android.quickstep.AnimatedFloat;
import com.android.systemui.shared.rotation.FloatingRotationButton; import com.android.systemui.shared.rotation.FloatingRotationButton;
import com.android.systemui.shared.rotation.RotationButton; import com.android.systemui.shared.rotation.RotationButton;
@ -198,15 +198,12 @@ public class NavbarButtonsViewController {
navButtonsLayoutParams.gravity = Gravity.START; navButtonsLayoutParams.gravity = Gravity.START;
mNavButtonContainer.requestLayout(); mNavButtonContainer.requestLayout();
if (!isThreeButtonNav) { // TODO(b/210906568) Dark intensity is currently not propagated during setup, so set
// Tint all the nav buttons since there's no taskbar background in SUW. // it based on dark theme for now.
for (int i = 0; i < mNavButtonContainer.getChildCount(); i++) { int mode = mContext.getResources().getConfiguration().uiMode
if (!(mNavButtonContainer.getChildAt(i) instanceof ImageView)) continue; & Configuration.UI_MODE_NIGHT_MASK;
ImageView button = (ImageView) mNavButtonContainer.getChildAt(i); boolean isDarkTheme = mode == Configuration.UI_MODE_NIGHT_YES;
button.setImageTintList(ColorStateList.valueOf(Themes.getAttrColor( mTaskbarNavButtonDarkIntensity.updateValue(isDarkTheme ? 0 : 1);
button.getContext(), android.R.attr.textColorPrimary)));
}
}
} }
// Animate taskbar background when any of these flags are enabled // Animate taskbar background when any of these flags are enabled