89.10 - Beta (89110)

This commit is contained in:
Juby210 2021-08-28 09:30:55 +02:00
parent 41739cbd41
commit bc9247eca1
6 changed files with 50 additions and 6 deletions

View file

@ -10,8 +10,8 @@ android {
applicationId 'com.discord'
minSdkVersion 21
targetSdkVersion 29
versionCode 89109
versionName "89.9 - Beta"
versionCode 89110
versionName "89.10 - Beta"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="89109" android:versionName="89.9 - Beta" android:installLocation="auto" android:compileSdkVersion="30" android:compileSdkVersionCodename="11" package="com.discord" platformBuildVersionCode="30" platformBuildVersionName="11">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="89110" android:versionName="89.10 - Beta" android:installLocation="auto" android:compileSdkVersion="30" android:compileSdkVersionCodename="11" package="com.discord" platformBuildVersionCode="30" platformBuildVersionName="11">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>

View file

@ -21,6 +21,7 @@ import com.discord.models.commands.ApplicationCommand;
import com.discord.models.commands.ApplicationCommandOption;
import com.discord.models.commands.ApplicationSubCommand;
import com.discord.models.user.User;
import com.discord.stores.StoreAnalytics;
import com.discord.stores.StoreApplicationCommands;
import com.discord.stores.StoreGuilds;
import com.discord.stores.StoreStream;
@ -843,6 +844,15 @@ public final class AutocompleteViewModel extends AppViewModel<ViewState> {
autocompleteViewState = AutocompleteViewState.Hidden.INSTANCE;
}
SelectedCommandViewState selectedCommandViewState = getSelectedCommandViewState(autocompleteInputSelectionModel);
ApplicationCommand newSelectedCommand = newSelectedCommand(autocompleteInputSelectionModel, this.lastAutocompleteInputSelectionModel);
if (newSelectedCommand != null) {
StoreStream.Companion companion = StoreStream.Companion;
StoreAnalytics analytics = companion.getAnalytics();
long id2 = companion.getChannelsSelected().getId();
long applicationId = newSelectedCommand.getApplicationId();
Long longOrNull = s.toLongOrNull(newSelectedCommand.getId());
analytics.trackApplicationCommandSelected(id2, applicationId, longOrNull != null ? longOrNull.longValue() : 0);
}
this.lastAutocompleteInputSelectionModel = autocompleteInputSelectionModel;
updateViewState(new ViewState(autocompleteViewState, selectedCommandViewState));
}
@ -953,6 +963,29 @@ public final class AutocompleteViewModel extends AppViewModel<ViewState> {
onDataUpdated(this.inputState, storeState);
}
private final ApplicationCommand newSelectedCommand(AutocompleteInputSelectionModel autocompleteInputSelectionModel, AutocompleteInputSelectionModel autocompleteInputSelectionModel2) {
MentionInputModel.VerifiedCommandInputModel inputModel;
InputCommandContext inputCommandContext;
MentionInputModel.VerifiedCommandInputModel inputModel2;
InputCommandContext inputCommandContext2;
InputSelectionModel inputSelectionModel = autocompleteInputSelectionModel.getInputSelectionModel();
if (!(inputSelectionModel instanceof InputSelectionModel.CommandInputSelectionModel)) {
inputSelectionModel = null;
}
InputSelectionModel.CommandInputSelectionModel commandInputSelectionModel = (InputSelectionModel.CommandInputSelectionModel) inputSelectionModel;
ApplicationCommand selectedCommand = (commandInputSelectionModel == null || (inputModel2 = commandInputSelectionModel.getInputModel()) == null || (inputCommandContext2 = inputModel2.getInputCommandContext()) == null) ? null : inputCommandContext2.getSelectedCommand();
InputSelectionModel inputSelectionModel2 = autocompleteInputSelectionModel2 != null ? autocompleteInputSelectionModel2.getInputSelectionModel() : null;
if (!(inputSelectionModel2 instanceof InputSelectionModel.CommandInputSelectionModel)) {
inputSelectionModel2 = null;
}
InputSelectionModel.CommandInputSelectionModel commandInputSelectionModel2 = (InputSelectionModel.CommandInputSelectionModel) inputSelectionModel2;
ApplicationCommand selectedCommand2 = (commandInputSelectionModel2 == null || (inputModel = commandInputSelectionModel2.getInputModel()) == null || (inputCommandContext = inputModel.getInputCommandContext()) == null) ? null : inputCommandContext.getSelectedCommand();
if (!m.areEqual(selectedCommand != null ? selectedCommand.getId() : null, selectedCommand2 != null ? selectedCommand2.getId() : null)) {
return selectedCommand;
}
return null;
}
@MainThread
private final InputEditTextAction onPreAutocompleteCompute(CharSequence charSequence) {
return replacementSpanCommandParamDeletion(charSequence);

View file

@ -68,6 +68,7 @@ public final class InputAutocomplete {
private final ChatInputApplicationsAdapter categoriesAdapter;
private final Long channel;
private final RecyclerView commandBrowserAppsRecyclerView;
private boolean commandBrowserOpen;
private final FlexEditText editText;
private final AppFragment fragment;
private final SelectedApplicationCommandAdapter selectedApplicationCommandAdapter;
@ -412,6 +413,9 @@ public final class InputAutocomplete {
} else if (m.areEqual(autocompleteViewState, AutocompleteViewState.Hidden.INSTANCE)) {
hideAutocomplete();
}
if (!(autocompleteViewState instanceof AutocompleteViewState.CommandBrowser)) {
this.commandBrowserOpen = false;
}
StoreStream.Companion.getAutocomplete().setAutocompleteVisible(!(autocompleteViewState instanceof AutocompleteViewState.Hidden));
}
@ -455,6 +459,11 @@ public final class InputAutocomplete {
this.stickersContainer.setVisibility(8);
List<Autocompletable> flattenCommandsModel = commandBrowser.getDiscoverCommands().getFlattenCommandsModel();
boolean z2 = (flattenCommandsModel.isEmpty() ^ true) || commandBrowser.getDiscoverCommands().getLoadState().isLoading();
if (!this.commandBrowserOpen && z2) {
this.commandBrowserOpen = true;
StoreStream.Companion companion = StoreStream.Companion;
companion.getAnalytics().trackApplicationCommandBrowserOpened(companion.getChannelsSelected().getId());
}
if ((this.autocompleteRecyclerView.getVisibility() == 0) != z2) {
this.autocompleteRecyclerView.setVisibility(z2 ? 0 : 8);
}
@ -571,7 +580,9 @@ public final class InputAutocomplete {
Event.ScrollAutocompletablesToApplication scrollAutocompletablesToApplication = (Event.ScrollAutocompletablesToApplication) event;
ChatInputAutocompleteAdapter.scrollToPosition$default(this.autocompleteAdapter, scrollAutocompletablesToApplication.getTargetPosition(), 0, false, 6, null);
this.categoriesAdapter.selectApplication(scrollAutocompletablesToApplication.getApplicationId());
this.commandBrowserAppsRecyclerView.smoothScrollToPosition(this.categoriesAdapter.getPositionOfApplication(scrollAutocompletablesToApplication.getApplicationId()));
if (this.categoriesAdapter.getPositionOfApplication(scrollAutocompletablesToApplication.getApplicationId()) != -1) {
this.commandBrowserAppsRecyclerView.smoothScrollToPosition(this.categoriesAdapter.getPositionOfApplication(scrollAutocompletablesToApplication.getApplicationId()));
}
}
}

View file

@ -321,7 +321,7 @@ public final class WidgetSettings extends AppFragment implements OnTabSelectedLi
TextView textView = binding.f;
m.checkNotNullExpressionValue(textView, "appInfoHeader");
String string = getString(R.string.app_information);
textView.setText(string + " - 89.9 - Beta (89109)");
textView.setText(string + " - 89.10 - Beta (89110)");
binding.f1972z.setOnClickListener(new WidgetSettings$onViewBound$$inlined$with$lambda$3(this));
binding.u.setOnClickListener(WidgetSettings$onViewBound$1$5.INSTANCE);
binding.q.setOnClickListener(WidgetSettings$onViewBound$1$6.INSTANCE);

View file

@ -1374,7 +1374,7 @@
<string name="color_picker_title">Select a color</string>
<string name="color_picker_transparency">Transparency</string>
<string name="color_picker_use_default">Use Default</string>
<string name="res_2131887454_com_crashlytics_android_build_id">ff2cb8672d254680a075ca7644953ef6</string>
<string name="res_2131887454_com_crashlytics_android_build_id">737bc2c2411d4715b57c2962400cce18</string>
<string name="coming_soon">Coming Soon</string>
<string name="command_accessibility_desc_app_header_item">Slash command application {applicationName}</string>
<string name="command_accessibility_desc_app_item">{applicationName} application</string>