public final class FragmentGetContextFix
extends java.lang.Object
In order to set the flag, bind a boolean value qualified with
FragmentGetContextFix.DisableFragmentGetContextFix
into a set in the SingletonComponent
. A set is used
instead of an optional binding to avoid a dependency on Guava. Only one value may be bound into
the set within a given app. If this is not set, the default is to not use the fix. Example for
binding the value:
@Module
@InstallIn(SingletonComponent.class)
public final class DisableFragmentGetContextFixModule {
@Provides
@IntoSet
@FragmentGetContextFix.DisableFragmentGetContextFix
static Boolean provideDisableFragmentGetContextFix() {
return // true or false depending on some rollout logic for your app
}
}
Modifier and Type | Class and Description |
---|---|
static interface |
FragmentGetContextFix.DisableFragmentGetContextFix
Qualifier annotation to bind disable the Fragment.getContext() fix at runtime.
|
static interface |
FragmentGetContextFix.FragmentGetContextFixEntryPoint
Entry point for getting the flag.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isFragmentGetContextFixDisabled(android.content.Context context) |