Skip to content

Commit

Permalink
CHANGELOG: Fixed Header Image with New Control Center
Browse files Browse the repository at this point in the history
  • Loading branch information
DHD2280 committed Jun 16, 2024
1 parent 1000904 commit b0a037d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,14 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
if (mQsHeaderLayout == null) return;

int alphaIndex = param.args[2] instanceof Float ? 2 : 1;

if (findField(ScrimControllerClass, "mScrimBehind").get(param.thisObject).equals(param.args[0])) {
log(TAG + "ScrimControllerClass updateScrimColor " + ((float) param.args[alphaIndex]));
float qsAlpha = (float) param.args[alphaIndex];
if (qsAlpha < .19f) {
boolean nightMode = (mQsHeaderLayout.getContext().getResources().getConfiguration().uiMode
& Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
if (nightMode && qsAlpha < .19f // Dark Mode Alpha
|| !nightMode && qsAlpha < 0.09f // Light Mode Different Alpha
) {
mQsHeaderLayout.setAlpha(0f);
} else {
mQsHeaderLayout.setAlpha(1f);
Expand Down

0 comments on commit b0a037d

Please sign in to comment.