// Path: PhotoPaper/src/main/java/com/lukekorth/photo_paper/adapters/RecentPhotosAdapter.java
// public class RecentPhotosAdapter extends RecyclerView.Adapter<RecentPhotosAdapter.ViewHolder> {
// 
//     private List<Photos> mPhotos;
//     private Picasso mPicasso;
//     private int mSize;
// 
//     public RecentPhotosAdapter(Context context, Realm realm) {
//         mPhotos = Photos.getRecentlySeenPhotos(realm);
//         mPicasso = PicassoHelper.getPicasso(context);
//         mSize = Utils.dpToPx(context, 100);
//     }
// 
//     @Override
//     public RecentPhotosAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//         PhotoCardBinding binding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()),
//                 R.layout.photo_card, parent, false);
//         return new ViewHolder(binding);
//     }
// 
//     @Override
//     public void onBindViewHolder(ViewHolder holder, int position) {
//         final Photos photo = mPhotos.get(position);
//         holder.mBinding.setPhoto(photo);
//         mPicasso.load(photo.imageUrl)
//                 .resize(mSize, mSize)
//                 .centerCrop()
//                 .placeholder(new ColorDrawable(photo.getPalette()))
//                 .into(holder.mBinding.thumbnail);
//     }
// 
//     @Override
//     public int getItemCount() {
//         return mPhotos.size();
//     }
// 
//     static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
// 
//         private PhotoCardBinding mBinding;
// 
//         ViewHolder(PhotoCardBinding binding) {
//             super(binding.getRoot());
//             mBinding = binding;
//             itemView.setOnClickListener(this);
//         }
// 
//         @Override
//         public void onClick(View v) {
//             Intent intent = new Intent(v.getContext(), ViewPhotoActivity.class)
//                     .putExtra(ViewPhotoActivity.PHOTO_POSITION_KEY, getPosition());
//             v.getContext().startActivity(intent);
//         }
//     }
// }
// 
// Path: PhotoPaper/src/main/java/com/lukekorth/photo_paper/models/WallpaperChangedEvent.java
// public class WallpaperChangedEvent {
// }


import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.MenuItem;
import com.lukekorth.photo_paper.adapters.RecentPhotosAdapter;
import com.lukekorth.photo_paper.models.WallpaperChangedEvent;
import com.squareup.otto.Subscribe;
import io.realm.Realm;
package com.lukekorth.photo_paper;




public class RecentPhotosActivity extends AppCompatActivity {

    private Realm mRealm;
    private RecyclerView mRecyclerView;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.recent_photos);

        mRealm = Realm.getDefaultInstance();

        mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view);
        mRecyclerView.setHasFixedSize(true);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
// Path: PhotoPaper/src/main/java/com/lukekorth/photo_paper/adapters/RecentPhotosAdapter.java
// public class RecentPhotosAdapter extends RecyclerView.Adapter<RecentPhotosAdapter.ViewHolder> {
// 
//     private List<Photos> mPhotos;
//     private Picasso mPicasso;
//     private int mSize;
// 
//     public RecentPhotosAdapter(Context context, Realm realm) {
//         mPhotos = Photos.getRecentlySeenPhotos(realm);
//         mPicasso = PicassoHelper.getPicasso(context);
//         mSize = Utils.dpToPx(context, 100);
//     }
// 
//     @Override
//     public RecentPhotosAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//         PhotoCardBinding binding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()),
//                 R.layout.photo_card, parent, false);
//         return new ViewHolder(binding);
//     }
// 
//     @Override
//     public void onBindViewHolder(ViewHolder holder, int position) {
//         final Photos photo = mPhotos.get(position);
//         holder.mBinding.setPhoto(photo);
//         mPicasso.load(photo.imageUrl)
//                 .resize(mSize, mSize)
//                 .centerCrop()
//                 .placeholder(new ColorDrawable(photo.getPalette()))
//                 .into(holder.mBinding.thumbnail);
//     }
// 
//     @Override
//     public int getItemCount() {
//         return mPhotos.size();
//     }
// 
//     static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
// 
//         private PhotoCardBinding mBinding;
// 
//         ViewHolder(PhotoCardBinding binding) {
//             super(binding.getRoot());
//             mBinding = binding;
//             itemView.setOnClickListener(this);
//         }
// 
//         @Override
//         public void onClick(View v) {
//             Intent intent = new Intent(v.getContext(), ViewPhotoActivity.class)
//                     .putExtra(ViewPhotoActivity.PHOTO_POSITION_KEY, getPosition());
//             v.getContext().startActivity(intent);
//         }
//     }
// }
// 
// Path: PhotoPaper/src/main/java/com/lukekorth/photo_paper/models/WallpaperChangedEvent.java
// public class WallpaperChangedEvent {
// }


// Path: PhotoPaper/src/main/java/com/lukekorth/photo_paper/RecentPhotosActivity.java
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.MenuItem;
import com.lukekorth.photo_paper.adapters.RecentPhotosAdapter;
import com.lukekorth.photo_paper.models.WallpaperChangedEvent;
import com.squareup.otto.Subscribe;
import io.realm.Realm;

package com.lukekorth.photo_paper;




public class RecentPhotosActivity extends AppCompatActivity {

    private Realm mRealm;
    private RecyclerView mRecyclerView;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.recent_photos);

        mRealm = Realm.getDefaultInstance();

        mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view);
        mRecyclerView.setHasFixedSize(true);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
        mRecyclerView.setAdapter(new RecentPhotosAdapter(this, mRealm));