mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-06-12 13:17:38 +02:00
fix(TikTok - Settings): Use correct colors for dark mode (#4087)
This commit is contained in:

committed by
GitHub

parent
834ae2dd6f
commit
6bd22ffa7e
@ -6,6 +6,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.os.Build;
|
||||
@ -499,6 +500,12 @@ public class Utils {
|
||||
);
|
||||
}
|
||||
|
||||
public static boolean isDarkModeEnabled(Context context) {
|
||||
Configuration config = context.getResources().getConfiguration();
|
||||
final int currentNightMode = config.uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
||||
return currentNightMode == Configuration.UI_MODE_NIGHT_YES;
|
||||
}
|
||||
|
||||
/**
|
||||
* Automatically logs any exceptions the runnable throws.
|
||||
*
|
||||
|
@ -54,9 +54,7 @@ public class ReVancedAboutPreference extends Preference {
|
||||
}
|
||||
|
||||
protected boolean isDarkModeEnabled() {
|
||||
Configuration config = getContext().getResources().getConfiguration();
|
||||
final int currentNightMode = config.uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
||||
return currentNightMode == Configuration.UI_MODE_NIGHT_YES;
|
||||
return Utils.isDarkModeEnabled(getContext());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user