// Path: app/src/com/lesgens/blindr/ImageViewerActivity.java
// public class ImageViewerActivity extends Activity implements OnClickListener{
// 
// 	public static void show(Context context, Bitmap bitmap) {
// 		Intent i = new Intent(context, ImageViewerActivity.class);
// 		FileOutputStream out = null;
// 		try {
// 			File file = new File(Environment.getExternalStorageDirectory(),  "Pic.jpg");
// 			out = new FileOutputStream(file);
// 			bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
// 			i.putExtra("photoUri", Uri.fromFile(file));
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		} finally {
// 			try {
// 				if (out != null) {
// 					out.close();
// 				}
// 			} catch (IOException e) {
// 				e.printStackTrace();
// 			}
// 		}
// 		context.startActivity(i);
// 	}
// 
// 	@Override
// 	protected void onCreate(Bundle savedInstanceState) {
// 		super.onCreate(savedInstanceState);
// 
// 		//Remove title bar
// 		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
// 
// 		setContentView(R.layout.image_viewer);
// 
// 		Uri photoUri = getIntent().getParcelableExtra("photoUri");
// 
// 
// 		if(photoUri == null){
// 			finish();
// 		}
// 
// 		
// 		try{
// 			Bitmap bitmap = android.provider.MediaStore.Images.Media
// 					.getBitmap(getContentResolver(), photoUri);
// 			ImageView imageView = (ImageView) findViewById(R.id.image);
// 			imageView.setImageBitmap(bitmap);
// 		} catch(Exception e){
// 			e.printStackTrace();
// 			finish();
// 		}
// 
// 		findViewById(R.id.container).setOnClickListener(this);
// 	}
// 
// 	@Override
// 	public void onClick(View v) {
// 		if(v.getId() == R.id.container){
// 			finish();
// 		}
// 	}
// 
// 
// }


import java.util.ArrayList;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.lesgens.blindr.ImageViewerActivity;
import com.lesgens.blindr.R;
		mPicturesContainer = (LinearLayout) view.findViewById(R.id.pictures_container);
		mDotsContainer = (LinearLayout) view.findViewById(R.id.dots_container);
		mDotsContainer.setPadding(0, -mDotsSize*2, 0, 0);

		mImages = new ArrayList<Bitmap>();
		mSelectedItem = -1;
	}

	private void initAttrs(AttributeSet attrs){
		TypedArray a = getContext().getTheme().obtainStyledAttributes(
				attrs,
				R.styleable.SlideshowView,
				0, 0);

		try {
			mSelectedColor = a.getColor(R.styleable.SlideshowView_selectedColor, Color.BLACK);
			mUnselectedColor = a.getColor(R.styleable.SlideshowView_unselectedColor, Color.WHITE);
			mCurrentColor = a.getColor(R.styleable.SlideshowView_currentColor, Color.GRAY);
			mPicturesWidth = a.getDimensionPixelSize(R.styleable.SlideshowView_picturesWidth, LayoutParams.WRAP_CONTENT);
			mPicturesHeight= a.getDimensionPixelSize(R.styleable.SlideshowView_picturesHeight, LayoutParams.WRAP_CONTENT);
			mDotsSize = a.getDimensionPixelSize(R.styleable.SlideshowView_dotsSize, 72);
		} finally {
			a.recycle();
		}
	}

	@Override
	public void onClick(View v) {
		if(v instanceof ImageView){
			select((Integer) v.getTag());
// Path: app/src/com/lesgens/blindr/ImageViewerActivity.java
// public class ImageViewerActivity extends Activity implements OnClickListener{
// 
// 	public static void show(Context context, Bitmap bitmap) {
// 		Intent i = new Intent(context, ImageViewerActivity.class);
// 		FileOutputStream out = null;
// 		try {
// 			File file = new File(Environment.getExternalStorageDirectory(),  "Pic.jpg");
// 			out = new FileOutputStream(file);
// 			bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
// 			i.putExtra("photoUri", Uri.fromFile(file));
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		} finally {
// 			try {
// 				if (out != null) {
// 					out.close();
// 				}
// 			} catch (IOException e) {
// 				e.printStackTrace();
// 			}
// 		}
// 		context.startActivity(i);
// 	}
// 
// 	@Override
// 	protected void onCreate(Bundle savedInstanceState) {
// 		super.onCreate(savedInstanceState);
// 
// 		//Remove title bar
// 		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
// 
// 		setContentView(R.layout.image_viewer);
// 
// 		Uri photoUri = getIntent().getParcelableExtra("photoUri");
// 
// 
// 		if(photoUri == null){
// 			finish();
// 		}
// 
// 		
// 		try{
// 			Bitmap bitmap = android.provider.MediaStore.Images.Media
// 					.getBitmap(getContentResolver(), photoUri);
// 			ImageView imageView = (ImageView) findViewById(R.id.image);
// 			imageView.setImageBitmap(bitmap);
// 		} catch(Exception e){
// 			e.printStackTrace();
// 			finish();
// 		}
// 
// 		findViewById(R.id.container).setOnClickListener(this);
// 	}
// 
// 	@Override
// 	public void onClick(View v) {
// 		if(v.getId() == R.id.container){
// 			finish();
// 		}
// 	}
// 
// 
// }


// Path: app/src/com/lesgens/blindr/views/SlideshowView.java
import java.util.ArrayList;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.lesgens.blindr.ImageViewerActivity;
import com.lesgens.blindr.R;

		mPicturesContainer = (LinearLayout) view.findViewById(R.id.pictures_container);
		mDotsContainer = (LinearLayout) view.findViewById(R.id.dots_container);
		mDotsContainer.setPadding(0, -mDotsSize*2, 0, 0);

		mImages = new ArrayList<Bitmap>();
		mSelectedItem = -1;
	}

	private void initAttrs(AttributeSet attrs){
		TypedArray a = getContext().getTheme().obtainStyledAttributes(
				attrs,
				R.styleable.SlideshowView,
				0, 0);

		try {
			mSelectedColor = a.getColor(R.styleable.SlideshowView_selectedColor, Color.BLACK);
			mUnselectedColor = a.getColor(R.styleable.SlideshowView_unselectedColor, Color.WHITE);
			mCurrentColor = a.getColor(R.styleable.SlideshowView_currentColor, Color.GRAY);
			mPicturesWidth = a.getDimensionPixelSize(R.styleable.SlideshowView_picturesWidth, LayoutParams.WRAP_CONTENT);
			mPicturesHeight= a.getDimensionPixelSize(R.styleable.SlideshowView_picturesHeight, LayoutParams.WRAP_CONTENT);
			mDotsSize = a.getDimensionPixelSize(R.styleable.SlideshowView_dotsSize, 72);
		} finally {
			a.recycle();
		}
	}

	@Override
	public void onClick(View v) {
		if(v instanceof ImageView){
			select((Integer) v.getTag());
			ImageViewerActivity.show(getContext(), getSelectedImage());