Android Open Source - AndroidPlaces Place Detail






From Project

Back to project page AndroidPlaces.

License

The source code is released under:

Apache License

If you think the Android project AndroidPlaces 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

/*
 * Copyright (C) 2014 Brian Lee//from  w  w  w  .j  a v  a 2s. c o  m
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.tigerpenguin.places.model;

import android.os.Parcel;
import android.os.Parcelable;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

public class PlaceDetail extends JsonModel implements Parcelable {

    @JsonProperty(ADDRESS_COMPONENTS)
    private List<AddressComponent> addressComponents;

    @JsonProperty(FORMATTED_ADDRESS)
    private String formattedAddress;

    @JsonProperty(FORMATTED_PHONE_NUMBER)
    private String localPhone;

    @JsonProperty(GEOMETRY)
    private Geometry geometry;

    @JsonProperty(ICON)
    private String iconUrl;

    @JsonProperty(PLACE_ID)
    private String placeId;

    @JsonProperty(INTERNATIONAL_PHONE_NUMBER)
    private String internationalPhone;

    @JsonProperty(NAME)
    private String name;

    @JsonProperty(OPENING_HOURS)
    private OpeningHours openingHours;

    @JsonProperty(PHOTOS)
    private List<Photo> photos;

    @JsonProperty(PRICE_LEVEL)
    private PriceLevel priceLevel;

    @JsonProperty(RATING)
    private double rating;

    @JsonProperty(REVIEWS)
    private List<Review> reviews;

    @JsonProperty(TYPES)
    private List<PlaceType> types;

    @JsonProperty(URL)
    private String googlePlacePageUrl;

    @JsonProperty(UTC_OFFSET)
    private int utcOffset;

    @JsonProperty(VICINITY)
    private String vicinity;

    @JsonProperty(WEBSITE)
    private String businessWebsite;

    public PlaceDetail() {
        // required for Jackson
    }

    @SuppressWarnings("unchecked")
    public PlaceDetail(Parcel in) {
        addressComponents = in.readArrayList(AddressComponent.class.getClassLoader());
        formattedAddress = in.readString();
        localPhone = in.readString();
        geometry = in.readParcelable(Geometry.class.getClassLoader());
        iconUrl = in.readString();
        placeId = in.readString();
        internationalPhone = in.readString();
        name = in.readString();
        openingHours = in.readParcelable(OpeningHours.class.getClassLoader());
        photos = in.readArrayList(Photo.class.getClassLoader());
        priceLevel = (PriceLevel) in.readSerializable();
        rating = in.readDouble();
        reviews = in.readArrayList(Review.class.getClassLoader());
        types = in.readArrayList(PlaceType.class.getClassLoader());
        googlePlacePageUrl = in.readString();
        utcOffset = in.readInt();
        vicinity = in.readString();
        businessWebsite = in.readString();
    }

    public List<AddressComponent> getAddressComponents() {
        return addressComponents;
    }

    public String getFormattedAddress() {
        return formattedAddress;
    }

    public String getLocalPhone() {
        return localPhone;
    }

    public Geometry getGeometry() {
        return geometry;
    }

    public String getIconUrl() {
        return iconUrl;
    }

    public String getPlaceId() {
        return placeId;
    }

    public String getInternationalPhone() {
        return internationalPhone;
    }

    public String getName() {
        return name;
    }

    public List<Photo> getPhotos() {
        return photos;
    }

    public boolean hasPhotos() {
        return photos != null && photos.size() > 0;
    }

    public PriceLevel getPriceLevel() {
        return priceLevel;
    }

    public double getRating() {
        return rating;
    }

    public List<Review> getReviews() {
        return reviews;
    }

    public List<PlaceType> getTypes() {
        return types;
    }

    public String getGooglePlacePageUrl() {
        return googlePlacePageUrl;
    }

    public int getUtcOffset() {
        return utcOffset;
    }

    public String getVicinity() {
        return vicinity;
    }

    public String getBusinessWebsite() {
        return businessWebsite;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeList(addressComponents);
        dest.writeString(formattedAddress);
        dest.writeString(localPhone);
        dest.writeParcelable(geometry, flags);
        dest.writeString(iconUrl);
        dest.writeString(placeId);
        dest.writeString(internationalPhone);
        dest.writeString(name);
        dest.writeParcelable(openingHours, flags);
        dest.writeList(photos);
        dest.writeSerializable(priceLevel);
        dest.writeDouble(rating);
        dest.writeList(reviews);
        dest.writeList(types);
        dest.writeString(googlePlacePageUrl);
        dest.writeInt(utcOffset);
        dest.writeString(vicinity);
        dest.writeString(businessWebsite);
    }

    public static final Creator<PlaceDetail> CREATOR = new Creator<PlaceDetail>() {
        @Override
        public PlaceDetail createFromParcel(Parcel source) {
            return new PlaceDetail(source);
        }

        @Override
        public PlaceDetail[] newArray(int size) {
            return new PlaceDetail[size];
        }
    };
}




Java Source Code List

com.tigerpenguin.demo.places.PlaceDetailActivity.java
com.tigerpenguin.demo.places.PlaceResultAdapter.java
com.tigerpenguin.demo.places.PlaceResultsFragment.java
com.tigerpenguin.demo.places.PlaceReviewAdapter.java
com.tigerpenguin.demo.places.PlaceReviewsFragment.java
com.tigerpenguin.demo.places.PlaceThumbnailAdapter.java
com.tigerpenguin.demo.places.PlaceThumbnailsFragment.java
com.tigerpenguin.demo.places.PlacesDemo.java
com.tigerpenguin.places.PlacesTest.java
com.tigerpenguin.places.deserializer.HtmlStringDeserializer.java
com.tigerpenguin.places.deserializer.PlaceTypeDeserializer.java
com.tigerpenguin.places.model.AddressComponent.java
com.tigerpenguin.places.model.AspectRating.java
com.tigerpenguin.places.model.AspectType.java
com.tigerpenguin.places.model.DayOfWeek.java
com.tigerpenguin.places.model.DayTime.java
com.tigerpenguin.places.model.Geometry.java
com.tigerpenguin.places.model.JsonModel.java
com.tigerpenguin.places.model.Language.java
com.tigerpenguin.places.model.OpeningHours.java
com.tigerpenguin.places.model.Period.java
com.tigerpenguin.places.model.Photo.java
com.tigerpenguin.places.model.PlaceDetail.java
com.tigerpenguin.places.model.PlaceLocation.java
com.tigerpenguin.places.model.PlaceType.java
com.tigerpenguin.places.model.Place.java
com.tigerpenguin.places.model.PriceLevel.java
com.tigerpenguin.places.model.RankBy.java
com.tigerpenguin.places.model.Review.java
com.tigerpenguin.places.model.StatusCode.java
com.tigerpenguin.places.request.InvalidRequestException.java
com.tigerpenguin.places.request.NearbySearchRequestTest.java
com.tigerpenguin.places.request.NearbySearchRequest.java
com.tigerpenguin.places.request.PlaceDetailRequestTest.java
com.tigerpenguin.places.request.PlaceDetailRequest.java
com.tigerpenguin.places.request.PlaceSearchRequestTest.java
com.tigerpenguin.places.request.PlaceSearchRequest.java
com.tigerpenguin.places.request.PlacesRequestTest.java
com.tigerpenguin.places.request.PlacesRequest.java
com.tigerpenguin.places.request.RequestTest.java
com.tigerpenguin.places.response.NearbySearchResponseFactory.java
com.tigerpenguin.places.response.NearbySearchResponse.java
com.tigerpenguin.places.response.PlaceDetailResponseFactory.java
com.tigerpenguin.places.response.PlaceDetailResponse.java
com.tigerpenguin.places.response.PlaceSearchResponse.java
com.tigerpenguin.places.response.PlacesResponseFactory.java
com.tigerpenguin.places.response.PlacesResponse.java
com.tigerpenguin.places.responsehandler.NearbySearchHandlerFragment.java
com.tigerpenguin.places.responsehandler.PlaceDetailResponseHandlerFragment.java
com.tigerpenguin.places.responsehandler.PlacesResponseHandler.java
com.tigerpenguin.widget.simpleratingbar.MockAttributes.java
com.tigerpenguin.widget.simpleratingbar.SimpleRatingBarAttributes.java
com.tigerpenguin.widget.simpleratingbar.SimpleRatingBarTest.java
com.tigerpenguin.widget.simpleratingbar.SimpleRatingBar.java