yandex / mapkit-android-demo

MapKit Android demo
Other
120 stars 59 forks source link

Panorama #39

Closed iFr0z closed 5 years ago

iFr0z commented 5 years ago

On the emulator (API 28) works perfectly. untitled-1

On the real device Xperia XA1 Plus (API 26): 20181014_121118729_ios

How fix it?

code:

if (!setPanorama) {
    showPanorama()
}

private fun showPanorama() {
      val panoramaService = MapKitFactory.getInstance().createPanoramaService()
      panoramaService.findNearest(routeEndLocation, this)
}

override fun onPanoramaSearchResult(panoramaId: String) {
      panoview.visibility = VISIBLE

      panoview.player.openPanorama(panoramaId)
      panoview.player.enableLoadingWheel()
      panoview.player.onMemoryWarning()

      setPanorama = true
}

<com.yandex.mapkit.panorama.PanoramaView
            android:id="@+id/panoview"
            android:layout_width="match_parent"
            android:layout_height="120dp"
            android:layout_marginTop="4dp"
            android:paddingBottom="8dp"
            android:visibility="gone" />
Tagakov commented 5 years ago

Besides on screenshots layouts look different, I suppose that your panorama is embedded into scrollable bottomsheet or something similar. Try to add app:movable="true" attribute to your PanoramaView tag.

iFr0z commented 5 years ago

@Tagakov

Besides on screenshots layouts look different, I suppose that your panorama is embedded into scrollable bottomsheet

You're absolutely right. I totally forgot to mention it.


Thank you so much for your help! app:movable="true" - this attribute has helped me :)