AdvancedPlaceDetailsFragment

public final class AdvancedPlaceDetailsFragment extends Fragment implements PlaceActionController


A fragment that displays information about a place.

This advanced fragment supports configuring custom action buttons, media search, and review search.

Summary

Nested types

Enumeration of all content types supported by AdvancedPlaceDetailsFragment.

Public fields

static final @NonNull List<@NonNull AdvancedPlaceDetailsFragment.Content>

List containing all Content supported by the widget.

static final @NonNull List<@NonNull AdvancedPlaceDetailsFragment.Content>

A list containing standard Content for the widget.

Public constructors

Public methods

final void

Applies media search options to the fragment.

final void

Applies review search options to the fragment.

final void

Loads details of the place at the specified coordinates and displays it on the widget.

final void

Loads details of the place with the specified place ID and displays it on the widget.

final void

Loads details of the place with the specified place resource name and displays it on the widget.

static final @NonNull AdvancedPlaceDetailsFragment
newInstance(
    @NonNull List<@NonNull AdvancedPlaceDetailsFragment.Content> content,
    @NonNull Orientation orientation,
    @StyleRes int theme
)

Returns a new instance of AdvancedPlaceDetailsFragment.

final void

Sets a listener to be invoked when internal photos are loaded or fail to load.

void

Sets the PlaceActionProvider to customize the action buttons displayed on the widget.

final void

Sets a listener to be invoked when a place is loaded into the widget or when the widget fails to load.

final void

Sets a listener to be invoked when the internal review search completes.

Inherited methods

From androidx.fragment.app.Fragment
void
void
dump(
    @NonNull String p0,
    @Nullable FileDescriptor p1,
    @NonNull PrintWriter p2,
    @Nullable String[] p3
)
final boolean
final @Nullable FragmentActivity
boolean
boolean
final @Nullable Bundle
final @NonNull FragmentManager
@Nullable Context
@NonNull CreationExtras
@NonNull ViewModelProvider.Factory
@Nullable Object
@Nullable Object
final @Nullable FragmentManager

This method is deprecated. Deprecated in Java

final @Nullable Object
final int
final @NonNull LayoutInflater
@NonNull LayoutInflater

This method is deprecated. Deprecated in Java

@NonNull Lifecycle
@NonNull LoaderManager

This method is deprecated. Deprecated in Java

final @Nullable Fragment
final @NonNull FragmentManager
@Nullable Object
final @NonNull Resources
final boolean

This method is deprecated. Deprecated in Java

@Nullable Object
final @NonNull SavedStateRegistry
@Nullable Object
@Nullable Object
final @NonNull String
final @NonNull String
getString(@StringRes int p0, @NonNull Object... p1)
final @Nullable String
final @Nullable Fragment

This method is deprecated. Deprecated in Java

final int

This method is deprecated. Deprecated in Java

final @NonNull CharSequence
getText(@StringRes int p0)
boolean

This method is deprecated. Deprecated in Java

@Nullable View
@NonNull LifecycleOwner
@NonNull LiveData<@NonNull LifecycleOwner>
@NonNull ViewModelStore
final boolean
final int
final boolean
final boolean
final boolean
final boolean
final boolean
final boolean
final boolean
final boolean
final boolean
void

This method is deprecated. Deprecated in Java

void
onActivityResult(int p0, int p1, @Nullable Intent p2)

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void
boolean
@Nullable Animation
@MainThread
onCreateAnimation(int p0, boolean p1, int p2)
@Nullable Animator
@MainThread
onCreateAnimator(int p0, boolean p1, int p2)
void
void

This method is deprecated. Deprecated in Java

void
void

This method is deprecated. Deprecated in Java

void
void
@NonNull LayoutInflater
void
void

This method is deprecated. Deprecated in Java

void
void
void
boolean

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void
void
void

This method is deprecated. Deprecated in Java

void
void
onRequestPermissionsResult(int p0, @NonNull String[] p1, @NonNull int[] p2)

This method is deprecated. Deprecated in Java

void
void
void
void
@Nullable Context
void
final void
final @NonNull ActivityResultLauncher<@NonNull I>
@MainThread
<I extends Object, O extends Object> registerForActivityResult(
    @NonNull ActivityResultContract<@NonNull I, @NonNull O> contract,
    @NonNull ActivityResultCallback<@NonNull O> callback
)
final @NonNull ActivityResultLauncher<@NonNull I>
@MainThread
<I extends Object, O extends Object> registerForActivityResult(
    @NonNull ActivityResultContract<@NonNull I, @NonNull O> contract,
    @NonNull ActivityResultRegistry registry,
    @NonNull ActivityResultCallback<@NonNull O> callback
)
void
void
final void
requestPermissions(@NonNull String[] p0, int p1)

This method is deprecated. Deprecated in Java

final @NonNull FragmentActivity
final @NonNull Bundle
final @NonNull Context
final @NonNull FragmentManager

This method is deprecated. Deprecated in Java

final @NonNull Object
final @NonNull Fragment
final @NonNull View
void
void
void
void
void
void
void
void
setHasOptionsMenu(boolean p0)

This method is deprecated. Deprecated in Java

void
void
setMenuVisibility(boolean p0)
void
void
setRetainInstance(boolean p0)

This method is deprecated. Deprecated in Java

void
void
void
void

This method is deprecated. Deprecated in Java

void
setUserVisibleHint(boolean p0)

This method is deprecated. Deprecated in Java

boolean
void
void
void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void
startIntentSenderForResult(
    @NonNull IntentSender p0,
    int p1,
    @Nullable Intent p2,
    int p3,
    int p4,
    int p5,
    @Nullable Bundle p6
)

This method is deprecated. Deprecated in Java

void
@NonNull String
void

Public fields

ALL_CONTENT

public static final @NonNull List<@NonNull AdvancedPlaceDetailsFragment.ContentALL_CONTENT

List containing all Content supported by the widget. This can be passed into the widget's newInstance function to show all content on the widget.

STANDARD_CONTENT

public static final @NonNull List<@NonNull AdvancedPlaceDetailsFragment.ContentSTANDARD_CONTENT

A list containing standard Content for the widget. This can be passed into the widget's newInstance function to show standard content on the widget.

Public constructors

AdvancedPlaceDetailsFragment

public AdvancedPlaceDetailsFragment()

Public methods

applySearchMediaOptions

@MainThread
public final void applySearchMediaOptions(SearchMediaOptions options)

Applies media search options to the fragment.

Parameters
SearchMediaOptions options

the SearchMediaOptions to apply, or null to clear.

applySearchReviewsOptions

public final void applySearchReviewsOptions(SearchReviewsOptions options)

Applies review search options to the fragment. If a place is currently loaded, the review search will be performed immediately and the reviews will be updated.

Parameters
SearchReviewsOptions options

the SearchReviewsOptions to apply.

loadWithCoordinates

public final void loadWithCoordinates(@NonNull LatLng coordinates)

Loads details of the place at the specified coordinates and displays it on the widget.

loadWithPlaceId

public final void loadWithPlaceId(@NonNull String placeId)

Loads details of the place with the specified place ID and displays it on the widget.

loadWithResourceName

public final void loadWithResourceName(@NonNull String resourceName)

Loads details of the place with the specified place resource name and displays it on the widget.

newInstance

public static final @NonNull AdvancedPlaceDetailsFragment newInstance(
    @NonNull List<@NonNull AdvancedPlaceDetailsFragment.Content> content,
    @NonNull Orientation orientation,
    @StyleRes int theme
)

Returns a new instance of AdvancedPlaceDetailsFragment.

After creating a new instance of AdvancedPlaceDetailsFragment, you may call loadWithPlaceId or loadWithResourceName to load the place details.

Parameters
@NonNull List<@NonNull AdvancedPlaceDetailsFragment.Content> content

a list of Content values to be shown on the widget.

@NonNull Orientation orientation

the Orientation of the widget. Currently only Orientation.VERTICAL is supported.

@StyleRes int theme

a theme that inherits from R.style.PlacesMaterialTheme and overrides theme attributes to customize the widget appearance.

setMediaResultListener

public final void setMediaResultListener(@NonNull MediaResultListener listener)

Sets a listener to be invoked when internal photos are loaded or fail to load.

Parameters
@NonNull MediaResultListener listener

the MediaResultListener to be invoked.

setPlaceActionProvider

@MainThread
public void setPlaceActionProvider(PlaceActionProvider placeActionProvider)

Sets the PlaceActionProvider to customize the action buttons displayed on the widget.

Parameters
PlaceActionProvider placeActionProvider

the provider to set, or null to clear it.

setPlaceLoadListener

public final void setPlaceLoadListener(@NonNull PlaceLoadListener listener)

Sets a listener to be invoked when a place is loaded into the widget or when the widget fails to load.

setReviewResultListener

public final void setReviewResultListener(ReviewResultListener listener)

Sets a listener to be invoked when the internal review search completes.

Parameters
ReviewResultListener listener

The listener to be notified of the ReviewSearchResult, or null to remove the listener.