mirror of https://github.com/NekoX-Dev/NekoX.git
try to fix status bar
This commit is contained in:
parent
ff45bdac1e
commit
9969037be2
|
@ -4526,15 +4526,12 @@ public class AndroidUtilities {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
final View decorView = window.getDecorView();
|
final View decorView = window.getDecorView();
|
||||||
int flags = decorView.getSystemUiVisibility();
|
int flags = decorView.getSystemUiVisibility();
|
||||||
if (!SharedConfig.noStatusBar && NekoConfig.transparentStatusBar.Bool()) {
|
|
||||||
window.setStatusBarColor(Color.TRANSPARENT);
|
|
||||||
}
|
|
||||||
if (enable) {
|
if (enable) {
|
||||||
if ((flags & View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR) == 0) {
|
if ((flags & View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR) == 0) {
|
||||||
flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
||||||
decorView.setSystemUiVisibility(flags);
|
decorView.setSystemUiVisibility(flags);
|
||||||
}
|
}
|
||||||
if (!SharedConfig.noStatusBar && !forceTransparentStatusbar && !NekoConfig.transparentStatusBar.Bool()) {
|
if (!SharedConfig.noStatusBar && !forceTransparentStatusbar) {
|
||||||
window.setStatusBarColor(LIGHT_STATUS_BAR_OVERLAY);
|
window.setStatusBarColor(LIGHT_STATUS_BAR_OVERLAY);
|
||||||
} else {
|
} else {
|
||||||
window.setStatusBarColor(Color.TRANSPARENT);
|
window.setStatusBarColor(Color.TRANSPARENT);
|
||||||
|
@ -4544,7 +4541,7 @@ public class AndroidUtilities {
|
||||||
flags &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
flags &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
||||||
decorView.setSystemUiVisibility(flags);
|
decorView.setSystemUiVisibility(flags);
|
||||||
}
|
}
|
||||||
if (!SharedConfig.noStatusBar && !forceTransparentStatusbar && !NekoConfig.transparentStatusBar.Bool()) {
|
if (!SharedConfig.noStatusBar && !forceTransparentStatusbar) {
|
||||||
window.setStatusBarColor(DARK_STATUS_BAR_OVERLAY);
|
window.setStatusBarColor(DARK_STATUS_BAR_OVERLAY);
|
||||||
} else {
|
} else {
|
||||||
window.setStatusBarColor(Color.TRANSPARENT);
|
window.setStatusBarColor(Color.TRANSPARENT);
|
||||||
|
|
|
@ -321,7 +321,6 @@ public class ApplicationLoader extends Application {
|
||||||
MessagesController.getInstance(account).putUser(user, true);
|
MessagesController.getInstance(account).putUser(user, true);
|
||||||
}
|
}
|
||||||
Utilities.stageQueue.postRunnable(() -> {
|
Utilities.stageQueue.postRunnable(() -> {
|
||||||
Theme.init(account);
|
|
||||||
SendMessagesHelper.getInstance(account).checkUnsentMessages();
|
SendMessagesHelper.getInstance(account).checkUnsentMessages();
|
||||||
ContactsController.getInstance(account).checkAppAccount();
|
ContactsController.getInstance(account).checkAppAccount();
|
||||||
DownloadController.getInstance(account);
|
DownloadController.getInstance(account);
|
||||||
|
|
|
@ -1242,7 +1242,7 @@ public class SharedConfig {
|
||||||
devicePerformanceClass = preferences.getInt("devicePerformanceClass", -1);
|
devicePerformanceClass = preferences.getInt("devicePerformanceClass", -1);
|
||||||
loopStickers = preferences.getBoolean("loopStickers", true);
|
loopStickers = preferences.getBoolean("loopStickers", true);
|
||||||
keepMedia = preferences.getInt("keep_media", 2);
|
keepMedia = preferences.getInt("keep_media", 2);
|
||||||
noStatusBar = preferences.getBoolean("noStatusBar", true);
|
noStatusBar = NekoConfig.transparentStatusBar.Bool();
|
||||||
forceRtmpStream = preferences.getBoolean("forceRtmpStream", false);
|
forceRtmpStream = preferences.getBoolean("forceRtmpStream", false);
|
||||||
lastKeepMediaCheckTime = preferences.getInt("lastKeepMediaCheckTime", 0);
|
lastKeepMediaCheckTime = preferences.getInt("lastKeepMediaCheckTime", 0);
|
||||||
lastLogsCheckTime = preferences.getInt("lastLogsCheckTime", 0);
|
lastLogsCheckTime = preferences.getInt("lastLogsCheckTime", 0);
|
||||||
|
@ -1627,13 +1627,14 @@ public class SharedConfig {
|
||||||
editor.apply();
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void toggleNoStatusBar() {
|
// public static void toggleNoStatusBar() {
|
||||||
noStatusBar = !noStatusBar;
|
// noStatusBar = !noStatusBar;
|
||||||
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
|
// noStatusBar |= NekoConfig.transparentStatusBar.Bool();
|
||||||
SharedPreferences.Editor editor = preferences.edit();
|
// SharedPreferences preferences = MessagesController.getGlobalMainSettings();
|
||||||
editor.putBoolean("noStatusBar", noStatusBar);
|
// SharedPreferences.Editor editor = preferences.edit();
|
||||||
editor.commit();
|
// editor.putBoolean("noStatusBar", noStatusBar);
|
||||||
}
|
// editor.apply();
|
||||||
|
// }
|
||||||
|
|
||||||
public static void toggleLoopStickers() {
|
public static void toggleLoopStickers() {
|
||||||
loopStickers = !loopStickers;
|
loopStickers = !loopStickers;
|
||||||
|
|
|
@ -260,6 +260,7 @@ public class ActionBar extends FrameLayout {
|
||||||
int y = titleView.getTextStartY() + Theme.getCurrentHolidayDrawableYOffset() + (int) Math.ceil((titleView.getTextHeight() - rect.height()) / 2.0f);
|
int y = titleView.getTextStartY() + Theme.getCurrentHolidayDrawableYOffset() + (int) Math.ceil((titleView.getTextHeight() - rect.height()) / 2.0f);
|
||||||
drawable.setBounds(x, y - drawable.getIntrinsicHeight(), x + drawable.getIntrinsicWidth(), y);
|
drawable.setBounds(x, y - drawable.getIntrinsicHeight(), x + drawable.getIntrinsicWidth(), y);
|
||||||
drawable.setAlpha((int) (255 * titleView.getAlpha()));
|
drawable.setAlpha((int) (255 * titleView.getAlpha()));
|
||||||
|
drawable.setColorFilter(textPaint.getColor(), PorterDuff.Mode.MULTIPLY);
|
||||||
drawable.draw(canvas);
|
drawable.draw(canvas);
|
||||||
if (overlayTitleAnimationInProgress) {
|
if (overlayTitleAnimationInProgress) {
|
||||||
child.invalidate();
|
child.invalidate();
|
||||||
|
|
|
@ -428,7 +428,7 @@ public class ActionBarLayout extends FrameLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (currFragment != null && !currFragment.inPreviewMode && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !SharedConfig.noStatusBar) {
|
if (currFragment != null && !currFragment.inPreviewMode && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !SharedConfig.noStatusBar) {
|
||||||
int overlayColor = Theme.getColor(Theme.key_actionBarDefault) == Color.WHITE ? AndroidUtilities.LIGHT_STATUS_BAR_OVERLAY : AndroidUtilities.DARK_STATUS_BAR_OVERLAY;
|
int overlayColor = ColorUtils.calculateLuminance(Theme.getColor(Theme.key_actionBarDefault)) > 0.7f ? AndroidUtilities.LIGHT_STATUS_BAR_OVERLAY : AndroidUtilities.DARK_STATUS_BAR_OVERLAY;
|
||||||
int oldStatusBarColor = prevFragment != null && prevFragment.hasForceLightStatusBar() ? Color.TRANSPARENT : overlayColor;
|
int oldStatusBarColor = prevFragment != null && prevFragment.hasForceLightStatusBar() ? Color.TRANSPARENT : overlayColor;
|
||||||
int newStatusBarColor = currFragment != null && currFragment.hasForceLightStatusBar() ? Color.TRANSPARENT : overlayColor;
|
int newStatusBarColor = currFragment != null && currFragment.hasForceLightStatusBar() ? Color.TRANSPARENT : overlayColor;
|
||||||
parentActivity.getWindow().setStatusBarColor(ColorUtils.blendARGB(newStatusBarColor, oldStatusBarColor, ratio));
|
parentActivity.getWindow().setStatusBarColor(ColorUtils.blendARGB(newStatusBarColor, oldStatusBarColor, ratio));
|
||||||
|
@ -1510,7 +1510,7 @@ public class ActionBarLayout extends FrameLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (previousFragment != null) {
|
if (previousFragment != null) {
|
||||||
AndroidUtilities.setLightStatusBar(parentActivity.getWindow(), Theme.getColor(Theme.key_actionBarDefault) == Color.WHITE || (previousFragment.hasForceLightStatusBar() && !Theme.getCurrentTheme().isDark()), previousFragment.hasForceLightStatusBar());
|
AndroidUtilities.setLightStatusBar(parentActivity.getWindow(), ColorUtils.calculateLuminance(Theme.getColor(Theme.key_actionBarDefault)) > 0.7f || (previousFragment.hasForceLightStatusBar() && !Theme.getCurrentTheme().isDark()), previousFragment.hasForceLightStatusBar());
|
||||||
LayoutContainer temp = containerView;
|
LayoutContainer temp = containerView;
|
||||||
containerView = containerViewBack;
|
containerView = containerViewBack;
|
||||||
containerViewBack = temp;
|
containerViewBack = temp;
|
||||||
|
|
|
@ -308,7 +308,7 @@ public abstract class BaseFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasForceLightStatusBar() && !AndroidUtilities.isTablet() && getParentLayout().getLastFragment() == this && getParentActivity() != null && !finishing) {
|
if (hasForceLightStatusBar() && !AndroidUtilities.isTablet() && getParentLayout().getLastFragment() == this && getParentActivity() != null && !finishing) {
|
||||||
AndroidUtilities.setLightStatusBar(getParentActivity().getWindow(), Theme.getColor(Theme.key_actionBarDefault) == Color.WHITE);
|
AndroidUtilities.setLightStatusBar(getParentActivity().getWindow(), ColorUtils.calculateLuminance(Theme.getColor(Theme.key_actionBarDefault)) > 0.7f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -874,7 +874,7 @@ public class BottomSheet extends Dialog {
|
||||||
|
|
||||||
if (useLightStatusBar && Build.VERSION.SDK_INT >= 23) {
|
if (useLightStatusBar && Build.VERSION.SDK_INT >= 23) {
|
||||||
int color = Theme.getColor(Theme.key_actionBarDefault, null, true);
|
int color = Theme.getColor(Theme.key_actionBarDefault, null, true);
|
||||||
if (color == 0xffffffff) {
|
if (AndroidUtilities.computePerceivedBrightness(color) >= 0.721f) {
|
||||||
int flags = container.getSystemUiVisibility();
|
int flags = container.getSystemUiVisibility();
|
||||||
flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
||||||
container.setSystemUiVisibility(flags);
|
container.setSystemUiVisibility(flags);
|
||||||
|
@ -990,7 +990,7 @@ public class BottomSheet extends Dialog {
|
||||||
if (Build.VERSION.SDK_INT >= 23) {
|
if (Build.VERSION.SDK_INT >= 23) {
|
||||||
int color = Theme.getColor(Theme.key_actionBarDefault, null, true);
|
int color = Theme.getColor(Theme.key_actionBarDefault, null, true);
|
||||||
int flags = container.getSystemUiVisibility();
|
int flags = container.getSystemUiVisibility();
|
||||||
if (useLightStatusBar && color == 0xffffffff) {
|
if (useLightStatusBar && AndroidUtilities.computePerceivedBrightness(color) >= 0.721f) {
|
||||||
flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
||||||
} else {
|
} else {
|
||||||
flags &=~ View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
flags &=~ View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
||||||
|
|
|
@ -1836,7 +1836,6 @@ public class Theme {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static class ThemeInfo implements NotificationCenter.NotificationCenterDelegate {
|
public static class ThemeInfo implements NotificationCenter.NotificationCenterDelegate {
|
||||||
public String name;
|
public String name;
|
||||||
public String pathToFile;
|
public String pathToFile;
|
||||||
|
@ -2609,7 +2608,6 @@ public class Theme {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface ResourcesProvider {
|
public interface ResourcesProvider {
|
||||||
|
|
||||||
Integer getColor(String key);
|
Integer getColor(String key);
|
||||||
|
@ -3873,7 +3871,6 @@ public class Theme {
|
||||||
private static FragmentContextViewWavesDrawable fragmentContextViewWavesDrawable;
|
private static FragmentContextViewWavesDrawable fragmentContextViewWavesDrawable;
|
||||||
private static RoundVideoProgressShadow roundPlayDrawable;
|
private static RoundVideoProgressShadow roundPlayDrawable;
|
||||||
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
defaultColors.put(key_dialogBackground, 0xffffffff);
|
defaultColors.put(key_dialogBackground, 0xffffffff);
|
||||||
defaultColors.put(key_dialogBackgroundGray, 0xfff0f0f0);
|
defaultColors.put(key_dialogBackgroundGray, 0xfff0f0f0);
|
||||||
|
@ -4972,10 +4969,9 @@ public class Theme {
|
||||||
themeInfo.previewBackgroundColor = 0xff95beec;
|
themeInfo.previewBackgroundColor = 0xff95beec;
|
||||||
themeInfo.previewInColor = 0xffffffff;
|
themeInfo.previewInColor = 0xffffffff;
|
||||||
themeInfo.previewOutColor = 0xffd0e6ff;
|
themeInfo.previewOutColor = 0xffd0e6ff;
|
||||||
themeInfo.sortIndex = 1;
|
|
||||||
themeInfo.firstAccentIsDefault = true;
|
themeInfo.firstAccentIsDefault = true;
|
||||||
if (NekoConfig.useDefaultTheme.Bool())
|
themeInfo.currentAccentId = DEFALT_THEME_ACCENT_ID;
|
||||||
themeInfo.currentAccentId = DEFALT_THEME_ACCENT_ID;
|
themeInfo.sortIndex = 1;
|
||||||
themeInfo.setAccentColorOptions(
|
themeInfo.setAccentColorOptions(
|
||||||
new int[] { 0xFF5890C5, 0xFF239853, 0xFFCE5E82, 0xFF7F63C3, 0xFF2491AD, 0xFF299C2F, 0xFF8854B4, 0xFF328ACF, 0xFF43ACC7, 0xFF52AC44, 0xFFCD5F93, 0xFFD28036, 0xFF8366CC, 0xFFCE4E57, 0xFFD3AE40, 0xFF7B88AB },
|
new int[] { 0xFF5890C5, 0xFF239853, 0xFFCE5E82, 0xFF7F63C3, 0xFF2491AD, 0xFF299C2F, 0xFF8854B4, 0xFF328ACF, 0xFF43ACC7, 0xFF52AC44, 0xFFCD5F93, 0xFFD28036, 0xFF8366CC, 0xFFCE4E57, 0xFFD3AE40, 0xFF7B88AB },
|
||||||
new int[] { 0xFFB8E18D, 0xFFFAFBCC, 0xFFFFF9DC, 0xFFC14F6E, 0xFFD1BD1B, 0xFFFFFAC9, 0xFFFCF6D8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
|
new int[] { 0xFFB8E18D, 0xFFFAFBCC, 0xFFFFF9DC, 0xFFC14F6E, 0xFFD1BD1B, 0xFFFFFAC9, 0xFFFCF6D8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
|
||||||
|
@ -5000,8 +4996,6 @@ public class Theme {
|
||||||
themeInfo.previewInColor = Color.parseColor("#c0ffffff");
|
themeInfo.previewInColor = Color.parseColor("#c0ffffff");
|
||||||
themeInfo.previewOutColor = Color.parseColor("#3f51b5");
|
themeInfo.previewOutColor = Color.parseColor("#3f51b5");
|
||||||
themeInfo.sortIndex = 0;
|
themeInfo.sortIndex = 0;
|
||||||
if (!NekoConfig.useDefaultTheme.Bool())
|
|
||||||
themeInfo.currentAccentId = DEFALT_THEME_ACCENT_ID;
|
|
||||||
themes.add(themeInfo);
|
themes.add(themeInfo);
|
||||||
themesDict.put("NekoX", themeInfo);
|
themesDict.put("NekoX", themeInfo);
|
||||||
|
|
||||||
|
@ -5167,7 +5161,7 @@ public class Theme {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
theme = preferences.getString("nighttheme", "Night");
|
theme = preferences.getString("nighttheme", null);
|
||||||
if ("Default".equals(theme)) {
|
if ("Default".equals(theme)) {
|
||||||
applyingTheme = themesDict.get("Blue");
|
applyingTheme = themesDict.get("Blue");
|
||||||
applyingTheme.currentAccentId = DEFALT_THEME_ACCENT_ID;
|
applyingTheme.currentAccentId = DEFALT_THEME_ACCENT_ID;
|
||||||
|
@ -5476,12 +5470,6 @@ public class Theme {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void init(int a) {
|
|
||||||
SharedPreferences themeConfig = ApplicationLoader.applicationContext.getSharedPreferences("themeconfig", Activity.MODE_PRIVATE);
|
|
||||||
remoteThemesHash.put(a, themeConfig.getLong("2remoteThemesHash" + (a != 0 ? a : ""), 0));
|
|
||||||
lastLoadingThemesTime.put(a, themeConfig.getInt("lastLoadingThemesTime" + (a != 0 ? a : ""), 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Method StateListDrawable_getStateDrawableMethod;
|
private static Method StateListDrawable_getStateDrawableMethod;
|
||||||
private static Field BitmapDrawable_mColorFilter;
|
private static Field BitmapDrawable_mColorFilter;
|
||||||
|
|
||||||
|
|
|
@ -2631,7 +2631,7 @@ public class ChatActivityEnterView extends BlurredFrameLayout implements Notific
|
||||||
d.getWindow().setNavigationBarColor(0);
|
d.getWindow().setNavigationBarColor(0);
|
||||||
|
|
||||||
int color = Theme.getColor(Theme.key_actionBarDefault, null, true);
|
int color = Theme.getColor(Theme.key_actionBarDefault, null, true);
|
||||||
AndroidUtilities.setLightStatusBar(d.getWindow(), color == Color.WHITE);
|
AndroidUtilities.setLightStatusBar(d.getWindow(), ColorUtils.calculateLuminance(color) > 0.7f);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
int color2 = Theme.getColor(Theme.key_windowBackgroundGray, null, true);
|
int color2 = Theme.getColor(Theme.key_windowBackgroundGray, null, true);
|
||||||
|
|
|
@ -999,7 +999,7 @@ public class LaunchActivity extends BasePermissionsActivity implements ActionBar
|
||||||
if (checkStatusBar) {
|
if (checkStatusBar) {
|
||||||
boolean enable;
|
boolean enable;
|
||||||
if (currentFragment != null) {
|
if (currentFragment != null) {
|
||||||
enable = currentFragment.isLightStatusBar();
|
enable = currentFragment.isLightStatusBar() || currentFragment.hasForceLightStatusBar() && !Theme.getCurrentTheme().isDark();
|
||||||
} else {
|
} else {
|
||||||
int color = Theme.getColor(Theme.key_actionBarDefault, null, true);
|
int color = Theme.getColor(Theme.key_actionBarDefault, null, true);
|
||||||
enable = ColorUtils.calculateLuminance(color) > 0.7f;
|
enable = ColorUtils.calculateLuminance(color) > 0.7f;
|
||||||
|
|
|
@ -68,6 +68,7 @@ import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.Keep;
|
import androidx.annotation.Keep;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
import androidx.collection.LongSparseArray;
|
import androidx.collection.LongSparseArray;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.core.graphics.ColorUtils;
|
import androidx.core.graphics.ColorUtils;
|
||||||
|
@ -3160,7 +3161,8 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||||
SharedConfig.pauseMusicOnRecord ? LocaleController.getString("DebugMenuDisablePauseMusic", R.string.DebugMenuDisablePauseMusic) : LocaleController.getString("DebugMenuEnablePauseMusic", R.string.DebugMenuEnablePauseMusic),
|
SharedConfig.pauseMusicOnRecord ? LocaleController.getString("DebugMenuDisablePauseMusic", R.string.DebugMenuDisablePauseMusic) : LocaleController.getString("DebugMenuEnablePauseMusic", R.string.DebugMenuEnablePauseMusic),
|
||||||
BuildVars.DEBUG_VERSION && !AndroidUtilities.isTablet() && Build.VERSION.SDK_INT >= 23 ? (SharedConfig.smoothKeyboard ? LocaleController.getString("DebugMenuDisableSmoothKeyboard", R.string.DebugMenuDisableSmoothKeyboard) : LocaleController.getString("DebugMenuEnableSmoothKeyboard", R.string.DebugMenuEnableSmoothKeyboard)) : null,
|
BuildVars.DEBUG_VERSION && !AndroidUtilities.isTablet() && Build.VERSION.SDK_INT >= 23 ? (SharedConfig.smoothKeyboard ? LocaleController.getString("DebugMenuDisableSmoothKeyboard", R.string.DebugMenuDisableSmoothKeyboard) : LocaleController.getString("DebugMenuEnableSmoothKeyboard", R.string.DebugMenuEnableSmoothKeyboard)) : null,
|
||||||
BuildVars.DEBUG_PRIVATE_VERSION ? (SharedConfig.disableVoiceAudioEffects ? "Enable voip audio effects" : "Disable voip audio effects") : null,
|
BuildVars.DEBUG_PRIVATE_VERSION ? (SharedConfig.disableVoiceAudioEffects ? "Enable voip audio effects" : "Disable voip audio effects") : null,
|
||||||
Build.VERSION.SDK_INT >= 21 ? (SharedConfig.noStatusBar ? "Show status bar background" : "Hide status bar background") : null,
|
// Build.VERSION.SDK_INT >= 21 ? (SharedConfig.noStatusBar ? "Show status bar background" : "Hide status bar background") : null,
|
||||||
|
null,
|
||||||
"Scan accounts",
|
"Scan accounts",
|
||||||
BuildVars.DEBUG_PRIVATE_VERSION ? "Clean app update" : null,
|
BuildVars.DEBUG_PRIVATE_VERSION ? "Clean app update" : null,
|
||||||
BuildVars.DEBUG_PRIVATE_VERSION ? "Reset suggestions" : null,
|
BuildVars.DEBUG_PRIVATE_VERSION ? "Reset suggestions" : null,
|
||||||
|
@ -3205,6 +3207,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||||
} else if (which == 8) {
|
} else if (which == 8) {
|
||||||
SharedConfig.toggleRoundCamera16to9();
|
SharedConfig.toggleRoundCamera16to9();
|
||||||
} else if (which == 9) {
|
} else if (which == 9) {
|
||||||
|
((LaunchActivity) getParentActivity()).checkAppUpdate(true);
|
||||||
} else if (which == 10) {
|
} else if (which == 10) {
|
||||||
getMessagesStorage().readAllDialogs(-1);
|
getMessagesStorage().readAllDialogs(-1);
|
||||||
} else if (which == 11) {
|
} else if (which == 11) {
|
||||||
|
@ -3217,14 +3220,14 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||||
} else if (which == 13) {
|
} else if (which == 13) {
|
||||||
SharedConfig.toggleDisableVoiceAudioEffects();
|
SharedConfig.toggleDisableVoiceAudioEffects();
|
||||||
} else if (which == 14) {
|
} else if (which == 14) {
|
||||||
SharedConfig.toggleNoStatusBar();
|
// SharedConfig.toggleNoStatusBar();
|
||||||
if (getParentActivity() != null && Build.VERSION.SDK_INT >= 21) {
|
// if (getParentActivity() != null && Build.VERSION.SDK_INT >= 21) {
|
||||||
if (SharedConfig.noStatusBar) {
|
// if (SharedConfig.noStatusBar) {
|
||||||
getParentActivity().getWindow().setStatusBarColor(0);
|
// getParentActivity().getWindow().setStatusBarColor(0);
|
||||||
} else {
|
// } else {
|
||||||
getParentActivity().getWindow().setStatusBarColor(0x33000000);
|
// getParentActivity().getWindow().setStatusBarColor(0x33000000);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
} else if (which == 15) {
|
} else if (which == 15) {
|
||||||
SharedConfig.activeAccounts.clear();
|
SharedConfig.activeAccounts.clear();
|
||||||
int maxAccounts;
|
int maxAccounts;
|
||||||
|
@ -3821,7 +3824,6 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||||
pinchToZoomHelper = new PinchToZoomHelper(decorView, frameLayout) {
|
pinchToZoomHelper = new PinchToZoomHelper(decorView, frameLayout) {
|
||||||
|
|
||||||
Paint statusBarPaint;
|
Paint statusBarPaint;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void invalidateViews() {
|
protected void invalidateViews() {
|
||||||
super.invalidateViews();
|
super.invalidateViews();
|
||||||
|
@ -3845,7 +3847,11 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||||
if (actionBar.getOccupyStatusBar() && !SharedConfig.noStatusBar) {
|
if (actionBar.getOccupyStatusBar() && !SharedConfig.noStatusBar) {
|
||||||
if (statusBarPaint == null) {
|
if (statusBarPaint == null) {
|
||||||
statusBarPaint = new Paint();
|
statusBarPaint = new Paint();
|
||||||
statusBarPaint.setColor(ColorUtils.setAlphaComponent(Color.BLACK, (int) (255 * 0.2f)));
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
statusBarPaint.setColor(getParentActivity().getWindow().getStatusBarColor());
|
||||||
|
} else {
|
||||||
|
statusBarPaint.setColor(ColorUtils.setAlphaComponent(Color.BLACK, (int) (255 * 0.2f)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
canvas.drawRect(actionBar.getX(), actionBar.getY(), actionBar.getX() + actionBar.getMeasuredWidth(), actionBar.getY() + AndroidUtilities.statusBarHeight, statusBarPaint);
|
canvas.drawRect(actionBar.getX(), actionBar.getY(), actionBar.getX() + actionBar.getMeasuredWidth(), actionBar.getY() + AndroidUtilities.statusBarHeight, statusBarPaint);
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,7 @@ public class NekoConfig {
|
||||||
public static ConfigItem skipOpenLinkConfirm = addConfig("SkipOpenLinkConfirm", configTypeBool, false);
|
public static ConfigItem skipOpenLinkConfirm = addConfig("SkipOpenLinkConfirm", configTypeBool, false);
|
||||||
|
|
||||||
public static ConfigItem ignoreMutedCount = addConfig("IgnoreMutedCount", configTypeBool, true);
|
public static ConfigItem ignoreMutedCount = addConfig("IgnoreMutedCount", configTypeBool, true);
|
||||||
public static ConfigItem useDefaultTheme = addConfig("UseDefaultTheme", configTypeBool, false);
|
// public static ConfigItem useDefaultTheme = addConfig("UseDefaultTheme", configTypeBool, false);
|
||||||
public static ConfigItem showIdAndDc = addConfig("ShowIdAndDc", configTypeBool, false);
|
public static ConfigItem showIdAndDc = addConfig("ShowIdAndDc", configTypeBool, false);
|
||||||
|
|
||||||
public static ConfigItem googleCloudTranslateKey = addConfig("GoogleCloudTransKey", configTypeString, "");
|
public static ConfigItem googleCloudTranslateKey = addConfig("GoogleCloudTransKey", configTypeString, "");
|
||||||
|
@ -370,8 +370,8 @@ public class NekoConfig {
|
||||||
|
|
||||||
if (preferences.contains("ignore_muted_count"))
|
if (preferences.contains("ignore_muted_count"))
|
||||||
ignoreMutedCount.setConfigBool(preferences.getBoolean("ignore_muted_count", true));
|
ignoreMutedCount.setConfigBool(preferences.getBoolean("ignore_muted_count", true));
|
||||||
if (preferences.contains("use_default_theme"))
|
// if (preferences.contains("use_default_theme"))
|
||||||
useDefaultTheme.setConfigBool(preferences.getBoolean("use_default_theme", false));
|
// useDefaultTheme.setConfigBool(preferences.getBoolean("use_default_theme", false));
|
||||||
if (preferences.contains("show_id_and_dc"))
|
if (preferences.contains("show_id_and_dc"))
|
||||||
showIdAndDc.setConfigBool(preferences.getBoolean("show_id_and_dc", false));
|
showIdAndDc.setConfigBool(preferences.getBoolean("show_id_and_dc", false));
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ public class NekoGeneralSettingsActivity extends BaseFragment {
|
||||||
|
|
||||||
private final AbstractConfigCell header5 = cellGroup.appendCell(new ConfigCellHeader(LocaleController.getString("Appearance")));
|
private final AbstractConfigCell header5 = cellGroup.appendCell(new ConfigCellHeader(LocaleController.getString("Appearance")));
|
||||||
private final AbstractConfigCell typefaceRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.typeface));
|
private final AbstractConfigCell typefaceRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.typeface));
|
||||||
private final AbstractConfigCell useDefaultThemeRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.useDefaultTheme));
|
// private final AbstractConfigCell useDefaultThemeRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.useDefaultTheme));
|
||||||
private final AbstractConfigCell transparentStatusBarRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.transparentStatusBar));
|
private final AbstractConfigCell transparentStatusBarRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.transparentStatusBar));
|
||||||
private final AbstractConfigCell appBarShadowRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableAppBarShadow));
|
private final AbstractConfigCell appBarShadowRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableAppBarShadow));
|
||||||
private final AbstractConfigCell newYearRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.newYear));
|
private final AbstractConfigCell newYearRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.newYear));
|
||||||
|
|
Loading…
Reference in New Issue