2021-06-27 20:44:35 +00:00
package com.discord.widgets.servers ;
import android.content.Context ;
import android.os.Bundle ;
import android.view.View ;
import android.widget.TableLayout ;
import androidx.fragment.app.Fragment ;
import androidx.fragment.app.FragmentManager ;
import c.d.b.a.a ;
import com.discord.databinding.WidgetServerSettingsChannelsSortFabMenuBinding ;
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate ;
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt ;
import com.discord.utilities.views.FloatingButtonMenuInitializer ;
import com.google.android.material.floatingactionbutton.FloatingActionButton ;
import d0.o ;
import d0.t.h0 ;
import d0.z.d.m ;
import kotlin.jvm.internal.DefaultConstructorMarker ;
import kotlin.reflect.KProperty ;
import rx.functions.Action0 ;
/* compiled from: WidgetServerSettingsChannelsFabMenuFragment.kt */
public final class WidgetServerSettingsChannelsFabMenuFragment extends Fragment {
public static final /* synthetic */ KProperty [ ] $$delegatedProperties = { a . W ( WidgetServerSettingsChannelsFabMenuFragment . class , " binding " , " getBinding()Lcom/discord/databinding/WidgetServerSettingsChannelsSortFabMenuBinding; " , 0 ) } ;
public static final Companion Companion = new Companion ( null ) ;
private static final String INTENT_EXTRA_GUILD_ID = " INTENT_EXTRA_GUILD_ID " ;
private static final String TAG = " channels fab menu " ;
private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt . viewBinding$default ( this , WidgetServerSettingsChannelsFabMenuFragment$binding$2 . INSTANCE , null , 2 , null ) ;
private Action0 dismissHandler ;
/* compiled from: WidgetServerSettingsChannelsFabMenuFragment.kt */
public static final class Companion {
private Companion ( ) {
}
public /* synthetic */ Companion ( DefaultConstructorMarker defaultConstructorMarker ) {
this ( ) ;
}
public final void show ( long j , FragmentManager fragmentManager , Action0 action0 ) {
m . checkNotNullParameter ( fragmentManager , " fragmentManager " ) ;
m . checkNotNullParameter ( action0 , " dismissHandler " ) ;
WidgetServerSettingsChannelsFabMenuFragment widgetServerSettingsChannelsFabMenuFragment = new WidgetServerSettingsChannelsFabMenuFragment ( ) ;
Bundle bundle = new Bundle ( ) ;
bundle . putLong ( " INTENT_EXTRA_GUILD_ID " , j ) ;
widgetServerSettingsChannelsFabMenuFragment . setArguments ( bundle ) ;
WidgetServerSettingsChannelsFabMenuFragment . access$setDismissHandler$p ( widgetServerSettingsChannelsFabMenuFragment , action0 ) ;
2021-07-13 20:23:20 +00:00
fragmentManager . beginTransaction ( ) . setCustomAnimations ( 2130772015 , 2130772017 ) . add ( 2131365736 , widgetServerSettingsChannelsFabMenuFragment , " channels fab menu " ) . addToBackStack ( " channels fab menu " ) . commit ( ) ;
2021-06-27 20:44:35 +00:00
}
}
public WidgetServerSettingsChannelsFabMenuFragment ( ) {
2021-07-13 20:23:20 +00:00
super ( 2131559168 ) ;
2021-06-27 20:44:35 +00:00
}
public static final /* synthetic */ void access$dismiss ( WidgetServerSettingsChannelsFabMenuFragment widgetServerSettingsChannelsFabMenuFragment ) {
widgetServerSettingsChannelsFabMenuFragment . dismiss ( ) ;
}
public static final /* synthetic */ Action0 access$getDismissHandler$p ( WidgetServerSettingsChannelsFabMenuFragment widgetServerSettingsChannelsFabMenuFragment ) {
return widgetServerSettingsChannelsFabMenuFragment . dismissHandler ;
}
public static final /* synthetic */ void access$setDismissHandler$p ( WidgetServerSettingsChannelsFabMenuFragment widgetServerSettingsChannelsFabMenuFragment , Action0 action0 ) {
widgetServerSettingsChannelsFabMenuFragment . dismissHandler = action0 ;
}
private final View . OnClickListener createListener ( View . OnClickListener onClickListener ) {
return new WidgetServerSettingsChannelsFabMenuFragment$createListener$1 ( this , onClickListener ) ;
}
private final void dismiss ( ) {
getParentFragmentManager ( ) . beginTransaction ( ) . remove ( this ) . commit ( ) ;
Action0 action0 = this . dismissHandler ;
if ( action0 ! = null ) {
action0 . call ( ) ;
}
}
private final WidgetServerSettingsChannelsSortFabMenuBinding getBinding ( ) {
return ( WidgetServerSettingsChannelsSortFabMenuBinding ) this . binding$delegate . getValue ( ( Fragment ) this , $$delegatedProperties [ 0 ] ) ;
}
public static final void show ( long j , FragmentManager fragmentManager , Action0 action0 ) {
Companion . show ( j , fragmentManager , action0 ) ;
}
@Override // androidx.fragment.app.Fragment
public void onPause ( ) {
super . onPause ( ) ;
dismiss ( ) ;
}
@Override // androidx.fragment.app.Fragment
public void onResume ( ) {
super . onResume ( ) ;
WidgetServerSettingsChannelsSortFabMenuBinding binding = getBinding ( ) ;
m . checkNotNullExpressionValue ( binding , " binding " ) ;
binding . a . setOnClickListener ( new WidgetServerSettingsChannelsFabMenuFragment$onResume$1 ( this ) ) ;
Bundle arguments = getArguments ( ) ;
long j = 0 ;
if ( arguments ! = null ) {
j = arguments . getLong ( " INTENT_EXTRA_GUILD_ID " , 0 ) ;
}
Context requireContext = requireContext ( ) ;
m . checkNotNullExpressionValue ( requireContext , " requireContext() " ) ;
2021-07-13 20:23:20 +00:00
FloatingButtonMenuInitializer floatingButtonMenuInitializer = new FloatingButtonMenuInitializer ( requireContext , h0 . mapOf ( o . to ( 2131363209 , createListener ( new WidgetServerSettingsChannelsFabMenuFragment$onResume$2 ( this , j ) ) ) , o . to ( 2131363211 , createListener ( new WidgetServerSettingsChannelsFabMenuFragment$onResume$3 ( this , j ) ) ) , o . to ( 2131363210 , createListener ( new WidgetServerSettingsChannelsFabMenuFragment$onResume$4 ( this , j ) ) ) , o . to ( 2131363212 , createListener ( WidgetServerSettingsChannelsFabMenuFragment$onResume$5 . INSTANCE ) ) ) ) ;
TableLayout tableLayout = getBinding ( ) . f1888c ;
2021-06-27 20:44:35 +00:00
m . checkNotNullExpressionValue ( tableLayout , " binding.fabMenuTable " ) ;
FloatingActionButton floatingActionButton = getBinding ( ) . b ;
m . checkNotNullExpressionValue ( floatingActionButton , " binding.fabMenuMainFab " ) ;
floatingButtonMenuInitializer . initialize ( tableLayout , floatingActionButton , new WidgetServerSettingsChannelsFabMenuFragment$onResume$6 ( this ) ) ;
}
}