ऐडवांस प्लेस लिस्ट कॉम्पोनेंट

ऐडवांस प्लेस लिस्ट कॉम्पोनेंट की मदद से, जगहों की सूची तय की जा सकती है और उसे दिखाया जा सकता है. Place Details कॉम्पोनेंट (जगह का आईडी, प्लेस रिसॉर्स के नाम या अक्षांश/देशांतर के कोऑर्डिनेट) के साथ काम करने वाली एक ही तरह की 20 जगहों को सूची में शामिल किया जा सकता है.

सूची को हॉरिज़ॉन्टल या वर्टिकल फ़ॉर्मैट में दिखाया जा सकता है. डिफ़ॉल्ट रूप से, सूची वर्टिकल फ़ॉर्मैट में दिखती है. सूची में शामिल हर आइटम के लिए, वही जानकारी और कॉन्फ़िगरेशन के विकल्प उपलब्ध होते हैं जो प्लेस की जानकारी वाले कॉम्पैक्ट और फ़ुल कार्ड के लिए उपलब्ध होते हैं.

सूची बनाने के लिए, AdvancedPlaceListFragment के PlaceActionProvider इंटरफ़ेस का इस्तेमाल करें.

बिलिंग

सूची के हर अनुरोध के लिए, आपसे शुल्क लिया जाता है. सूची में किया गया कोई भी बदलाव, बिलिंग के लिए एक नया इवेंट होता है.

उदाहरण

AdvancedPlaceList फ़्रैगमेंट बनाना

Kotlin

// Initialize first
Places.initializeWithNewPlacesApiEnabled(context, API_KEY)

// how fragment is created
AdvancedPlaceListFragment.newInstance(
          selectedContent,
          orientation,
          R.style.BrandedPlaceDetailsTheme,
        )

// fragments support the same configurations that PlaceSearchFragment supports
fragment.preferTruncation = false
fragment.attributionPosition = AttributionPosition.BOTTOM
fragment.mediaSize = AdvancedPlaceListFragment.MediaSize.SMALL
fragment.selectable = true  

प्लेस लिस्ट दिखाना

Kotlin

// You can use resourceNames or placeIds
advancedPlaceListFragment.configureFromPlaceIds(placeIds)

advancedPlaceListFragment.configureFromResourceNames(resourceNames)

// Alternatively, use coordinates, which are a list of LatLng:
advancedPlaceListFragment.configureFromCoordinates(coordinates)
// Uses reverse geocoding to get the place

नतीजे सुनना

Kotlin

// Attach the existing PlaceSearchFragmentListener to get notified when places load or are selected from the results list.
override fun onAttachFragment(fragment: Fragment) {
    super.onAttachFragment(fragment)
    when (fragment) {
      // Reuse the placeSearchFragmetnListener from the Essentials version
      is AdvancedPlaceSearchFragment -> fragment.registerListener(placeSearchFragmentListener)
      // Use placeListFragmentListener, it's functionally identical but with a new name.  
      is AdvancedPlaceListFragment -> fragment.registerListener(advancedPlaceListFragmentListener)
    }
}