2021-06-27 20:44:35 +00:00
|
|
|
package com.discord.widgets.nux;
|
|
|
|
|
|
|
|
import android.app.Dialog;
|
|
|
|
import android.graphics.drawable.ColorDrawable;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.Window;
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
import androidx.fragment.app.FragmentManager;
|
|
|
|
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
|
|
|
import androidx.viewpager2.widget.MarginPageTransformer;
|
|
|
|
import androidx.viewpager2.widget.ViewPager2;
|
|
|
|
import c.d.b.a.a;
|
|
|
|
import com.discord.app.AppDialog;
|
|
|
|
import com.discord.app.AppFragment;
|
|
|
|
import com.discord.databinding.WidgetNavigationHelpBinding;
|
|
|
|
import com.discord.utilities.analytics.AnalyticsTracker;
|
|
|
|
import com.discord.utilities.dimen.DimenUtils;
|
|
|
|
import com.discord.utilities.view.recycler.ViewPager2ExtensionsKt;
|
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
|
|
import com.google.android.material.tabs.TabLayout;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
import kotlin.reflect.KProperty;
|
|
|
|
/* compiled from: WidgetNavigationHelp.kt */
|
|
|
|
public final class WidgetNavigationHelp extends AppDialog {
|
|
|
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.W(WidgetNavigationHelp.class, "binding", "getBinding()Lcom/discord/databinding/WidgetNavigationHelpBinding;", 0)};
|
|
|
|
public static final Companion Companion = new Companion(null);
|
|
|
|
private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt.viewBinding$default(this, WidgetNavigationHelp$binding$2.INSTANCE, null, 2, null);
|
|
|
|
|
|
|
|
/* compiled from: WidgetNavigationHelp.kt */
|
|
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void show(FragmentManager fragmentManager) {
|
|
|
|
m.checkNotNullParameter(fragmentManager, "fragmentManager");
|
|
|
|
AnalyticsTracker.openModal$default("Help Nav", "Guild List", null, 4, null);
|
|
|
|
new WidgetNavigationHelp().show(fragmentManager, "javaClass");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: WidgetNavigationHelp.kt */
|
|
|
|
public static final class NuxPageFragment extends AppFragment {
|
|
|
|
public NuxPageFragment(int i) {
|
|
|
|
super(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: WidgetNavigationHelp.kt */
|
|
|
|
public static final class NuxPagerAdapter extends FragmentStateAdapter {
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public NuxPagerAdapter(Fragment fragment) {
|
|
|
|
super(fragment);
|
|
|
|
m.checkNotNullParameter(fragment, "fragment");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.viewpager2.adapter.FragmentStateAdapter
|
|
|
|
public Fragment createFragment(int i) {
|
|
|
|
int i2;
|
|
|
|
if (i == 0) {
|
2021-07-03 23:36:06 +00:00
|
|
|
i2 = 2131559101;
|
2021-06-27 20:44:35 +00:00
|
|
|
} else if (i == 1) {
|
2021-07-03 23:36:06 +00:00
|
|
|
i2 = 2131559099;
|
2021-06-27 20:53:42 +00:00
|
|
|
} else if (i == 2) {
|
2021-07-03 23:36:06 +00:00
|
|
|
i2 = 2131559100;
|
2021-06-27 20:44:35 +00:00
|
|
|
} else {
|
|
|
|
throw new IllegalStateException(a.l("unknown nux page: ", i));
|
|
|
|
}
|
|
|
|
return new NuxPageFragment(i2);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
|
|
|
|
public int getItemCount() {
|
|
|
|
return 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public WidgetNavigationHelp() {
|
2021-07-03 23:36:06 +00:00
|
|
|
super(2131559098);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final WidgetNavigationHelpBinding getBinding() {
|
|
|
|
return (WidgetNavigationHelpBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppDialog, androidx.fragment.app.DialogFragment, androidx.fragment.app.Fragment
|
|
|
|
public void onStart() {
|
|
|
|
Window window;
|
|
|
|
super.onStart();
|
|
|
|
Dialog dialog = getDialog();
|
|
|
|
if (dialog != null && (window = dialog.getWindow()) != null) {
|
|
|
|
window.setDimAmount(0.9f);
|
|
|
|
window.setLayout(-1, -1);
|
|
|
|
window.setBackgroundDrawable(new ColorDrawable(0));
|
|
|
|
window.setSoftInputMode(53);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppDialog
|
|
|
|
public void onViewBound(View view) {
|
|
|
|
m.checkNotNullParameter(view, "view");
|
|
|
|
super.onViewBound(view);
|
|
|
|
getBinding().d.setPageTransformer(new MarginPageTransformer(DimenUtils.dpToPixels(8)));
|
|
|
|
ViewPager2 viewPager2 = getBinding().d;
|
|
|
|
m.checkNotNullExpressionValue(viewPager2, "binding.navigationHelpNuxPager");
|
|
|
|
viewPager2.setAdapter(new NuxPagerAdapter(this));
|
2021-07-03 23:36:06 +00:00
|
|
|
TabLayout tabLayout = getBinding().f1837c;
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(tabLayout, "binding.navigationHelpIndicators");
|
|
|
|
ViewPager2 viewPager22 = getBinding().d;
|
|
|
|
m.checkNotNullExpressionValue(viewPager22, "binding.navigationHelpNuxPager");
|
|
|
|
ViewPager2ExtensionsKt.setUpWithViewPager2$default(tabLayout, viewPager22, null, 2, null);
|
|
|
|
getBinding().b.setOnClickListener(new WidgetNavigationHelp$onViewBound$1(this));
|
|
|
|
}
|
|
|
|
}
|