Java 类com.google.android.gms.maps.SupportStreetViewPanoramaFragment 实例源码

项目:Android-Wear-Projects    文件:StreetView.java   
@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);
                    }
                }
            });
}
项目:android-OurStreets    文件:StreetViewFragment.java   
private void initMapFragment() {
    mMapFragment = SupportStreetViewPanoramaFragment.newInstance();
    mMapFragment.getStreetViewPanoramaAsync(new OnStreetViewPanoramaReadyCallback() {
        @Override
        public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) {
            setUpStreetViewPanoramaIfNeeded(mDetail.getPosition());
        }
    });
}
项目:RxGoogleMapsBinding    文件:RxStreetViewPanorama.java   
/**
 * 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));
}
项目:HereAStory-Android    文件:SplitStreetViewPanoramaAndMapDemoActivity.java   
private void setUpStreetViewPanoramaIfNeeded(Bundle savedInstanceState) {
    if (svp == null) {
        svp = ((SupportStreetViewPanoramaFragment)
            getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama))
                .getStreetViewPanorama();
        if (svp != null) {
            if (savedInstanceState == null) {
                svp.setPosition(SYDNEY);
            }
            svp.setOnStreetViewPanoramaChangeListener(this);
        }
    }
}
项目:HereAStory-Android    文件:StreetViewPanoramaEventsDemoActivity.java   
private void setUpStreetViewPanoramaIfNeeded(Bundle savedInstanceState) {
    if (svp == null) {
        svp = ((SupportStreetViewPanoramaFragment)
            getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama))
                .getStreetViewPanorama();
        if (svp != null) {
            if (savedInstanceState == null) {
                svp.setPosition(SYDNEY);
            }
            svp.setOnStreetViewPanoramaChangeListener(this);
            svp.setOnStreetViewPanoramaCameraChangeListener(this);
            svp.setOnStreetViewPanoramaClickListener(this);
        }
    }
}
项目:HereAStory-Android    文件:StreetViewPanoramaOptionsDemoActivity.java   
private void setUpStreetViewPanoramaIfNeeded(Bundle savedInstanceState) {
    if (svp == null) {
        svp = ((SupportStreetViewPanoramaFragment)
            getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama))
                .getStreetViewPanorama();
        if (svp != null) {
            if (savedInstanceState == null) {
                svp.setPosition(SAN_FRAN);
            }
        }
    }
}
项目:HereAStory-Android    文件:StreetViewPanoramaBasicDemoActivity.java   
private void setUpStreetViewPanoramaIfNeeded(Bundle savedInstanceState) {
    if (svp == null) {
        svp = ((SupportStreetViewPanoramaFragment)
            getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama))
                .getStreetViewPanorama();
        if (svp != null) {
            if (savedInstanceState == null) {
                svp.setPosition(SYDNEY);
            }
        }
    }
}
项目:HereAStory-Android    文件:StreetViewPanoramaNavigationDemoActivity.java   
private void setUpStreetViewPanoramaIfNeeded(Bundle savedInstanceState) {
    if (svp == null) {
        svp = ((SupportStreetViewPanoramaFragment)
            getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama))
                .getStreetViewPanorama();
        if (svp != null) {
            if (savedInstanceState == null) {
                svp.setPosition(SYDNEY);
            }
        }
    }
}
项目:tiempobus    文件:StreetViewActivity.java   
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);
            }
        });

    }
项目:RxGoogleMapsBinding    文件:StreetViewPanoramaSupportFragmentPanoramaReadyOnSubscribe.java   
StreetViewPanoramaSupportFragmentPanoramaReadyOnSubscribe(
    SupportStreetViewPanoramaFragment fragment) {
  this.fragment = fragment;
}
项目:grado_informatica_npi    文件:MapsActivity.java   
@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);

    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
    SupportStreetViewPanoramaFragment streetViewPanoramaFragment =
            (SupportStreetViewPanoramaFragment)
                    getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama);
    streetViewPanoramaFragment.getStreetViewPanoramaAsync(this);

    mAct = this;
    mRequestingLocationUpdates = true;

    final ActionButton ab = (ActionButton) findViewById(R.id.action_button);

    ab.setImageResource(R.drawable.ic_qr);
    ab.setShowAnimation(ActionButton.Animations.JUMP_FROM_DOWN);
    ab.setHideAnimation(ActionButton.Animations.JUMP_TO_DOWN);
    ab.setButtonColor(getResources().getColor(R.color.fab_material_amber_500));
    ab.setButtonColorPressed(getResources().getColor(R.color.fab_material_amber_900));

    ab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            ab.hide();
            new IntentIntegrator(mAct).initiateScan();
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    ab.show();
                }
            }, 1000);
        }
    });

    mLocationReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            mPreviousLocation = mCurrentLocation;
            mCurrentLocation = intent.getParcelableExtra(LocationUpdaterService.COPA_MESSAGE);
            updateMap();
            mLocationsList.add(mCurrentLocation);

            if (BuildConfig.DEBUG) {
                Log.d(TAG, "LocationList size: " + mLocationsList.size());
            }
        }
    };

    mRequestLocationIntent = new Intent(this, LocationUpdaterService.class);
    startService(mRequestLocationIntent);

    // Update values using data stored in the Bundle.
    updateValuesFromBundle(savedInstanceState);
}