Android Open Source - android-async-google-places Photo






From Project

Back to project page android-async-google-places.

License

The source code is released under:

Apache License

If you think the Android project android-async-google-places listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package io.github.axxiss.places.model;
/*from  w w  w  .  j a v  a 2 s . c o  m*/
import android.os.Parcel;
import android.os.Parcelable;

/**
 * The Photo service gives you access to the millions of photos stored in the Places and Google+
 * Local database. When you search for Places using either a Place Search or Place Details request,
 * photo references will be returned for relevant photographic content. The Photo service lets you
 * access the referenced photos, and resize the image to the optimal size for your application.
 *
 * @author Axxiss
 */
public class Photo implements Parcelable {

    private String photo_reference;

    private int width;

    private int height;

    private String[] html_attributions;

    /**
     * A string used to identify the photo when you perform a Photo request.
     *
     * @return
     */
    public String getPhoto_reference() {
        return photo_reference;
    }

    /**
     * The maximum width of the image.
     *
     * @return
     */
    public int getWidth() {
        return width;
    }

    /**
     * The maximum height of the image.
     *
     * @return the height.
     */
    public int getHeight() {
        return height;
    }

    /**
     * Contains any required attributions. This field will always be present, but may be empty.
     *
     * @return
     */
    public String[] getHtml_attributions() {
        return html_attributions;
    }

    protected Photo(Parcel in) {
        photo_reference = in.readString();
        width = in.readInt();
        height = in.readInt();
        html_attributions = new String[in.readInt()];
        in.readStringArray(html_attributions);
    }

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(photo_reference);
        dest.writeInt(width);
        dest.writeInt(height);
        dest.writeInt(html_attributions.length);
        dest.writeStringArray(html_attributions);
    }

    public static final Parcelable.Creator<Photo> CREATOR = new Parcelable.Creator<Photo>() {
        public Photo createFromParcel(Parcel in) {
            return new Photo(in);
        }

        public Photo[] newArray(int size) {
            return new Photo[size];
        }
    };
}




Java Source Code List

io.github.axxis.places.sample.MainActivity.java
io.github.axxis.places.sample.PlaceActivity.java
io.github.axxiss.places.PlacesSettings.java
io.github.axxiss.places.Response.java
io.github.axxiss.places.callback.PhotoCallback.java
io.github.axxiss.places.callback.PlacesCallback.java
io.github.axxiss.places.enums.Params.java
io.github.axxiss.places.enums.PlaceType.java
io.github.axxiss.places.enums.Price.java
io.github.axxiss.places.enums.RankBy.java
io.github.axxiss.places.enums.Request.java
io.github.axxiss.places.enums.Status.java
io.github.axxiss.places.exception.ApiPlacesException.java
io.github.axxiss.places.listeners.OnPlaceClickListener.java
io.github.axxiss.places.model.AddressComponent.java
io.github.axxiss.places.model.AspectRating.java
io.github.axxiss.places.model.Event.java
io.github.axxiss.places.model.Geometry.java
io.github.axxiss.places.model.Location.java
io.github.axxiss.places.model.OpeningHours.java
io.github.axxiss.places.model.PeriodData.java
io.github.axxiss.places.model.Period.java
io.github.axxiss.places.model.Photo.java
io.github.axxiss.places.model.Place.java
io.github.axxiss.places.model.Review.java
io.github.axxiss.places.request.BaseSearch.java
io.github.axxiss.places.request.NearbySearch.java
io.github.axxiss.places.request.PlaceDetails.java
io.github.axxiss.places.request.PlaceParams.java
io.github.axxiss.places.request.PlacePhotos.java
io.github.axxiss.places.request.PlaceSearch.java
io.github.axxiss.places.request.PlacesClient.java
io.github.axxiss.places.request.RadarSearch.java
io.github.axxiss.places.request.TextSearch.java