@Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_street_view); SupportStreetViewPanoramaFragment streetViewPanoramaFragment = (SupportStreetViewPanoramaFragment) getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama); streetViewPanoramaFragment.getStreetViewPanoramaAsync( new OnStreetViewPanoramaReadyCallback() { @Override public void onStreetViewPanoramaReady(StreetViewPanorama panorama) { // Only set the panorama to SYDNEY on startup (when no panoramas have been // loaded which is when the savedInstanceState is null). if (savedInstanceState == null) { panorama.setPosition(SYDNEY); } } }); }
private void setUpStreetViewPanoramaIfNeeded(final LatLng location) { mMapFragment.getStreetViewPanoramaAsync(new OnStreetViewPanoramaReadyCallback() { @Override public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) { if (streetViewPanorama != null) { streetViewPanorama.setPosition(location); streetViewPanorama.setUserNavigationEnabled(true); streetViewPanorama.setPanningGesturesEnabled(true); streetViewPanorama.setZoomGesturesEnabled(true); StreetViewPanoramaCamera galleryOrientation = StreetViewPanoramaCamera. builder(streetViewPanorama.getPanoramaCamera()) .bearing(mDetail.getBearing()) .tilt(mDetail.getTilt()) .build(); streetViewPanorama.animateTo(galleryOrientation, TimeUnit.SECONDS.toMillis(1)); } } }); }
@Override public void call(final Subscriber<? super StreetViewPanoramaOrientation> subscriber) { MainThreadSubscription.verifyMainThread(); StreetViewPanorama.OnStreetViewPanoramaLongClickListener listener = new StreetViewPanorama.OnStreetViewPanoramaLongClickListener() { @Override public void onStreetViewPanoramaLongClick( StreetViewPanoramaOrientation streetViewPanoramaOrientation) { if (!subscriber.isUnsubscribed()) { subscriber.onNext(streetViewPanoramaOrientation); } } }; streetViewPanorama.setOnStreetViewPanoramaLongClickListener(listener); subscriber.add(new MainThreadSubscription() { @Override protected void onUnsubscribe() { streetViewPanorama.setOnStreetViewPanoramaLongClickListener(null); } }); }
@Override public void call(final Subscriber<? super StreetViewPanoramaOrientation> subscriber) { MainThreadSubscription.verifyMainThread(); StreetViewPanorama.OnStreetViewPanoramaClickListener listener = new StreetViewPanorama.OnStreetViewPanoramaClickListener() { @Override public void onStreetViewPanoramaClick( StreetViewPanoramaOrientation streetViewPanoramaOrientation) { if (!subscriber.isUnsubscribed()) { subscriber.onNext(streetViewPanoramaOrientation); } } }; streetViewPanorama.setOnStreetViewPanoramaClickListener(listener); subscriber.add(new MainThreadSubscription() { @Override protected void onUnsubscribe() { streetViewPanorama.setOnStreetViewPanoramaClickListener(null); } }); }
@Override public void call(final Subscriber<? super StreetViewPanoramaCamera> subscriber) { MainThreadSubscription.verifyMainThread(); StreetViewPanorama.OnStreetViewPanoramaCameraChangeListener listener = new StreetViewPanorama.OnStreetViewPanoramaCameraChangeListener() { @Override public void onStreetViewPanoramaCameraChange( StreetViewPanoramaCamera streetViewPanoramaCamera) { if (!subscriber.isUnsubscribed()) { subscriber.onNext(streetViewPanoramaCamera); } } }; streetViewPanorama.setOnStreetViewPanoramaCameraChangeListener(listener); subscriber.add(new MainThreadSubscription() { @Override protected void onUnsubscribe() { streetViewPanorama.setOnStreetViewPanoramaCameraChangeListener(null); } }); }
@Override public void call(final Subscriber<? super StreetViewPanoramaLocation> subscriber) { MainThreadSubscription.verifyMainThread(); StreetViewPanorama.OnStreetViewPanoramaChangeListener listener = new StreetViewPanorama.OnStreetViewPanoramaChangeListener() { @Override public void onStreetViewPanoramaChange( StreetViewPanoramaLocation streetViewPanoramaLocation) { if (!subscriber.isUnsubscribed()) { subscriber.onNext(streetViewPanoramaLocation); } } }; streetViewPanorama.setOnStreetViewPanoramaChangeListener(listener); subscriber.add(new MainThreadSubscription() { @Override protected void onUnsubscribe() { streetViewPanorama.setOnStreetViewPanoramaChangeListener(null); } }); }
@Override public void onStreetViewPanoramaReady(StreetViewPanorama panorama) { this.panorama = panorama; this.panorama.setPanningGesturesEnabled(allGesturesEnabled); if (coordinate != null) { this.panorama.setPosition(coordinate); } }
private void initMapFragment() { mMapFragment = SupportStreetViewPanoramaFragment.newInstance(); mMapFragment.getStreetViewPanoramaAsync(new OnStreetViewPanoramaReadyCallback() { @Override public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) { setUpStreetViewPanoramaIfNeeded(mDetail.getPosition()); } }); }
@Override public void call(final Subscriber<? super StreetViewPanorama> subscriber) { OnStreetViewPanoramaReadyCallback callback = new OnStreetViewPanoramaReadyCallback() { @Override public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) { if (!subscriber.isUnsubscribed()) { subscriber.onNext(streetViewPanorama); } } }; fragment.getStreetViewPanoramaAsync(callback); }
@Override public void call(final Subscriber<? super StreetViewPanorama> subscriber) { OnStreetViewPanoramaReadyCallback callback = new OnStreetViewPanoramaReadyCallback() { @Override public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) { if (!subscriber.isUnsubscribed()) { subscriber.onNext(streetViewPanorama); } } }; view.getStreetViewPanoramaAsync(callback); }
/** * Create an observable which emits when {@link StreetViewPanorama} is ready to use. * <p> * <em>Warning:</em> The created observable keeps a strong reference to {@code * streetViewPanoramaView}. Unsubscribe to free this reference. * </p> */ @CheckResult @NonNull public static Observable<StreetViewPanorama> streetViewPanoramaReady( @NonNull StreetViewPanoramaView streetViewPanoramaView) { checkNotNull(streetViewPanoramaView, "streetViewPanoramaView == null"); return Observable.create( new StreetViewPanoramaViewPanoramaReadyOnSubscribe(streetViewPanoramaView)); }
/** * Create an observable which emits when {@link StreetViewPanorama} is ready to use. * <p> * <em>Warning:</em> The created observable keeps a strong reference to {@code fragment}. * Unsubscribe to free this reference. * </p> */ @CheckResult @NonNull public static Observable<StreetViewPanorama> streetViewPanoramaReady( @NonNull SupportStreetViewPanoramaFragment fragment) { checkNotNull(fragment, "fragment == null"); return Observable.create( new StreetViewPanoramaSupportFragmentPanoramaReadyOnSubscribe(fragment)); }
@Override public void onStreetViewPanoramaReady(StreetViewPanorama panorama) { mStreetViewPanorama = panorama; mStreetViewPanorama.setOnStreetViewPanoramaChangeListener(this); mStreetViewPanorama.setStreetNamesEnabled(true); // Only need to set the position once as the streetview fragment will maintain // its state. if (mCurrentLocation != null) { mStreetViewPanorama.setPosition(mCurrentLocation); } }
private void initSVFragment(final Bundle savedInstanceState) { mSvpFragment = ((SupportStreetViewPanoramaFragment) getSupportFragmentManager() .findFragmentById(R.id.streetviewpanorama)); mSvpFragment.getStreetViewPanoramaAsync(new OnStreetViewPanoramaReadyCallback() { @Override public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) { setUpStreetViewPanoramaIfNeeded(savedInstanceState, coordenadas); } }); }
@Override public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) { streetViewPanorama.setPosition(SYDNEY); streetViewPanorama.setUserNavigationEnabled(false); }
StreetViewPanoramaLongClickOnSubscribe(StreetViewPanorama streetViewPanorama) { this.streetViewPanorama = streetViewPanorama; }
StreetViewPanoramaClickOnSubscribe(StreetViewPanorama streetViewPanorama) { this.streetViewPanorama = streetViewPanorama; }
StreetViewPanoramaCameraChangeOnSubscribe(StreetViewPanorama streetViewPanorama) { this.streetViewPanorama = streetViewPanorama; }
StreetViewPanoramaChangeOnSubscribe(StreetViewPanorama streetViewPanorama) { this.streetViewPanorama = streetViewPanorama; }
/** * StreetView * * @param savedInstanceState */ private void setUpStreetViewPanoramaIfNeeded(final Bundle savedInstanceState, final LatLng coordenadas) { mSvpFragment.getStreetViewPanoramaAsync(new OnStreetViewPanoramaReadyCallback() { @Override public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) { if (streetViewPanorama != null && savedInstanceState == null) { streetViewPanorama.setPosition(coordenadas); streetViewPanorama.setUserNavigationEnabled(true); streetViewPanorama.setPanningGesturesEnabled(true); streetViewPanorama.setZoomGesturesEnabled(true); Log.d("STREETVIEW", "coordenadas 2: " + coordenadas.latitude + " - " + coordenadas.longitude); } } }); }
/** * Create an observable which emits when {@link StreetViewPanorama} is ready to use. * <p> * <em>Warning:</em> The created observable keeps a strong reference to {@code fragment}. * Unsubscribe to free this reference. * </p> */ @CheckResult @NonNull public static Observable<StreetViewPanorama> streetViewPanoramaReady( @NonNull StreetViewPanoramaFragment fragment) { checkNotNull(fragment, "fragment == null"); return Observable.create(new StreetViewPanoramaFragmentPanoramaReadyOnSubscribe(fragment)); }
/** * Create an observable which emits on {@code streetViewPanorama} camera position change events. * <p> * <em>Warning:</em> The created observable keeps a strong reference to {@code * streetViewPanorama}. Unsubscribe to free this reference. * </p> */ @CheckResult @NonNull public static Observable<StreetViewPanoramaCamera> streetViewPanoramaCameraChanges( @NonNull StreetViewPanorama streetViewPanorama) { checkNotNull(streetViewPanorama, "streetViewPanorama == null"); return Observable.create(new StreetViewPanoramaCameraChangeOnSubscribe(streetViewPanorama)); }
/** * Create an observable which emits on {@code streetViewPanorama} panorama change events. * <p> * <em>Warning:</em> The created observable keeps a strong reference to {@code * streetViewPanorama}. Unsubscribe to free this reference. * </p> */ @CheckResult @NonNull public static Observable<StreetViewPanoramaLocation> streetViewPanoramaChanges( @NonNull StreetViewPanorama streetViewPanorama) { checkNotNull(streetViewPanorama, "streetViewPanorama == null"); return Observable.create(new StreetViewPanoramaChangeOnSubscribe(streetViewPanorama)); }
/** * Create an observable which emits on {@code streetViewPanorama} click events. * <p> * <em>Warning:</em> The created observable keeps a strong reference to {@code * streetViewPanorama}. Unsubscribe to free this reference. * </p> */ @CheckResult @NonNull public static Observable<StreetViewPanoramaOrientation> streetViewPanoramaClicks( StreetViewPanorama streetViewPanorama) { checkNotNull(streetViewPanorama, "streetViewPanorama == null"); return Observable.create(new StreetViewPanoramaClickOnSubscribe(streetViewPanorama)); }
/** * Create an observable which emits on {@code streetViewPanorama} long-click events. * <p> * <em>Warning:</em> The created observable keeps a strong reference to {@code * streetViewPanorama}. Unsubscribe to free this reference. * </p> */ @CheckResult @NonNull public static Observable<StreetViewPanoramaOrientation> streetViewPanoramaLongClicks( @NonNull StreetViewPanorama streetViewPanorama) { checkNotNull(streetViewPanorama, "streetViewPanorama == null"); return Observable.create(new StreetViewPanoramaLongClickOnSubscribe(streetViewPanorama)); }