feat: Hide time for stickers

This commit is contained in:
luvletter2333 2021-07-16 13:57:39 +08:00
parent 17dd08d9ba
commit b0f64e4eb1
No known key found for this signature in database
GPG Key ID: BFD68B892BECC1D8
4 changed files with 17 additions and 1 deletions

View File

@ -10427,7 +10427,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
if (!autoPlayingMedia || !MediaController.getInstance().isPlayingMessageAndReadyToDraw(currentMessageObject) && !transitionParams.animateBackgroundBoundsInner) {
drawOverlays(canvas);
}
if ((drawTime || !mediaBackground) && !forceNotDrawTime && !transitionParams.animateBackgroundBoundsInner && !(enterTransitionInPorgress && !currentMessageObject.isVoice())) {
if ((drawTime || !mediaBackground) && !forceNotDrawTime && !transitionParams.animateBackgroundBoundsInner && !(enterTransitionInPorgress && !currentMessageObject.isVoice()) && (!currentMessageObject.isAnyKindOfSticker() || !NekoConfig.hideTimeForSticker)) {
drawTime(canvas, 1f, false);
}

View File

@ -146,6 +146,7 @@ public class NekoConfig {
public static boolean avatarBackgroundDarken;
public static boolean disableTrending;
public static boolean dontSendGreetingSticker;
public static boolean hideTimeForSticker;
public static boolean takeGIFasVideo;
public static boolean disableAutoDownloadingWin32Executable;
@ -313,6 +314,7 @@ public class NekoConfig {
acceptSecretChat = preferences.getBoolean("acceptSecretChat", true);
disableTrending = preferences.getBoolean("disableTrending", true);
dontSendGreetingSticker = preferences.getBoolean("dontSendGreetingSticker", false);
hideTimeForSticker = preferences.getBoolean("hideTimeForSticker", false);
takeGIFasVideo = preferences.getBoolean("takeGIFasVideo", false);
disableAutoDownloadingWin32Executable = preferences.getBoolean("disableAutoDownloadingWin32Executable", true);
@ -805,6 +807,10 @@ public class NekoConfig {
preferences.edit().putBoolean("dontSendGreetingSticker", dontSendGreetingSticker = !dontSendGreetingSticker).apply();
}
public static void toggleHideTimeForSticker() {
preferences.edit().putBoolean("hideTimeForSticker", hideTimeForSticker = !hideTimeForSticker).apply();
}
public static void toggleTakeGIFasVideo() {
preferences.edit().putBoolean("takeGIFasVideo", takeGIFasVideo = !takeGIFasVideo).apply();
}

View File

@ -75,6 +75,7 @@ public class NekoChatSettingsActivity extends BaseFragment implements Notificati
private int disableProximityEventsRow;
private int disableTrendingRow;
private int dontSendGreetingStickerRow;
private int hideTimeForStickerRow;
private int takeGIFasVideoRow;
private int mapPreviewRow;
@ -276,6 +277,11 @@ public class NekoChatSettingsActivity extends BaseFragment implements Notificati
if (view instanceof TextCheckCell) {
((TextCheckCell) view).setChecked(NekoConfig.dontSendGreetingSticker);
}
} else if (position == hideTimeForStickerRow) {
NekoConfig.toggleHideTimeForSticker();
if (view instanceof TextCheckCell) {
((TextCheckCell) view).setChecked(NekoConfig.hideTimeForSticker);
}
} else if (position == takeGIFasVideoRow) {
NekoConfig.toggleTakeGIFasVideo();
if (view instanceof TextCheckCell) {
@ -329,6 +335,7 @@ public class NekoChatSettingsActivity extends BaseFragment implements Notificati
disableProximityEventsRow = rowCount++;
disableTrendingRow = rowCount++;
dontSendGreetingStickerRow = rowCount++;
hideTimeForStickerRow = rowCount++;
takeGIFasVideoRow = rowCount++;
mapPreviewRow = rowCount++;
@ -691,6 +698,8 @@ public class NekoChatSettingsActivity extends BaseFragment implements Notificati
textCell.setTextAndCheck(LocaleController.getString("DisableTrending", R.string.DisableTrending), NekoConfig.disableTrending, true);
} else if (position == dontSendGreetingStickerRow) {
textCell.setTextAndCheck(LocaleController.getString("DontSendGreetingSticker", R.string.DontSendGreetingSticker), NekoConfig.dontSendGreetingSticker, true);
} else if (position == hideTimeForStickerRow) {
textCell.setTextAndCheck(LocaleController.getString("HideTimeForSticker", R.string.HideTimeForSticker), NekoConfig.hideTimeForSticker, true);
} else if (position == takeGIFasVideoRow) {
textCell.setTextAndCheck(LocaleController.getString("TakeGIFasVideo", R.string.TakeGIFasVideo), NekoConfig.takeGIFasVideo, true);
} else if (position == win32Row) {

View File

@ -113,5 +113,6 @@
<string name="DontSendGreetingSticker">Don\'t send greeting sticker</string>
<string name="TakeGIFasVideo">Take GIF as Video</string>
<string name="UseMediaStreamInVoip">Use media stream in Voip</string>
<string name="HideTimeForSticker">Hide time for stickers</string>
</resources>