mirror of
https://github.com/wrwrabbit/Partisan-Telegram-Android.git
synced 2026-04-30 21:19:33 +00:00
Update to 8.8.2
This commit is contained in:
parent
32aef72421
commit
96dce2c9aa
2710 changed files with 40357 additions and 11958 deletions
|
|
@ -19,6 +19,7 @@ import android.os.SystemClock;
|
|||
import android.text.TextUtils;
|
||||
import android.util.Base64;
|
||||
import android.util.SparseArray;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import androidx.annotation.IntDef;
|
||||
import androidx.core.content.pm.ShortcutManagerCompat;
|
||||
|
|
@ -49,6 +50,10 @@ public class SharedConfig {
|
|||
})
|
||||
public @interface PasscodeType {}
|
||||
|
||||
public final static int SAVE_TO_GALLERY_FLAG_PEER = 1;
|
||||
public final static int SAVE_TO_GALLERY_FLAG_GROUP = 2;
|
||||
public final static int SAVE_TO_GALLERY_FLAG_CHANNELS = 4;
|
||||
|
||||
public static String pushString = "";
|
||||
public static String pushStringStatus = "";
|
||||
public static long pushStringGetTimeStart;
|
||||
|
|
@ -100,7 +105,7 @@ public class SharedConfig {
|
|||
private static final Object sync = new Object();
|
||||
private static final Object localIdSync = new Object();
|
||||
|
||||
public static boolean saveToGallery;
|
||||
public static int saveToGalleryFlags;
|
||||
public static int mapPreviewType = 2;
|
||||
public static boolean chatBubbles = Build.VERSION.SDK_INT >= 30;
|
||||
public static boolean autoplayGifs = true;
|
||||
|
|
@ -121,6 +126,7 @@ public class SharedConfig {
|
|||
public static boolean noiseSupression;
|
||||
public static boolean noStatusBar = true;
|
||||
public static boolean forceRtmpStream;
|
||||
public static boolean debugWebView;
|
||||
public static boolean sortContactsByName;
|
||||
public static boolean sortFilesByName;
|
||||
public static boolean shuffleMusic;
|
||||
|
|
@ -341,7 +347,13 @@ public class SharedConfig {
|
|||
}
|
||||
|
||||
preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
|
||||
saveToGallery = preferences.getBoolean("save_gallery", false);
|
||||
boolean saveToGalleryLegacy = preferences.getBoolean("save_gallery", false);
|
||||
if (saveToGalleryLegacy) {
|
||||
saveToGalleryFlags = SAVE_TO_GALLERY_FLAG_PEER + SAVE_TO_GALLERY_FLAG_CHANNELS + SAVE_TO_GALLERY_FLAG_GROUP;
|
||||
preferences.edit().remove("save_gallery").putInt("save_gallery_flags", saveToGalleryFlags).apply();
|
||||
} else {
|
||||
saveToGalleryFlags = preferences.getInt("save_gallery_flags", 0);
|
||||
}
|
||||
autoplayGifs = preferences.getBoolean("autoplay_gif", true);
|
||||
autoplayVideo = preferences.getBoolean("autoplay_video", true);
|
||||
mapPreviewType = preferences.getInt("mapPreviewType", 2);
|
||||
|
|
@ -379,6 +391,7 @@ public class SharedConfig {
|
|||
keepMedia = preferences.getInt("keep_media", 2);
|
||||
noStatusBar = preferences.getBoolean("noStatusBar", true);
|
||||
forceRtmpStream = preferences.getBoolean("forceRtmpStream", false);
|
||||
debugWebView = preferences.getBoolean("debugWebView", false);
|
||||
lastKeepMediaCheckTime = preferences.getInt("lastKeepMediaCheckTime", 0);
|
||||
lastLogsCheckTime = preferences.getInt("lastLogsCheckTime", 0);
|
||||
searchMessagesAsListHintShows = preferences.getInt("searchMessagesAsListHintShows", 0);
|
||||
|
|
@ -402,6 +415,14 @@ public class SharedConfig {
|
|||
showNotificationsForAllAccounts = preferences.getBoolean("AllAccounts", true);
|
||||
|
||||
configLoaded = true;
|
||||
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
WebView.setWebContentsDebuggingEnabled(debugWebView);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -615,7 +636,7 @@ public class SharedConfig {
|
|||
editor.commit();
|
||||
}
|
||||
|
||||
public static void removeScheduledOrNoSuoundHint() {
|
||||
public static void removeScheduledOrNoSoundHint() {
|
||||
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putInt("scheduledOrNoSoundHintShows", 3);
|
||||
|
|
@ -746,6 +767,17 @@ public class SharedConfig {
|
|||
editor.apply();
|
||||
}
|
||||
|
||||
public static void toggleDebugWebView() {
|
||||
debugWebView = !debugWebView;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
WebView.setWebContentsDebuggingEnabled(debugWebView);
|
||||
}
|
||||
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putBoolean("debugWebView", debugWebView);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public static void toggleNoStatusBar() {
|
||||
noStatusBar = !noStatusBar;
|
||||
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
|
||||
|
|
@ -800,12 +832,14 @@ public class SharedConfig {
|
|||
editor.commit();
|
||||
}
|
||||
|
||||
public static void toggleSaveToGallery() {
|
||||
saveToGallery = !saveToGallery;
|
||||
public static void toggleSaveToGalleryFlag(int flag) {
|
||||
if ((saveToGalleryFlags & flag) != 0) {
|
||||
saveToGalleryFlags &= ~flag;
|
||||
} else {
|
||||
saveToGalleryFlags |= flag;
|
||||
}
|
||||
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putBoolean("save_gallery", saveToGallery);
|
||||
editor.commit();
|
||||
preferences.edit().putInt("save_gallery_flags", saveToGalleryFlags).apply();
|
||||
ImageLoader.getInstance().checkMediaPaths();
|
||||
ImageLoader.getInstance().getCacheOutQueue().postRunnable(() -> {
|
||||
checkSaveToGalleryFiles();
|
||||
|
|
@ -1095,7 +1129,7 @@ public class SharedConfig {
|
|||
File videoPath = new File(telegramPath, "Telegram Video");
|
||||
videoPath.mkdir();
|
||||
|
||||
if (saveToGallery) {
|
||||
if (saveToGalleryFlags != 0 || !BuildVars.NO_SCOPED_STORAGE) {
|
||||
if (imagePath.isDirectory()) {
|
||||
new File(imagePath, ".nomedia").delete();
|
||||
}
|
||||
|
|
@ -1224,6 +1258,7 @@ public class SharedConfig {
|
|||
public static boolean canBlurChat() {
|
||||
return getDevicePerformanceClass() == PERFORMANCE_CLASS_HIGH;
|
||||
}
|
||||
|
||||
public static boolean chatBlurEnabled() {
|
||||
return canBlurChat() && chatBlur;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue