Update to 6.3.0 (2040)

This commit is contained in:
DrKLO 2020-07-26 11:03:38 +03:00
parent feba57ced0
commit 520592b43d
768 changed files with 44724 additions and 19284 deletions

View file

@ -29,6 +29,8 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import androidx.core.content.pm.ShortcutManagerCompat;
public class SharedConfig {
public static String pushString = "";
@ -36,7 +38,7 @@ public class SharedConfig {
public static byte[] pushAuthKey;
public static byte[] pushAuthKeyId;
public static long directShareHash;
public static String directShareHash;
public static boolean saveIncomingPhotos;
public static String passcodeHash = "";
@ -74,6 +76,7 @@ public class SharedConfig {
public static boolean saveToGallery;
public static int mapPreviewType = 2;
public static boolean chatBubbles = false;
public static boolean autoplayGifs = true;
public static boolean autoplayVideo = true;
public static boolean raiseToSpeak = true;
@ -236,13 +239,14 @@ public class SharedConfig {
preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
saveToGallery = preferences.getBoolean("save_gallery", false);
autoplayGifs = preferences.getBoolean("autoplay_gif", true);
chatBubbles = preferences.getBoolean("chatBubbles", false);
autoplayVideo = preferences.getBoolean("autoplay_video", true);
mapPreviewType = preferences.getInt("mapPreviewType", 2);
raiseToSpeak = preferences.getBoolean("raise_to_speak", true);
customTabs = preferences.getBoolean("custom_tabs", true);
directShare = preferences.getBoolean("direct_share", true);
shuffleMusic = preferences.getBoolean("shuffleMusic", false);
playOrderReversed = preferences.getBoolean("playOrderReversed", false);
playOrderReversed = !shuffleMusic && preferences.getBoolean("playOrderReversed", false);
inappCamera = preferences.getBoolean("inappCamera", true);
hasCameraCache = preferences.contains("cameraCache");
roundCamera16to9 = true;//preferences.getBoolean("roundCamera16to9", false);
@ -262,7 +266,7 @@ public class SharedConfig {
sortContactsByName = preferences.getBoolean("sortContactsByName", false);
sortFilesByName = preferences.getBoolean("sortFilesByName", false);
noSoundHintShowed = preferences.getBoolean("noSoundHintShowed", false);
directShareHash = preferences.getLong("directShareHash", 0);
directShareHash = preferences.getString("directShareHash2", null);
useThreeLinesLayout = preferences.getBoolean("useThreeLinesLayout", false);
archiveHidden = preferences.getBoolean("archiveHidden", false);
distanceSystemType = preferences.getInt("distanceSystemType", 0);
@ -539,11 +543,16 @@ public class SharedConfig {
editor.commit();
}
public static void toggleShuffleMusic(int type) {
public static void setPlaybackOrderType(int type) {
if (type == 2) {
shuffleMusic = !shuffleMusic;
shuffleMusic = true;
playOrderReversed = false;
} else if (type == 1) {
playOrderReversed = true;
shuffleMusic = false;
} else {
playOrderReversed = !playOrderReversed;
playOrderReversed = false;
shuffleMusic = false;
}
MediaController.getInstance().checkIsNextMediaFileDownloaded();
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
@ -553,9 +562,9 @@ public class SharedConfig {
editor.commit();
}
public static void toggleRepeatMode() {
repeatMode++;
if (repeatMode > 2) {
public static void setRepeatMode(int mode) {
repeatMode = mode;
if (repeatMode < 0 || repeatMode > 2) {
repeatMode = 0;
}
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
@ -581,6 +590,14 @@ public class SharedConfig {
editor.commit();
}
public static void toggleChatBubbles() {
chatBubbles = !chatBubbles;
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean("chatBubbles", chatBubbles);
editor.commit();
}
public static void setUseThreeLinesLayout(boolean value) {
useThreeLinesLayout = value;
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
@ -652,6 +669,8 @@ public class SharedConfig {
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean("direct_share", directShare);
editor.commit();
ShortcutManagerCompat.removeAllDynamicShortcuts(ApplicationLoader.applicationContext);
MediaDataController.getInstance(UserConfig.selectedAccount).buildShortcuts();
}
public static void toggleStreamMedia() {
@ -869,7 +888,7 @@ public class SharedConfig {
public final static int PERFORMANCE_CLASS_AVERAGE = 1;
public final static int PERFORMANCE_CLASS_HIGH = 2;
public static int getDevicePerfomanceClass() {
public static int getDevicePerformanceClass() {
if (devicePerformanceClass == -1) {
int maxCpuFreq = -1;
try {