Android Open Source - kluster-android Photo






From Project

Back to project page kluster-android.

License

The source code is released under:

Apache License

If you think the Android project kluster-android 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 com.cs446.kluster.models;
/*w  w w . ja  v  a2s . com*/
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;

import android.os.Parcel;
import android.os.Parcelable;

import com.cs446.kluster.map.MapUtils;
import com.google.android.gms.maps.model.LatLng;

public class Photo implements Parcelable  {
  private String mPhotoId;
  private String mUserId;
  private String mEventId;
  private LatLng mLocation;
  private Date mDate;
  private String[] mUrl;
  private List<String> mTags;
  private String[] mRating;
  
  public Photo(String pid,
      String uid,
      String eid,
      LatLng loc,
      Date date,
      String[] url,
      List<String> tags,
      String[] rating) {
    
    mPhotoId = pid;
    mUserId = uid;
    mEventId = eid;
    mLocation = loc;
    mDate = date;
    mUrl = url;
    mTags = tags;
    mRating = rating;

  }

  public String getPhotoId() {
    return mPhotoId;
  }

  public LatLng getLocation() {
    return mLocation;
  }
  
  public String getEventId() {
    return mEventId;
  }

  public Date getDate() {
    return mDate;
  }

  public String getUserId() {
    return mUserId;
  }
  
  public String[] getAllUrls() {
    return mUrl;
  }
  
  public String getUrl() {
    return mUrl[0];
  }
  
  public String getSmallUrl() {
    return mUrl[1];
  }
  
  public String getMediumUrl() {
    return mUrl[2];
  }
  
  public String getThumbUrl() {
    return mUrl[3];
  }

  public List<String> getTags() {
    return mTags;
  }
  
  public String getRatingsDown() {
    return mRating[0];
  }
  
  public String getRatingsUp() {
    return mRating[1];
  }
  
  public String[] getRatings() {
    return mRating;
  }
    
  public String getTag(String val) {
    return mTags.get(mTags.indexOf(val));
  }
  
  public static SimpleDateFormat getDateFormat() {
    return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US);
  }
  
  public Photo(Parcel in) {

    mPhotoId = in.readString();
    mUserId = in.readString();
    mEventId = in.readString();
    mLocation = MapUtils.stringToLatLng(in.readString());
    try {
      mDate = getDateFormat().parse(in.readString());
    } catch (ParseException e) {
    }
    mUrl = in.createStringArray();
    mTags = in.createStringArrayList();
  }
  

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

  @Override
  public void writeToParcel(Parcel parcel, int flags) {
    parcel.writeString(mPhotoId.toString());
    parcel.writeString(mUserId.toString());
    parcel.writeString(mEventId.toString());
    parcel.writeString(MapUtils.latLngToString(mLocation));
    parcel.writeString(getDateFormat().format(mDate));
    parcel.writeStringArray(mUrl);
    parcel.writeStringList(mTags);
  }
  
  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

android.app.GridFragment.java
android.app.NonSwipeableViewPager.java
android.app.ScaleImageView.java
com.cs446.kluster.ConfigManager.java
com.cs446.kluster.KlusterApplication.java
com.cs446.kluster.cache.CacheUtils.java
com.cs446.kluster.cache.DiskLruCache.java
com.cs446.kluster.cache.DiskLruImageCache.java
com.cs446.kluster.cache.KlusterCache.java
com.cs446.kluster.data.AbstractContentStorageAdapter.java
com.cs446.kluster.data.EventProvider.java
com.cs446.kluster.data.EventStorageAdapter.java
com.cs446.kluster.data.PhotoProvider.java
com.cs446.kluster.data.PhotoStorageAdapter.java
com.cs446.kluster.data.SearchProvider.java
com.cs446.kluster.data.SearchStorageAdapter.java
com.cs446.kluster.data.StorageAdapter.java
com.cs446.kluster.data.StorageConstants.java
com.cs446.kluster.data.serialize.AuthUserAdapter.java
com.cs446.kluster.data.serialize.EventAdapter.java
com.cs446.kluster.data.serialize.PhotoAdapter.java
com.cs446.kluster.data.serialize.SerializerUtils.java
com.cs446.kluster.data.serialize.UserAdapter.java
com.cs446.kluster.map.MapUtils.java
com.cs446.kluster.models.AuthUser.java
com.cs446.kluster.models.Event.java
com.cs446.kluster.models.Photo.java
com.cs446.kluster.models.User.java
com.cs446.kluster.net.AuthInterceptor.java
com.cs446.kluster.net.AuthKlusterRestAdapter.java
com.cs446.kluster.net.EventsCallback.java
com.cs446.kluster.net.KlusterRestAdapter.java
com.cs446.kluster.net.KlusterService.java
com.cs446.kluster.net.NetworkUtils.java
com.cs446.kluster.net.PhotosCallback.java
com.cs446.kluster.net.UploadService.java
com.cs446.kluster.views.activities.LoginActivity.java
com.cs446.kluster.views.activities.MainActivity.java
com.cs446.kluster.views.activities.PhotoFactory.java
com.cs446.kluster.views.activities.PhotoGridActivity.java
com.cs446.kluster.views.fragments.DiscoverFragment.java
com.cs446.kluster.views.fragments.EventDialogFragment.java
com.cs446.kluster.views.fragments.EventGridAdapter.java
com.cs446.kluster.views.fragments.EventGridFragment.java
com.cs446.kluster.views.fragments.EventMapFragment.java
com.cs446.kluster.views.fragments.FilterDialogFragment.java
com.cs446.kluster.views.fragments.PhotoGridAdapter.java
com.cs446.kluster.views.fragments.PhotoGridFragment.java
com.cs446.kluster.views.fragments.PhotoViewerFragment.java
com.cs446.kluster.views.fragments.SearchFragment.java
com.cs446.kluster.views.fragments.SearchGridFragment.java
com.cs446.kluster.views.fragments.SearchMapFragment.java
com.cs446.kluster.views.fragments.SignupFragment.java
com.cs446.kluster.views.fragments.UserProfileFragment.java
com.cs446.kluster.views.map.PhotoInfoWindowAdapter.java