Update to 7.6.0 (2264)

This commit is contained in:
DrKLO 2021-03-19 13:25:58 +03:00
parent e1c101c334
commit ca13bc972d
277 changed files with 21874 additions and 5772 deletions

View file

@ -22,6 +22,7 @@ import android.util.SparseArray;
import org.json.JSONObject;
import org.telegram.tgnet.ConnectionsManager;
import org.telegram.tgnet.SerializedData;
import org.telegram.ui.SwipeGestureSettingsView;
import java.io.File;
import java.io.RandomAccessFile;
@ -31,6 +32,8 @@ import java.util.Iterator;
import androidx.core.content.pm.ShortcutManagerCompat;
import com.google.android.exoplayer2.util.Log;
public class SharedConfig {
public static String pushString = "";
@ -113,6 +116,8 @@ public class SharedConfig {
public static boolean useThreeLinesLayout;
public static boolean archiveHidden;
private static int chatSwipeAction;
public static int distanceSystemType;
static {
@ -288,6 +293,7 @@ public class SharedConfig {
scheduledOrNoSoundHintShows = preferences.getInt("scheduledOrNoSoundHintShows", 0);
lockRecordAudioVideoHint = preferences.getInt("lockRecordAudioVideoHint", 0);
disableVoiceAudioEffects = preferences.getBoolean("disableVoiceAudioEffects", false);
chatSwipeAction = preferences.getInt("ChatSwipeAction", -1);
preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
showNotificationsForAllAccounts = preferences.getBoolean("AllAccounts", true);
@ -900,6 +906,25 @@ public class SharedConfig {
}
}
public static int getChatSwipeAction(int currentAccount) {
if (chatSwipeAction >= 0) {
if (chatSwipeAction == SwipeGestureSettingsView.SWIPE_GESTURE_FOLDERS && MessagesController.getInstance(currentAccount).dialogFilters.isEmpty()) {
return SwipeGestureSettingsView.SWIPE_GESTURE_ARCHIVE;
}
return chatSwipeAction;
} else if (!MessagesController.getInstance(currentAccount).dialogFilters.isEmpty()) {
return SwipeGestureSettingsView.SWIPE_GESTURE_FOLDERS;
}
return SwipeGestureSettingsView.SWIPE_GESTURE_ARCHIVE;
}
public static void updateChatListSwipeSetting(int newAction) {
chatSwipeAction = newAction;
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
preferences.edit().putInt("ChatSwipeAction", chatSwipeAction).apply();
}
public final static int PERFORMANCE_CLASS_LOW = 0;
public final static int PERFORMANCE_CLASS_AVERAGE = 1;
public final static int PERFORMANCE_CLASS_HIGH = 2;