68 lines
4.1 KiB
Java
68 lines
4.1 KiB
Java
package com.discord.widgets.home;
|
|
|
|
import android.view.Menu;
|
|
import android.view.MenuItem;
|
|
import com.airbnb.lottie.parser.AnimatableValueParser;
|
|
import com.discord.api.channel.Channel;
|
|
import d0.z.d.m;
|
|
import rx.functions.Action1;
|
|
/* compiled from: WidgetHomeHeaderManager.kt */
|
|
public final class WidgetHomeHeaderManager$getOnConfigureAction$1<T> implements Action1<Menu> {
|
|
public final /* synthetic */ WidgetHomeModel $this_getOnConfigureAction;
|
|
|
|
public WidgetHomeHeaderManager$getOnConfigureAction$1(WidgetHomeModel widgetHomeModel) {
|
|
this.$this_getOnConfigureAction = widgetHomeModel;
|
|
}
|
|
|
|
public final void call(Menu menu) {
|
|
boolean z2 = false;
|
|
boolean z3 = this.$this_getOnConfigureAction.getChannel() != null && AnimatableValueParser.x1(this.$this_getOnConfigureAction.getChannel());
|
|
Channel channel = this.$this_getOnConfigureAction.getChannel();
|
|
Integer valueOf = channel != null ? Integer.valueOf(channel.A()) : null;
|
|
if ((valueOf != null && valueOf.intValue() == 3) || (valueOf != null && valueOf.intValue() == 1)) {
|
|
MenuItem findItem = menu.findItem(2131363958);
|
|
m.checkNotNullExpressionValue(findItem, "menu.findItem(R.id.menu_chat_search)");
|
|
findItem.setVisible(false);
|
|
MenuItem findItem2 = menu.findItem(2131363959);
|
|
m.checkNotNullExpressionValue(findItem2, "menu.findItem(R.id.menu_chat_side_panel)");
|
|
findItem2.setVisible(true);
|
|
MenuItem findItem3 = menu.findItem(2131363964);
|
|
m.checkNotNullExpressionValue(findItem3, "menu.findItem(R.id.menu_chat_thread_browser)");
|
|
findItem3.setVisible(false);
|
|
} else if ((valueOf != null && valueOf.intValue() == 5) || (valueOf != null && valueOf.intValue() == 0)) {
|
|
MenuItem findItem4 = menu.findItem(2131363959);
|
|
m.checkNotNullExpressionValue(findItem4, "menu.findItem(R.id.menu_chat_side_panel)");
|
|
findItem4.setVisible(true);
|
|
MenuItem findItem5 = menu.findItem(2131363958);
|
|
m.checkNotNullExpressionValue(findItem5, "menu.findItem(R.id.menu_chat_search)");
|
|
findItem5.setVisible(!this.$this_getOnConfigureAction.getThreadExperimentEnabled());
|
|
MenuItem findItem6 = menu.findItem(2131363964);
|
|
m.checkNotNullExpressionValue(findItem6, "menu.findItem(R.id.menu_chat_thread_browser)");
|
|
findItem6.setVisible(this.$this_getOnConfigureAction.getThreadExperimentEnabled());
|
|
} else if ((valueOf != null && valueOf.intValue() == 10) || ((valueOf != null && valueOf.intValue() == 12) || (valueOf != null && valueOf.intValue() == 11))) {
|
|
MenuItem findItem7 = menu.findItem(2131363959);
|
|
m.checkNotNullExpressionValue(findItem7, "menu.findItem(R.id.menu_chat_side_panel)");
|
|
findItem7.setVisible(false);
|
|
MenuItem findItem8 = menu.findItem(2131363958);
|
|
m.checkNotNullExpressionValue(findItem8, "menu.findItem(R.id.menu_chat_search)");
|
|
findItem8.setVisible(false);
|
|
MenuItem findItem9 = menu.findItem(2131363964);
|
|
m.checkNotNullExpressionValue(findItem9, "menu.findItem(R.id.menu_chat_thread_browser)");
|
|
findItem9.setVisible(true);
|
|
}
|
|
boolean z4 = this.$this_getOnConfigureAction.getChannel() != null && AnimatableValueParser.s1(this.$this_getOnConfigureAction.getChannel());
|
|
MenuItem findItem10 = menu.findItem(2131363960);
|
|
m.checkNotNullExpressionValue(findItem10, "menu.findItem(R.id.menu_chat_start_call)");
|
|
findItem10.setVisible(!this.$this_getOnConfigureAction.isCallConnected() && z4 && !z3);
|
|
MenuItem findItem11 = menu.findItem(2131363962);
|
|
m.checkNotNullExpressionValue(findItem11, "menu.findItem(R.id.menu_chat_start_video_call)");
|
|
findItem11.setVisible(!this.$this_getOnConfigureAction.isCallConnected() && z4 && !z3);
|
|
MenuItem findItem12 = menu.findItem(2131363963);
|
|
m.checkNotNullExpressionValue(findItem12, "menu.findItem(R.id.menu_chat_stop_call)");
|
|
if (this.$this_getOnConfigureAction.isCallConnected() && !z3) {
|
|
z2 = true;
|
|
}
|
|
findItem12.setVisible(z2);
|
|
}
|
|
}
|