From d648b8a85f7b7f78ef0447d395cc25f8e4ac3931 Mon Sep 17 00:00:00 2001 From: Juby210 Date: Sun, 4 Jul 2021 17:47:34 +0200 Subject: [PATCH] 82.12 - Beta (82112) --- app/build.gradle | 4 +- app/src/main/AndroidManifest.xml | 2 +- app/src/main/java/com/discord/app/App.java | 2 +- .../com/discord/models/message/Message.java | 13 +- .../discord/stores/StoreClientVersion.java | 2 +- .../analytics/AnalyticSuperProperties.java | 2 +- ...StickerUtils$DEFAULT_HEADER_SIZE_PX$2.java | 21 --- .../discord/utilities/dsti/StickerUtils.java | 9 +- .../com/discord/utilities/rest/RestAPI.java | 2 +- .../input/sticker/StickerPickerViewModel.java | 156 +++++++++++------- ...SearchAndScroll$$inlined$doOnLayout$1.java | 2 +- .../input/sticker/WidgetStickerPicker.java | 35 +++- .../sticker/WidgetStickerPickerSheet.java | 2 +- .../chat/list/entries/ChatListEntry.java | 17 +- .../widgets/debugging/WidgetFatalCrash.java | 2 +- .../widgets/settings/WidgetSettings.java | 2 +- .../widget_chat_input_sticker_suggestions.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 18 files changed, 156 insertions(+), 121 deletions(-) delete mode 100644 app/src/main/java/com/discord/utilities/dsti/StickerUtils$DEFAULT_HEADER_SIZE_PX$2.java diff --git a/app/build.gradle b/app/build.gradle index a727d4630c..66b4d86b03 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId 'com.discord' minSdkVersion 21 targetSdkVersion 29 - versionCode 82111 - versionName "82.11 - Beta" + versionCode 82112 + versionName "82.12 - Beta" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6772d0c16a..d5ad5320c1 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/app/src/main/java/com/discord/app/App.java b/app/src/main/java/com/discord/app/App.java index 78dacc31e3..0cc7253c22 100644 --- a/app/src/main/java/com/discord/app/App.java +++ b/app/src/main/java/com/discord/app/App.java @@ -172,7 +172,7 @@ public class App extends Application { loggingProvider.init(appLog); c.i.c.c.e(this); String str = null; - if (BuildUtils.INSTANCE.isValidBuildVersionName("82.11 - Beta")) { + if (BuildUtils.INSTANCE.isValidBuildVersionName("82.12 - Beta")) { FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true); } else { FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(false); diff --git a/app/src/main/java/com/discord/models/message/Message.java b/app/src/main/java/com/discord/models/message/Message.java index 4ca9215a49..541dc9b71d 100644 --- a/app/src/main/java/com/discord/models/message/Message.java +++ b/app/src/main/java/com/discord/models/message/Message.java @@ -489,14 +489,15 @@ public final class Message { return ((l != null ? l.longValue() : 0) & j) == j; } - public final boolean hasStickerItems() { - List list = this.stickerItems; - return !(list == null || list.isEmpty()); - } - public final boolean hasStickers() { List list = this.stickers; - return !(list == null || list.isEmpty()); + if (list == null || list.isEmpty()) { + List list2 = this.stickerItems; + if (list2 == null || list2.isEmpty()) { + return false; + } + } + return true; } public final boolean hasThread() { diff --git a/app/src/main/java/com/discord/stores/StoreClientVersion.java b/app/src/main/java/com/discord/stores/StoreClientVersion.java index d820c14aaf..638db0e54e 100644 --- a/app/src/main/java/com/discord/stores/StoreClientVersion.java +++ b/app/src/main/java/com/discord/stores/StoreClientVersion.java @@ -15,7 +15,7 @@ public final class StoreClientVersion extends Store { private int clientMinVersion; private final String clientMinVersionKey = "CLIENT_OUTDATED_KEY"; private final SerializedSubject clientOutdatedSubject = new SerializedSubject<>(BehaviorSubject.l0(Boolean.FALSE)); - private final int clientVersion = 82111; + private final int clientVersion = 82112; public static final /* synthetic */ void access$setClientMinVersion(StoreClientVersion storeClientVersion, int i) { storeClientVersion.setClientMinVersion(i); diff --git a/app/src/main/java/com/discord/utilities/analytics/AnalyticSuperProperties.java b/app/src/main/java/com/discord/utilities/analytics/AnalyticSuperProperties.java index 296c3df732..f1d04d1a60 100644 --- a/app/src/main/java/com/discord/utilities/analytics/AnalyticSuperProperties.java +++ b/app/src/main/java/com/discord/utilities/analytics/AnalyticSuperProperties.java @@ -77,7 +77,7 @@ public final class AnalyticSuperProperties { private final void setBaselineProperties() { String locale = Locale.getDefault().toString(); m.checkNotNullExpressionValue(locale, "Locale.getDefault().toString()"); - updateSuperProperties(h0.mapOf(o.to("browser", "Discord Android"), o.to("browser_user_agent", "Discord-Android/82111"), o.to("client_build_number", 82111), o.to("client_version", "82.11 - Beta"), o.to("device", Build.MODEL + ", " + Build.PRODUCT), o.to("os", "Android"), o.to("os_sdk_version", String.valueOf(Build.VERSION.SDK_INT)), o.to("os_version", Build.VERSION.RELEASE), o.to("system_locale", t.replace$default(locale, "_", "-", false, 4, (Object) null)))); + updateSuperProperties(h0.mapOf(o.to("browser", "Discord Android"), o.to("browser_user_agent", "Discord-Android/82112"), o.to("client_build_number", 82112), o.to("client_version", "82.12 - Beta"), o.to("device", Build.MODEL + ", " + Build.PRODUCT), o.to("os", "Android"), o.to("os_sdk_version", String.valueOf(Build.VERSION.SDK_INT)), o.to("os_version", Build.VERSION.RELEASE), o.to("system_locale", t.replace$default(locale, "_", "-", false, 4, (Object) null)))); } private final void setSuperProperties(Map map) { diff --git a/app/src/main/java/com/discord/utilities/dsti/StickerUtils$DEFAULT_HEADER_SIZE_PX$2.java b/app/src/main/java/com/discord/utilities/dsti/StickerUtils$DEFAULT_HEADER_SIZE_PX$2.java deleted file mode 100644 index a42959bb81..0000000000 --- a/app/src/main/java/com/discord/utilities/dsti/StickerUtils$DEFAULT_HEADER_SIZE_PX$2.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.discord.utilities.dsti; - -import com.discord.utilities.dimen.DimenUtils; -import d0.z.d.o; -import kotlin.jvm.functions.Function0; -/* compiled from: StickerUtils.kt */ -public final class StickerUtils$DEFAULT_HEADER_SIZE_PX$2 extends o implements Function0 { - public static final StickerUtils$DEFAULT_HEADER_SIZE_PX$2 INSTANCE = new StickerUtils$DEFAULT_HEADER_SIZE_PX$2(); - - public StickerUtils$DEFAULT_HEADER_SIZE_PX$2() { - super(0); - } - - /* Return type fixed from 'int' to match base method */ - /* JADX WARNING: Unknown variable types count: 1 */ - @Override // kotlin.jvm.functions.Function0 - /* renamed from: invoke */ - public final Integer mo1invoke() { - return DimenUtils.dpToPixels(1024); - } -} diff --git a/app/src/main/java/com/discord/utilities/dsti/StickerUtils.java b/app/src/main/java/com/discord/utilities/dsti/StickerUtils.java index 4f14b75fd8..455fb6171e 100644 --- a/app/src/main/java/com/discord/utilities/dsti/StickerUtils.java +++ b/app/src/main/java/com/discord/utilities/dsti/StickerUtils.java @@ -59,14 +59,13 @@ import org.json.JSONObject; import rx.Observable; /* compiled from: StickerUtils.kt */ public final class StickerUtils { - private static final Lazy DEFAULT_HEADER_SIZE_PX$delegate = g.lazy(StickerUtils$DEFAULT_HEADER_SIZE_PX$2.INSTANCE); private static final Lazy DEFAULT_STICKER_SIZE_PX$delegate = g.lazy(StickerUtils$DEFAULT_STICKER_SIZE_PX$2.INSTANCE); public static final StickerUtils INSTANCE = new StickerUtils(); public static final int MAXIMUM_LENGTH_STICKER_TEXT_SUGGESTIONS = 50; - public static final int MAXIMUM_WORD_COUNT_STICKER_TEXT_SUGGESTIONS = 5; + private static final int MAXIMUM_WORD_COUNT_STICKER_TEXT_SUGGESTIONS = 5; public static final int MINIMUM_LENGTH_STICKER_TEXT_SUGGESTIONS = 3; public static final int NUM_STICKERS_AUTO_SUGGEST = 4; - public static final long STICKER_APPLICATION_ID = 710982414301790216L; + private static final long STICKER_APPLICATION_ID = 710982414301790216L; /* compiled from: StickerUtils.kt */ public enum StickerSendability { @@ -299,10 +298,6 @@ public final class StickerUtils { } } - public final int getDEFAULT_HEADER_SIZE_PX() { - return ((Number) DEFAULT_HEADER_SIZE_PX$delegate.getValue()).intValue(); - } - public final int getDEFAULT_STICKER_SIZE_PX() { return ((Number) DEFAULT_STICKER_SIZE_PX$delegate.getValue()).intValue(); } diff --git a/app/src/main/java/com/discord/utilities/rest/RestAPI.java b/app/src/main/java/com/discord/utilities/rest/RestAPI.java index f413a5701c..3454c8e0c5 100644 --- a/app/src/main/java/com/discord/utilities/rest/RestAPI.java +++ b/app/src/main/java/com/discord/utilities/rest/RestAPI.java @@ -177,7 +177,7 @@ public final class RestAPI implements RestAPIInterface { @Override // com.discord.restapi.RequiredHeadersInterceptor.HeadersProvider public String getUserAgent() { - return "Discord-Android/82111"; + return "Discord-Android/82112"; } } diff --git a/app/src/main/java/com/discord/widgets/chat/input/sticker/StickerPickerViewModel.java b/app/src/main/java/com/discord/widgets/chat/input/sticker/StickerPickerViewModel.java index 58c49134a2..227be3051e 100644 --- a/app/src/main/java/com/discord/widgets/chat/input/sticker/StickerPickerViewModel.java +++ b/app/src/main/java/com/discord/widgets/chat/input/sticker/StickerPickerViewModel.java @@ -65,7 +65,7 @@ public class StickerPickerViewModel extends AppViewModel { private final MessageManager messageManager; private final StorePermissions permissionStore; private final BehaviorSubject searchSubject; - private final BehaviorSubject selectedPackIdSubject; + private final BehaviorSubject selectedCategoryIdSubject; private int stickerCountToDisplayForStore; private final StoreStickers stickersStore; private final StoreUser userStore; @@ -105,22 +105,35 @@ public class StickerPickerViewModel extends AppViewModel { this(); } - public static final /* synthetic */ List access$buildGuildStickersListItems(Companion companion, List list, Guild guild, int i, MeUser meUser, Channel channel, long j) { - return companion.buildGuildStickersListItems(list, guild, i, meUser, channel, j); + public static final /* synthetic */ List access$buildGuildStickersListItems(Companion companion, List list, Guild guild, int i, String str, MeUser meUser, Locale locale, Channel channel, long j) { + return companion.buildGuildStickersListItems(list, guild, i, str, meUser, locale, channel, j); } public static final /* synthetic */ List access$buildStickerListItems(Companion companion, ModelStickerPack modelStickerPack, String str, int i, Locale locale, MeUser meUser) { return companion.buildStickerListItems(modelStickerPack, str, i, locale, meUser); } - private final List buildGuildStickersListItems(List list, Guild guild, int i, MeUser meUser, Channel channel, long j) { + private final List buildGuildStickersListItems(List list, Guild guild, int i, String str, MeUser meUser, Locale locale, Channel channel, long j) { ArrayList arrayList = new ArrayList(); for (Sticker sticker : list) { + String h = sticker.h(); + Objects.requireNonNull(h, "null cannot be cast to non-null type java.lang.String"); + String lowerCase = h.toLowerCase(locale); + m.checkNotNullExpressionValue(lowerCase, "(this as java.lang.String).toLowerCase(locale)"); + if (!w.contains$default((CharSequence) lowerCase, (CharSequence) str, false, 2, (Object) null)) { + String j2 = sticker.j(); + Objects.requireNonNull(j2, "null cannot be cast to non-null type java.lang.String"); + String lowerCase2 = j2.toLowerCase(locale); + m.checkNotNullExpressionValue(lowerCase2, "(this as java.lang.String).toLowerCase(locale)"); + if (w.contains$default((CharSequence) lowerCase2, (CharSequence) str, false, 2, (Object) null)) { + } + } arrayList.add(new StickerItem(sticker, i, StickerItem.Mode.OWNED, StickerUtils.INSTANCE.getStickerSendability(sticker, meUser, channel, Long.valueOf(j)))); } - if (!list.isEmpty()) { - arrayList.add(0, new HeaderItem(new HeaderType.GuildItem(guild))); + if ((str.length() > 0) && arrayList.isEmpty()) { + return n.emptyList(); } + arrayList.add(0, new HeaderItem(new HeaderType.GuildItem(guild))); return arrayList; } @@ -229,7 +242,7 @@ public class StickerPickerViewModel extends AppViewModel { private final boolean isStickersSelectedTab; private final MeUser meUser; private final String searchInputStringUpper; - private final Long selectedPackId; + private final Long selectedCategoryId; private final int stickerAnimationSettings; /* JADX DEBUG: Multi-variable search result rejected for r3v0, resolved type: java.util.Map> */ @@ -249,7 +262,7 @@ public class StickerPickerViewModel extends AppViewModel { this.frequentlyUsedStickerIds = list2; this.searchInputStringUpper = str; this.stickerAnimationSettings = i; - this.selectedPackId = l; + this.selectedCategoryId = l; this.meUser = meUser; this.isStickersSelectedTab = z2; this.currentChannel = channel; @@ -257,7 +270,7 @@ public class StickerPickerViewModel extends AppViewModel { } public static /* synthetic */ Loaded copy$default(Loaded loaded, LinkedHashMap linkedHashMap, Map map, List list, List list2, String str, int i, Long l, MeUser meUser, boolean z2, Channel channel, long j, int i2, Object obj) { - return loaded.copy((i2 & 1) != 0 ? loaded.allGuilds : linkedHashMap, (i2 & 2) != 0 ? loaded.guildStickers : map, (i2 & 4) != 0 ? loaded.enabledStickerPacks : list, (i2 & 8) != 0 ? loaded.frequentlyUsedStickerIds : list2, (i2 & 16) != 0 ? loaded.searchInputStringUpper : str, (i2 & 32) != 0 ? loaded.stickerAnimationSettings : i, (i2 & 64) != 0 ? loaded.selectedPackId : l, (i2 & 128) != 0 ? loaded.meUser : meUser, (i2 & 256) != 0 ? loaded.isStickersSelectedTab : z2, (i2 & 512) != 0 ? loaded.currentChannel : channel, (i2 & 1024) != 0 ? loaded.currentChannelPermissions : j); + return loaded.copy((i2 & 1) != 0 ? loaded.allGuilds : linkedHashMap, (i2 & 2) != 0 ? loaded.guildStickers : map, (i2 & 4) != 0 ? loaded.enabledStickerPacks : list, (i2 & 8) != 0 ? loaded.frequentlyUsedStickerIds : list2, (i2 & 16) != 0 ? loaded.searchInputStringUpper : str, (i2 & 32) != 0 ? loaded.stickerAnimationSettings : i, (i2 & 64) != 0 ? loaded.selectedCategoryId : l, (i2 & 128) != 0 ? loaded.meUser : meUser, (i2 & 256) != 0 ? loaded.isStickersSelectedTab : z2, (i2 & 512) != 0 ? loaded.currentChannel : channel, (i2 & 1024) != 0 ? loaded.currentChannelPermissions : j); } public final LinkedHashMap component1() { @@ -293,7 +306,7 @@ public class StickerPickerViewModel extends AppViewModel { } public final Long component7() { - return this.selectedPackId; + return this.selectedCategoryId; } public final MeUser component8() { @@ -322,7 +335,7 @@ public class StickerPickerViewModel extends AppViewModel { return false; } Loaded loaded = (Loaded) obj; - return m.areEqual(this.allGuilds, loaded.allGuilds) && m.areEqual(this.guildStickers, loaded.guildStickers) && m.areEqual(this.enabledStickerPacks, loaded.enabledStickerPacks) && m.areEqual(this.frequentlyUsedStickerIds, loaded.frequentlyUsedStickerIds) && m.areEqual(this.searchInputStringUpper, loaded.searchInputStringUpper) && this.stickerAnimationSettings == loaded.stickerAnimationSettings && m.areEqual(this.selectedPackId, loaded.selectedPackId) && m.areEqual(this.meUser, loaded.meUser) && this.isStickersSelectedTab == loaded.isStickersSelectedTab && m.areEqual(this.currentChannel, loaded.currentChannel) && this.currentChannelPermissions == loaded.currentChannelPermissions; + return m.areEqual(this.allGuilds, loaded.allGuilds) && m.areEqual(this.guildStickers, loaded.guildStickers) && m.areEqual(this.enabledStickerPacks, loaded.enabledStickerPacks) && m.areEqual(this.frequentlyUsedStickerIds, loaded.frequentlyUsedStickerIds) && m.areEqual(this.searchInputStringUpper, loaded.searchInputStringUpper) && this.stickerAnimationSettings == loaded.stickerAnimationSettings && m.areEqual(this.selectedCategoryId, loaded.selectedCategoryId) && m.areEqual(this.meUser, loaded.meUser) && this.isStickersSelectedTab == loaded.isStickersSelectedTab && m.areEqual(this.currentChannel, loaded.currentChannel) && this.currentChannelPermissions == loaded.currentChannelPermissions; } public final LinkedHashMap getAllGuilds() { @@ -357,8 +370,8 @@ public class StickerPickerViewModel extends AppViewModel { return this.searchInputStringUpper; } - public final Long getSelectedPackId() { - return this.selectedPackId; + public final Long getSelectedCategoryId() { + return this.selectedCategoryId; } public final int getStickerAnimationSettings() { @@ -377,7 +390,7 @@ public class StickerPickerViewModel extends AppViewModel { int hashCode4 = (hashCode3 + (list2 != null ? list2.hashCode() : 0)) * 31; String str = this.searchInputStringUpper; int hashCode5 = (((hashCode4 + (str != null ? str.hashCode() : 0)) * 31) + this.stickerAnimationSettings) * 31; - Long l = this.selectedPackId; + Long l = this.selectedCategoryId; int hashCode6 = (hashCode5 + (l != null ? l.hashCode() : 0)) * 31; MeUser meUser = this.meUser; int hashCode7 = (hashCode6 + (meUser != null ? meUser.hashCode() : 0)) * 31; @@ -413,8 +426,8 @@ public class StickerPickerViewModel extends AppViewModel { L.append(this.searchInputStringUpper); L.append(", stickerAnimationSettings="); L.append(this.stickerAnimationSettings); - L.append(", selectedPackId="); - L.append(this.selectedPackId); + L.append(", selectedCategoryId="); + L.append(this.selectedCategoryId); L.append(", meUser="); L.append(this.meUser); L.append(", isStickersSelectedTab="); @@ -722,7 +735,7 @@ public class StickerPickerViewModel extends AppViewModel { public StickerPickerViewModel(BehaviorSubject behaviorSubject, BehaviorSubject behaviorSubject2, Locale locale, MessageManager messageManager, StoreStickers storeStickers, long j, StoreChannels storeChannels, StoreChannelsSelected storeChannelsSelected, StorePermissions storePermissions, StoreUser storeUser, Observable observable) { super(null); m.checkNotNullParameter(behaviorSubject, "searchSubject"); - m.checkNotNullParameter(behaviorSubject2, "selectedPackIdSubject"); + m.checkNotNullParameter(behaviorSubject2, "selectedCategoryIdSubject"); m.checkNotNullParameter(locale, "locale"); m.checkNotNullParameter(messageManager, "messageManager"); m.checkNotNullParameter(storeStickers, "stickersStore"); @@ -732,7 +745,7 @@ public class StickerPickerViewModel extends AppViewModel { m.checkNotNullParameter(storeUser, "userStore"); m.checkNotNullParameter(observable, "storeStateObservable"); this.searchSubject = behaviorSubject; - this.selectedPackIdSubject = behaviorSubject2; + this.selectedCategoryIdSubject = behaviorSubject2; this.locale = locale; this.messageManager = messageManager; this.stickersStore = storeStickers; @@ -774,9 +787,10 @@ public class StickerPickerViewModel extends AppViewModel { stickerPickerViewModel.handleStoreState(storeState); } - /* JADX WARNING: Removed duplicated region for block: B:34:0x00ac */ - /* JADX WARNING: Removed duplicated region for block: B:86:0x00b9 A[SYNTHETIC] */ - /* JADX WARNING: Removed duplicated region for block: B:89:0x0064 A[SYNTHETIC] */ + /* JADX WARNING: Removed duplicated region for block: B:34:0x00b1 */ + /* JADX WARNING: Removed duplicated region for block: B:37:0x00c0 */ + /* JADX WARNING: Removed duplicated region for block: B:90:0x00d0 A[SYNTHETIC] */ + /* JADX WARNING: Removed duplicated region for block: B:95:0x0069 A[SYNTHETIC] */ private final List createEnabledCategoryItems(StoreState.Loaded loaded, List list, List list2) { int i; Collection values; @@ -784,8 +798,9 @@ public class StickerPickerViewModel extends AppViewModel { boolean z2; boolean z3; ArrayList arrayList = new ArrayList(); - Long selectedPackId = loaded.getSelectedPackId(); + Long selectedCategoryId = loaded.getSelectedCategoryId(); LinkedHashSet linkedHashSet = new LinkedHashSet(); + LinkedHashSet linkedHashSet2 = new LinkedHashSet(); if ((loaded.getMeUser().getPremiumTier() != PremiumTier.TIER_2 && loaded.getGuildStickers().isEmpty()) || loaded.getEnabledStickerPacks().isEmpty()) { return n.emptyList(); } @@ -819,16 +834,23 @@ public class StickerPickerViewModel extends AppViewModel { if (z2) { linkedHashSet.add(-1L); } - if (sticker.i() == null) { + if (sticker.i() != null) { Long i2 = sticker.i(); Objects.requireNonNull(i2, "null cannot be cast to non-null type kotlin.Long"); linkedHashSet.add(i2); } + if (sticker.g() == null) { + Long g = sticker.g(); + Objects.requireNonNull(g, "null cannot be cast to non-null type kotlin.Long"); + linkedHashSet2.add(g); + } } z2 = false; if (z2) { } - if (sticker.i() == null) { + if (sticker.i() != null) { + } + if (sticker.g() == null) { } } } @@ -836,7 +858,7 @@ public class StickerPickerViewModel extends AppViewModel { if (!list2.isEmpty()) { i = list2.size() + 1 + 0; if (linkedHashSet.contains(-1L)) { - arrayList.add(new StickerCategoryItem.RecentItem(selectedPackId != null && selectedPackId.longValue() == -1, new Pair(0, Integer.valueOf(i)))); + arrayList.add(new StickerCategoryItem.RecentItem(selectedCategoryId != null && selectedCategoryId.longValue() == -1, new Pair(0, Integer.valueOf(i)))); } } else { i = 0; @@ -846,15 +868,17 @@ public class StickerPickerViewModel extends AppViewModel { Guild value = entry.getValue(); Map map = loaded.getGuildStickers().get(Long.valueOf(longValue)); if (!(map == null || (values = map.values()) == null || (list3 = u.toList(values)) == null)) { - boolean z4 = selectedPackId != null && selectedPackId.longValue() == value.getId(); + boolean z4 = selectedCategoryId != null && selectedCategoryId.longValue() == value.getId(); int size = list3.size() + 1 + i; - arrayList.add(new StickerCategoryItem.GuildItem(value, list3, new Pair(Integer.valueOf(i), Integer.valueOf(size)), z4)); + if (linkedHashSet2.contains(Long.valueOf(longValue))) { + arrayList.add(new StickerCategoryItem.GuildItem(value, list3, new Pair(Integer.valueOf(i), Integer.valueOf(size)), z4)); + } i = size; } } if (loaded.getMeUser().getPremiumTier() == PremiumTier.TIER_2) { for (ModelStickerPack modelStickerPack2 : loaded.getEnabledStickerPacks()) { - boolean z5 = selectedPackId != null && selectedPackId.longValue() == modelStickerPack2.getId(); + boolean z5 = selectedCategoryId != null && selectedCategoryId.longValue() == modelStickerPack2.getId(); int size2 = modelStickerPack2.getStickers().size() + 1 + i; if (linkedHashSet.contains(Long.valueOf(modelStickerPack2.getId()))) { arrayList.add(new StickerCategoryItem.PackItem(modelStickerPack2, new Pair(Integer.valueOf(i), Integer.valueOf(size2)), z5)); @@ -885,13 +909,17 @@ public class StickerPickerViewModel extends AppViewModel { private final void handleStoreState(StoreState storeState) { if (storeState instanceof StoreState.Loaded) { StoreState.Loaded loaded = (StoreState.Loaded) storeState; - Long valueOf = loaded.getSelectedPackId() == null ? Long.valueOf(this.initialStickerPackId) : null; + Long valueOf = loaded.getSelectedCategoryId() == null ? Long.valueOf(this.initialStickerPackId) : null; handleStoreStateForEnabledPage(loaded); scrollToPackId(valueOf); } } + /* JADX WARNING: Removed duplicated region for block: B:24:0x00e7 */ + /* JADX WARNING: Removed duplicated region for block: B:35:0x0151 */ + /* JADX WARNING: Removed duplicated region for block: B:46:0x0203 */ private final void handleStoreStateForEnabledPage(StoreState.Loaded loaded) { + List createEnabledCategoryItems; Collection values; List list; Map allStickersById = getAllStickersById(loaded); @@ -911,8 +939,9 @@ public class StickerPickerViewModel extends AppViewModel { } } ArrayList arrayList2 = new ArrayList(); + boolean z2 = true; int i = 2; - boolean z2 = false; + boolean z3 = false; if (!arrayList.isEmpty()) { for (Sticker sticker2 : arrayList) { String h = sticker2.h(); @@ -920,50 +949,63 @@ public class StickerPickerViewModel extends AppViewModel { Objects.requireNonNull(h, "null cannot be cast to non-null type java.lang.String"); String lowerCase2 = h.toLowerCase(locale2); m.checkNotNullExpressionValue(lowerCase2, "(this as java.lang.String).toLowerCase(locale)"); - if (!w.contains$default(lowerCase2, lowerCase, z2, i, (Object) null)) { + if (!w.contains$default(lowerCase2, lowerCase, z3, i, (Object) null)) { String j = sticker2.j(); Locale locale3 = this.locale; Objects.requireNonNull(j, "null cannot be cast to non-null type java.lang.String"); String lowerCase3 = j.toLowerCase(locale3); m.checkNotNullExpressionValue(lowerCase3, "(this as java.lang.String).toLowerCase(locale)"); - if (!w.contains$default(lowerCase3, lowerCase, z2, i, (Object) null)) { - z2 = false; + if (!w.contains$default(lowerCase3, lowerCase, z3, i, (Object) null)) { i = 2; + z3 = false; } } arrayList2.add(new StickerItem(sticker2, stickerAnimationSettings, StickerItem.Mode.OWNED, StickerUtils.INSTANCE.getStickerSendability(sticker2, loaded.getMeUser(), loaded.getCurrentChannel(), Long.valueOf(loaded.getCurrentChannelPermissions())))); - z2 = false; i = 2; + z3 = false; } if (!arrayList2.isEmpty()) { arrayList2.add(0, new HeaderItem(HeaderType.Recent.INSTANCE)); + for (Map.Entry entry : loaded.getAllGuilds().entrySet()) { + long longValue = entry.getKey().longValue(); + Guild value = entry.getValue(); + Map map = loaded.getGuildStickers().get(Long.valueOf(longValue)); + if (map != null && (values = map.values()) != null && (list = u.toList(values)) != null) { + arrayList2.addAll(Companion.access$buildGuildStickersListItems(Companion, list, value, stickerAnimationSettings, lowerCase, loaded.getMeUser(), this.locale, loaded.getCurrentChannel(), loaded.getCurrentChannelPermissions())); + } + } + if (loaded.getMeUser().getPremiumTier() == PremiumTier.TIER_2) { + for (ModelStickerPack modelStickerPack : enabledStickerPacks) { + arrayList2.addAll(Companion.access$buildStickerListItems(Companion, modelStickerPack, lowerCase, stickerAnimationSettings, this.locale, loaded.getMeUser())); + } + } + createEnabledCategoryItems = createEnabledCategoryItems(loaded, arrayList2, arrayList); + if (loaded.getMeUser().getPremiumTier() != PremiumTier.TIER_2 || !loaded.getGuildStickers().isEmpty()) { + if (arrayList2.isEmpty()) { + if (lowerCase.length() <= 0) { + z2 = false; + } + if (z2) { + updateViewState(new ViewState.EmptySearchResults(loaded.getSearchInputStringUpper(), createEnabledCategoryItems)); + return; + } + } + updateViewState(new ViewState.Stickers(loaded.getSearchInputStringUpper(), arrayList2, createEnabledCategoryItems, loaded.isStickersSelectedTab())); + } + updateViewState(new ViewState.Phase1RolloutNotPremium(n.listOfNotNull((Object[]) new Sticker[]{this.stickersStore.getStickers().get(781323769960202280L), this.stickersStore.getStickers().get(809209266556764241L), this.stickersStore.getStickers().get(818597810047680532L), this.stickersStore.getStickers().get(819129296374595614L)}))); + return; } } - for (Map.Entry entry : loaded.getAllGuilds().entrySet()) { - long longValue = entry.getKey().longValue(); - Guild value = entry.getValue(); - Map map = loaded.getGuildStickers().get(Long.valueOf(longValue)); - if (map != null && (values = map.values()) != null && (list = u.toList(values)) != null) { - arrayList2.addAll(Companion.access$buildGuildStickersListItems(Companion, list, value, stickerAnimationSettings, loaded.getMeUser(), loaded.getCurrentChannel(), loaded.getCurrentChannelPermissions())); - } + while (r18.hasNext()) { } if (loaded.getMeUser().getPremiumTier() == PremiumTier.TIER_2) { - for (ModelStickerPack modelStickerPack : enabledStickerPacks) { - arrayList2.addAll(Companion.access$buildStickerListItems(Companion, modelStickerPack, lowerCase, stickerAnimationSettings, this.locale, loaded.getMeUser())); - } } - List createEnabledCategoryItems = createEnabledCategoryItems(loaded, arrayList2, arrayList); - if (loaded.getMeUser().getPremiumTier() == PremiumTier.TIER_2 || !loaded.getGuildStickers().isEmpty()) { - if (arrayList2.isEmpty()) { - if (lowerCase.length() > 0) { - updateViewState(new ViewState.EmptySearchResults(loaded.getSearchInputStringUpper(), createEnabledCategoryItems)); - return; - } - } - updateViewState(new ViewState.Stickers(loaded.getSearchInputStringUpper(), arrayList2, createEnabledCategoryItems, loaded.isStickersSelectedTab())); - return; + createEnabledCategoryItems = createEnabledCategoryItems(loaded, arrayList2, arrayList); + if (loaded.getMeUser().getPremiumTier() != PremiumTier.TIER_2) { } - updateViewState(new ViewState.Phase1RolloutNotPremium(n.listOfNotNull((Object[]) new Sticker[]{this.stickersStore.getStickers().get(781323769960202280L), this.stickersStore.getStickers().get(809209266556764241L), this.stickersStore.getStickers().get(818597810047680532L), this.stickersStore.getStickers().get(819129296374595614L)}))); + if (arrayList2.isEmpty()) { + } + updateViewState(new ViewState.Stickers(loaded.getSearchInputStringUpper(), arrayList2, createEnabledCategoryItems, loaded.isStickersSelectedTab())); } public final Observable observeEvents() { @@ -1021,8 +1063,8 @@ public class StickerPickerViewModel extends AppViewModel { this.searchSubject.onNext(str); } - public final void setSelectedPackId(long j) { - this.selectedPackIdSubject.onNext(Long.valueOf(j)); + public final void setSelectedCategoryId(long j) { + this.selectedCategoryIdSubject.onNext(Long.valueOf(j)); } public final void setStickerCountToDisplayForStore(int i) { diff --git a/app/src/main/java/com/discord/widgets/chat/input/sticker/WidgetStickerPicker$setupForInlineSearchAndScroll$$inlined$doOnLayout$1.java b/app/src/main/java/com/discord/widgets/chat/input/sticker/WidgetStickerPicker$setupForInlineSearchAndScroll$$inlined$doOnLayout$1.java index 10a86ddd7b..f74c11bca4 100644 --- a/app/src/main/java/com/discord/widgets/chat/input/sticker/WidgetStickerPicker$setupForInlineSearchAndScroll$$inlined$doOnLayout$1.java +++ b/app/src/main/java/com/discord/widgets/chat/input/sticker/WidgetStickerPicker$setupForInlineSearchAndScroll$$inlined$doOnLayout$1.java @@ -21,7 +21,7 @@ public final class WidgetStickerPicker$setupForInlineSearchAndScroll$$inlined$do m.checkParameterIsNotNull(view, "view"); view.removeOnLayoutChangeListener(this); WidgetStickerPicker.access$getViewModel$p(this.this$0).setSearchText(this.$searchText$inlined); - WidgetStickerPicker.access$getViewModel$p(this.this$0).setSelectedPackId(this.$packId$inlined); + WidgetStickerPicker.access$getViewModel$p(this.this$0).setSelectedCategoryId(this.$packId$inlined); RecyclerView recyclerView = WidgetStickerPicker.access$getBinding$p(this.this$0).k; m.checkNotNullExpressionValue(recyclerView, "binding.chatInputStickerPickerRecycler"); if (!ViewCompat.isLaidOut(recyclerView) || recyclerView.isLayoutRequested()) { diff --git a/app/src/main/java/com/discord/widgets/chat/input/sticker/WidgetStickerPicker.java b/app/src/main/java/com/discord/widgets/chat/input/sticker/WidgetStickerPicker.java index 0e936b2daf..e5ae7a9306 100644 --- a/app/src/main/java/com/discord/widgets/chat/input/sticker/WidgetStickerPicker.java +++ b/app/src/main/java/com/discord/widgets/chat/input/sticker/WidgetStickerPicker.java @@ -377,7 +377,24 @@ public final class WidgetStickerPicker extends AppFragment implements c { } this.autoscrollToPackId = null; if (!stickerCategoryItem.isSelected()) { - selectPackById(((StickerCategoryItem.PackItem) stickerCategoryItem).getPack().getId()); + selectCategoryById(((StickerCategoryItem.PackItem) stickerCategoryItem).getPack().getId()); + } + } + } else if (stickerCategoryItem instanceof StickerCategoryItem.GuildItem) { + StickerCategoryItem.GuildItem guildItem = (StickerCategoryItem.GuildItem) stickerCategoryItem; + Pair categoryRange2 = guildItem.getCategoryRange(); + int intValue3 = categoryRange2.getFirst().intValue(); + int intValue4 = categoryRange2.getSecond().intValue(); + if (intValue3 <= i && intValue4 > i) { + Long l2 = this.autoscrollToPackId; + if (l2 != null) { + long id3 = guildItem.getGuild().getId(); + if (l2 != null && l2.longValue() == id3) { + } + } + this.autoscrollToPackId = null; + if (!stickerCategoryItem.isSelected()) { + selectCategoryById(((StickerCategoryItem.GuildItem) stickerCategoryItem).getGuild().getId()); } } } @@ -421,7 +438,7 @@ public final class WidgetStickerPicker extends AppFragment implements c { private final void onGuildClicked(StickerCategoryItem.GuildItem guildItem) { AnalyticsTracker.INSTANCE.guildCategorySelected(guildItem.getGuild().getId()); this.autoscrollToPackId = Long.valueOf(guildItem.getGuild().getId()); - selectPackById(guildItem.getGuild().getId()); + selectCategoryById(guildItem.getGuild().getId()); Pair categoryRange = guildItem.getCategoryRange(); Observable q = new j(Unit.a).q(200, TimeUnit.MILLISECONDS); m.checkNotNullExpressionValue(q, "Observable.just(Unit)\n …0, TimeUnit.MILLISECONDS)"); @@ -431,7 +448,7 @@ public final class WidgetStickerPicker extends AppFragment implements c { private final void onPackClicked(StickerCategoryItem.PackItem packItem) { AnalyticsTracker.INSTANCE.stickerPackCategorySelected(packItem.getPack().getId()); this.autoscrollToPackId = Long.valueOf(packItem.getPack().getId()); - selectPackById(packItem.getPack().getId()); + selectCategoryById(packItem.getPack().getId()); Pair categoryRange = packItem.getCategoryRange(); Observable q = new j(Unit.a).q(200, TimeUnit.MILLISECONDS); m.checkNotNullExpressionValue(q, "Observable.just(Unit)\n …0, TimeUnit.MILLISECONDS)"); @@ -439,7 +456,7 @@ public final class WidgetStickerPicker extends AppFragment implements c { } private final void onRecentClicked() { - selectPackById(-1); + selectCategoryById(-1); WidgetStickerAdapter widgetStickerAdapter = this.stickerAdapter; if (widgetStickerAdapter == null) { m.throwUninitializedPropertyAccessException("stickerAdapter"); @@ -584,7 +601,7 @@ public final class WidgetStickerPicker extends AppFragment implements c { scrollToTop(); } try { - getViewModel().setSelectedPackId(-1); + getViewModel().setSelectedCategoryId(-1); clearSearchInput(); } catch (Exception unused) { } @@ -622,7 +639,7 @@ public final class WidgetStickerPicker extends AppFragment implements c { getBinding().r.a(this, new WidgetStickerPicker$onViewBound$1(this)); Bundle arguments = getArguments(); Long valueOf = arguments != null ? Long.valueOf(arguments.getLong("com.discord.intent.EXTRA_STICKER_PACK_ID")) : null; - getViewModel().setSelectedPackId(valueOf != null ? valueOf.longValue() : -1); + getViewModel().setSelectedCategoryId(valueOf != null ? valueOf.longValue() : -1); RecyclerView recyclerView = getBinding().p; m.checkNotNullExpressionValue(recyclerView, "binding.stickerPickerCategoryRecycler"); recyclerView.setLayoutParams(new ConstraintLayout.LayoutParams(-1, -1)); @@ -656,8 +673,8 @@ public final class WidgetStickerPicker extends AppFragment implements c { } } - public final void selectPackById(long j) { - getViewModel().setSelectedPackId(j); + public final void selectCategoryById(long j) { + getViewModel().setSelectedCategoryId(j); } public final void setListener(StickerPickerListener stickerPickerListener) { @@ -686,7 +703,7 @@ public final class WidgetStickerPicker extends AppFragment implements c { return; } access$getViewModel$p(this).setSearchText(str); - access$getViewModel$p(this).setSelectedPackId(j); + access$getViewModel$p(this).setSelectedCategoryId(j); RecyclerView recyclerView2 = access$getBinding$p(this).k; m.checkNotNullExpressionValue(recyclerView2, "binding.chatInputStickerPickerRecycler"); if (!ViewCompat.isLaidOut(recyclerView2) || recyclerView2.isLayoutRequested()) { diff --git a/app/src/main/java/com/discord/widgets/chat/input/sticker/WidgetStickerPickerSheet.java b/app/src/main/java/com/discord/widgets/chat/input/sticker/WidgetStickerPickerSheet.java index ec8d6ae10b..0453b7cf99 100644 --- a/app/src/main/java/com/discord/widgets/chat/input/sticker/WidgetStickerPickerSheet.java +++ b/app/src/main/java/com/discord/widgets/chat/input/sticker/WidgetStickerPickerSheet.java @@ -86,7 +86,7 @@ public final class WidgetStickerPickerSheet extends WidgetExpressionPickerSheet if (widgetStickerPicker == null) { m.throwUninitializedPropertyAccessException("stickerPickerFragment"); } - widgetStickerPicker.selectPackById(-1); + widgetStickerPicker.selectCategoryById(-1); } @Override // com.discord.widgets.chat.input.sticker.StickerPickerListener diff --git a/app/src/main/java/com/discord/widgets/chat/list/entries/ChatListEntry.java b/app/src/main/java/com/discord/widgets/chat/list/entries/ChatListEntry.java index 4cfd7313fe..1977bedf17 100644 --- a/app/src/main/java/com/discord/widgets/chat/list/entries/ChatListEntry.java +++ b/app/src/main/java/com/discord/widgets/chat/list/entries/ChatListEntry.java @@ -266,15 +266,14 @@ public abstract class ChatListEntry implements MGRecyclerDataPayload { } public final List createStickerEntries(Message message) { + ArrayList arrayList; m.checkNotNullParameter(message, "message"); - ArrayList arrayList = null; - if (message.hasStickerItems()) { - List stickerItems = message.getStickerItems(); - if (stickerItems != null) { - arrayList = new ArrayList(o.collectionSizeOrDefault(stickerItems, 10)); - for (StickerPartial stickerPartial : stickerItems) { - arrayList.add(new StickerEntry(message, stickerPartial)); - } + List stickerItems = message.getStickerItems(); + if (!(stickerItems == null || stickerItems.isEmpty())) { + List stickerItems2 = message.getStickerItems(); + arrayList = new ArrayList(o.collectionSizeOrDefault(stickerItems2, 10)); + for (StickerPartial stickerPartial : stickerItems2) { + arrayList.add(new StickerEntry(message, stickerPartial)); } } else { List stickers = message.getStickers(); @@ -283,6 +282,8 @@ public abstract class ChatListEntry implements MGRecyclerDataPayload { for (Sticker sticker : stickers) { arrayList.add(new StickerEntry(message, sticker)); } + } else { + arrayList = null; } } return arrayList != null ? arrayList : n.emptyList(); diff --git a/app/src/main/java/com/discord/widgets/debugging/WidgetFatalCrash.java b/app/src/main/java/com/discord/widgets/debugging/WidgetFatalCrash.java index f7a63b5098..15008d3b8b 100644 --- a/app/src/main/java/com/discord/widgets/debugging/WidgetFatalCrash.java +++ b/app/src/main/java/com/discord/widgets/debugging/WidgetFatalCrash.java @@ -100,7 +100,7 @@ public final class WidgetFatalCrash extends AppFragment { textView2.setText(b.j(this, 2131887892, objArr2, null, 4)); TextView textView3 = getBinding().b; m.checkNotNullExpressionValue(textView3, "binding.fatalCrashAppVersion"); - textView3.setText(b.j(this, 2131887885, new Object[]{"82.11 - Beta"}, null, 4)); + textView3.setText(b.j(this, 2131887885, new Object[]{"82.12 - Beta"}, null, 4)); TextView textView4 = getBinding().d; m.checkNotNullExpressionValue(textView4, "binding.fatalCrashOsVersion"); textView4.setText(b.j(this, 2131887888, new Object[]{String.valueOf(Build.VERSION.SDK_INT)}, null, 4)); diff --git a/app/src/main/java/com/discord/widgets/settings/WidgetSettings.java b/app/src/main/java/com/discord/widgets/settings/WidgetSettings.java index 1bff53f4f3..bd459d8295 100644 --- a/app/src/main/java/com/discord/widgets/settings/WidgetSettings.java +++ b/app/src/main/java/com/discord/widgets/settings/WidgetSettings.java @@ -332,7 +332,7 @@ public final class WidgetSettings extends AppFragment implements OnTabSelectedLi TextView textView = binding.f; m.checkNotNullExpressionValue(textView, "appInfoHeader"); String string = getString(2131886360); - textView.setText(string + " - 82.11 - Beta (82111)"); + textView.setText(string + " - 82.12 - Beta (82112)"); binding.f1921y.setOnClickListener(new WidgetSettings$onViewBound$$inlined$with$lambda$2(this)); binding.u.setOnClickListener(WidgetSettings$onViewBound$1$4.INSTANCE); binding.q.setOnClickListener(WidgetSettings$onViewBound$1$5.INSTANCE); diff --git a/app/src/main/res/layout/widget_chat_input_sticker_suggestions.xml b/app/src/main/res/layout/widget_chat_input_sticker_suggestions.xml index 0ddf0d389e..5cdba66553 100644 --- a/app/src/main/res/layout/widget_chat_input_sticker_suggestions.xml +++ b/app/src/main/res/layout/widget_chat_input_sticker_suggestions.xml @@ -1,5 +1,5 @@ - + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0e82721560..ccd7154646 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1341,7 +1341,7 @@ Presets Select a color Transparency - f31707f8e813423498473e05c7641788 + 68977ce749cf4ee9b4f8cf8a6a2edd06 Coming Soon Slash command application {applicationName} {applicationName} application