// Path: 微信/src/net/cgt/weixin/domain/User.java
// public class User implements Parcelable {
// 	private String userPhote;
// 	private String userAccount;
// 	private String personalizedSignature;
// 	private String date;
// 	private Drawable userImage;
// 
// 	public String getUserPhote() {
// 		return userPhote;
// 	}
// 
// 	public void setUserPhote(String userPhote) {
// 		this.userPhote = userPhote;
// 	}
// 
// 	public String getUserAccount() {
// 		return userAccount;
// 	}
// 
// 	public void setUserAccount(String userAccount) {
// 		this.userAccount = userAccount;
// 	}
// 
// 	public String getPersonalizedSignature() {
// 		return personalizedSignature;
// 	}
// 
// 	public void setPersonalizedSignature(String personalizedSignature) {
// 		this.personalizedSignature = personalizedSignature;
// 	}
// 
// 	public String getDate() {
// 		return date;
// 	}
// 
// 	public void setDate(String date) {
// 		this.date = date;
// 	}
// 
// 	public Drawable getUserImage() {
// 		return userImage;
// 	}
// 
// 	public void setUserImage(Drawable userImage) {
// 		this.userImage = userImage;
// 	}
// 
// 	@Override
// 	public int describeContents() {
// 		return 0;
// 	}
// 
// 	@Override
// 	public void writeToParcel(Parcel dest, int flags) {
// 		dest.writeString(userPhote);
// 		dest.writeString(userAccount);
// 		dest.writeString(date);
// 		dest.writeString(personalizedSignature);
// 		dest.writeValue(userImage);
// 	}
// 
// 	public static final Parcelable.Creator<User> CREATOR = new Parcelable.Creator<User>() {
// 		/**
// 		 * Return a new point from the data in the specified parcel.
// 		 */
// 		public User createFromParcel(Parcel in) {
// 			User u = new User();
// 			u.readFromParcel(in);
// 			return u;
// 		}
// 
// 		/**
// 		 * Return an array of rectangles of the specified size.
// 		 */
// 		public User[] newArray(int size) {
// 			return new User[size];
// 		}
// 	};
// 
// 	/**
// 	 * Set the point's coordinates from the data stored in the specified parcel.
// 	 * To write a point to a parcel, call writeToParcel().
// 	 * 
// 	 * @param in The parcel to read the point's coordinates from
// 	 */
// 	public void readFromParcel(Parcel in) {
// 		userPhote = in.readString();
// 		userAccount = in.readString();
// 		date = in.readString();
// 		personalizedSignature = in.readString();
// 		ClassLoader Drawable = ClassLoader.getSystemClassLoader();
// 		userImage = (android.graphics.drawable.Drawable) in.readValue(Drawable);
// 	}
// }


import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import net.cgt.weixin.R;
import net.cgt.weixin.domain.User;
import ru.truba.touchgallery.GalleryWidget.BasePagerAdapter.OnItemChangeListener;
import ru.truba.touchgallery.GalleryWidget.FilePagerAdapter;
import ru.truba.touchgallery.GalleryWidget.GalleryViewPager;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;
package net.cgt.weixin.activity;



/**
 * 图片查看器
 * 
 * @author lijian
 * @date 2014-11-30
 */
public class GalleryImageActivity extends Activity {

	private GalleryViewPager mViewPager;
	private User user;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.cgt_activity_galleryimage);
		Intent intent = getIntent();
		user = intent.getParcelableExtra("user");
		init();
	}

	private void init() {
		initView();
		initData();
	}

	private void initView() {
		// TODO Auto-generated method stub

	}

	private void initData() {
//		String[] urls = null;
		List<String> items = new ArrayList<String>();
//		try {
//			urls = getAssets().list("");
//
//			for (String filename : urls) {
//				if (filename.matches(".+\\.jpg")) {
//					String path = getFilesDir() + "/" + filename;
//					copy(getAssets().open(filename), new File(path));
//					items.add(path);
//				}
//			}
//		} catch (IOException e) {
//			e.printStackTrace();
//		}

		items.add(user.getUserPhote());

		FilePagerAdapter pagerAdapter = new FilePagerAdapter(this, items);
		pagerAdapter.setOnItemChangeListener(new OnItemChangeListener() {
			@Override
			public void onItemChange(int currentPosition) {
				Toast.makeText(GalleryImageActivity.this, "Current item is " + currentPosition, Toast.LENGTH_SHORT).show();
			}
// Path: 微信/src/net/cgt/weixin/domain/User.java
// public class User implements Parcelable {
// 	private String userPhote;
// 	private String userAccount;
// 	private String personalizedSignature;
// 	private String date;
// 	private Drawable userImage;
// 
// 	public String getUserPhote() {
// 		return userPhote;
// 	}
// 
// 	public void setUserPhote(String userPhote) {
// 		this.userPhote = userPhote;
// 	}
// 
// 	public String getUserAccount() {
// 		return userAccount;
// 	}
// 
// 	public void setUserAccount(String userAccount) {
// 		this.userAccount = userAccount;
// 	}
// 
// 	public String getPersonalizedSignature() {
// 		return personalizedSignature;
// 	}
// 
// 	public void setPersonalizedSignature(String personalizedSignature) {
// 		this.personalizedSignature = personalizedSignature;
// 	}
// 
// 	public String getDate() {
// 		return date;
// 	}
// 
// 	public void setDate(String date) {
// 		this.date = date;
// 	}
// 
// 	public Drawable getUserImage() {
// 		return userImage;
// 	}
// 
// 	public void setUserImage(Drawable userImage) {
// 		this.userImage = userImage;
// 	}
// 
// 	@Override
// 	public int describeContents() {
// 		return 0;
// 	}
// 
// 	@Override
// 	public void writeToParcel(Parcel dest, int flags) {
// 		dest.writeString(userPhote);
// 		dest.writeString(userAccount);
// 		dest.writeString(date);
// 		dest.writeString(personalizedSignature);
// 		dest.writeValue(userImage);
// 	}
// 
// 	public static final Parcelable.Creator<User> CREATOR = new Parcelable.Creator<User>() {
// 		/**
// 		 * Return a new point from the data in the specified parcel.
// 		 */
// 		public User createFromParcel(Parcel in) {
// 			User u = new User();
// 			u.readFromParcel(in);
// 			return u;
// 		}
// 
// 		/**
// 		 * Return an array of rectangles of the specified size.
// 		 */
// 		public User[] newArray(int size) {
// 			return new User[size];
// 		}
// 	};
// 
// 	/**
// 	 * Set the point's coordinates from the data stored in the specified parcel.
// 	 * To write a point to a parcel, call writeToParcel().
// 	 * 
// 	 * @param in The parcel to read the point's coordinates from
// 	 */
// 	public void readFromParcel(Parcel in) {
// 		userPhote = in.readString();
// 		userAccount = in.readString();
// 		date = in.readString();
// 		personalizedSignature = in.readString();
// 		ClassLoader Drawable = ClassLoader.getSystemClassLoader();
// 		userImage = (android.graphics.drawable.Drawable) in.readValue(Drawable);
// 	}
// }


// Path: 微信/src/net/cgt/weixin/activity/GalleryImageActivity.java
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import net.cgt.weixin.R;
import net.cgt.weixin.domain.User;
import ru.truba.touchgallery.GalleryWidget.BasePagerAdapter.OnItemChangeListener;
import ru.truba.touchgallery.GalleryWidget.FilePagerAdapter;
import ru.truba.touchgallery.GalleryWidget.GalleryViewPager;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;

package net.cgt.weixin.activity;



/**
 * 图片查看器
 * 
 * @author lijian
 * @date 2014-11-30
 */
public class GalleryImageActivity extends Activity {

	private GalleryViewPager mViewPager;
	private User user;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.cgt_activity_galleryimage);
		Intent intent = getIntent();
		user = intent.getParcelableExtra("user");
		init();
	}

	private void init() {
		initView();
		initData();
	}

	private void initView() {
		// TODO Auto-generated method stub

	}

	private void initData() {
//		String[] urls = null;
		List<String> items = new ArrayList<String>();
//		try {
//			urls = getAssets().list("");
//
//			for (String filename : urls) {
//				if (filename.matches(".+\\.jpg")) {
//					String path = getFilesDir() + "/" + filename;
//					copy(getAssets().open(filename), new File(path));
//					items.add(path);
//				}
//			}
//		} catch (IOException e) {
//			e.printStackTrace();
//		}

		items.add(user.getUserPhote());

		FilePagerAdapter pagerAdapter = new FilePagerAdapter(this, items);
		pagerAdapter.setOnItemChangeListener(new OnItemChangeListener() {
			@Override
			public void onItemChange(int currentPosition) {
				Toast.makeText(GalleryImageActivity.this, "Current item is " + currentPosition, Toast.LENGTH_SHORT).show();
			}
		});