From 0e81ba31cbd1c47a7e6fb4df90f5f40fa1e247e0 Mon Sep 17 00:00:00 2001 From: gdlbo <41114720+gdlbo@users.noreply.github.com> Date: Fri, 10 Jun 2022 21:49:12 +0300 Subject: [PATCH] fixed crash docs --- app/src/main/java/ru/vtosters/lite/utils/Preferences.java | 6 ++++++ .../adapter/delegates/DocAttachViewTypeDelegate.smali | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/ru/vtosters/lite/utils/Preferences.java b/app/src/main/java/ru/vtosters/lite/utils/Preferences.java index 6aab51b13..9d4d8d200 100644 --- a/app/src/main/java/ru/vtosters/lite/utils/Preferences.java +++ b/app/src/main/java/ru/vtosters/lite/utils/Preferences.java @@ -17,6 +17,7 @@ import static ru.vtosters.lite.utils.OpusLoader.LoadLibrary; import static ru.vtosters.lite.utils.Proxy.setProxy; import static ru.vtosters.lite.utils.Themes.systemThemeChanger; +import android.annotation.SuppressLint; import android.app.Application; import android.content.Context; import android.content.SharedPreferences; @@ -390,6 +391,11 @@ public class Preferences { } } + @SuppressLint("SimpleDateFormat") + public static SimpleDateFormat setDateFormat() { + return new SimpleDateFormat(getDateFormat()); + } + public static String getFormattedDate(UserSex type, long time){ SimpleDateFormat date = new SimpleDateFormat(getDateFormat(), Locale.getDefault()); diff --git a/smali/smali/com/vk/im/ui/components/attaches_history/attaches/adapter/delegates/DocAttachViewTypeDelegate.smali b/smali/smali/com/vk/im/ui/components/attaches_history/attaches/adapter/delegates/DocAttachViewTypeDelegate.smali index 4ea8ac8d6..8b2b7dbe0 100644 --- a/smali/smali/com/vk/im/ui/components/attaches_history/attaches/adapter/delegates/DocAttachViewTypeDelegate.smali +++ b/smali/smali/com/vk/im/ui/components/attaches_history/attaches/adapter/delegates/DocAttachViewTypeDelegate.smali @@ -51,14 +51,8 @@ iput-object v0, p0, Lcom/vk/im/ui/components/attaches_history/attaches/adapter/delegates/DocAttachViewTypeDelegate;->b:Lcom/vk/im/ui/formatters/FileSizeFormatter; - new-instance p1, Ljava/text/SimpleDateFormat; - .line 28 - invoke-static {}, Lru/vtosters/lite/utils/Preferences;->getDateFormat()Ljava/lang/String; - - move-result-object v0 - - invoke-direct {p1, v0}, Ljava/text/SimpleDateFormat;->(Ljava/lang/String;)V + invoke-static {}, Lru/vtosters/lite/utils/Preferences;->setDateFormat()Ljava/text/SimpleDateFormat; move-result-object p1