// Path: app/src/main/java/com/createchance/doorgod/adapter/IntrusionRecordDetailsAdapter.java
// public class IntrusionRecordDetailsAdapter extends RecyclerView.Adapter<IntrusionRecordDetailsAdapter.ViewHolder> {
// 
//     private static final String TAG = "IntrusionRecordAdapter";
// 
//     private List<File> mPictureList;
// 
//     private Context mContext;
// 
//     static class ViewHolder extends RecyclerView.ViewHolder {
//         TextView title;
//         ImageView content;
// 
//         public ViewHolder(View view) {
//             super(view);
// 
//             title = (TextView) view.findViewById(R.id.intru_details_title);
//             content = (ImageView) view.findViewById(R.id.intru_details_content);
//         }
//     }
// 
//     public IntrusionRecordDetailsAdapter(File folder) {
//         mPictureList = new ArrayList<>(Arrays.asList(folder.listFiles()));
//     }
// 
//     @Override
//     public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//         if (mContext == null) {
//             mContext = parent.getContext();
//         }
// 
//         View view = LayoutInflater.from(mContext).inflate(R.layout.intru_details_item, parent, false);
//         final IntrusionRecordDetailsAdapter.ViewHolder holder = new IntrusionRecordDetailsAdapter.ViewHolder(view);
// 
//         return holder;
//     }
// 
//     @Override
//     public void onBindViewHolder(IntrusionRecordDetailsAdapter.ViewHolder holder, final int position) {
//         LogUtil.d(TAG, mPictureList.get(position).getAbsolutePath());
//         String time = getDateFromMills(mPictureList.get(position).getName().split("_")[0]);
//         String appName = mPictureList.get(position).getName().split("_")[1].substring(0, mPictureList.get(position).getName().split("_")[1].lastIndexOf("."));
//         holder.title.setText(mContext.getString(R.string.settings_intru_rec_detail_item_title, time, appName));
//         Glide.with(mContext).load(mPictureList.get(position).getAbsoluteFile()).into(holder.content);
//         holder.content.setOnLongClickListener(new View.OnLongClickListener() {
//             @Override
//             public boolean onLongClick(View view) {
//                 showConfigChangedDialog(mPictureList.get(position));
//                 return true;
//             }
//         });
//     }
// 
//     @Override
//     public int getItemCount() {
//         return mPictureList.size();
//     }
// 
//     private void showConfigChangedDialog(final File picture) {
//         AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
//         builder.setIcon(R.drawable.ic_warning_white_48dp)
//                 .setTitle(R.string.settings_intru_rec_detail_dialog_title)
//                 .setPositiveButton(R.string.dialog_action_yes, new DialogInterface.OnClickListener() {
//                     @Override
//                     public void onClick(DialogInterface dialog, int which) {
//                         // User choose to delete this picture.
//                         picture.delete();
//                         mPictureList.remove(picture);
//                         dialog.dismiss();
//                         IntrusionRecordDetailsAdapter.this.notifyDataSetChanged();
//                     }
//                 })
//                 .setNegativeButton(R.string.dialog_action_no, new DialogInterface.OnClickListener() {
//                     @Override
//                     public void onClick(DialogInterface dialog, int which) {
//                         dialog.dismiss();
//                     }
//                 });
//         builder.create().show();
//     }
// 
//     private String getDateFromMills(String mills) {
//         Date date = new Date(Long.valueOf(mills));
//         SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//         return formatter.format(date);
//     }
// }


import android.os.Bundle;
import android.os.Environment;
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.support.v7.widget.Toolbar;
import android.view.MenuItem;
import com.createchance.doorgod.R;
import com.createchance.doorgod.adapter.IntrusionRecordDetailsAdapter;
package com.createchance.doorgod.ui;



public class IntrusionRecordDetailsActivity extends AppCompatActivity {

    private static final String TAG = "IntrusionRecordDetailsA";

    private RecyclerView mDetailList;
// Path: app/src/main/java/com/createchance/doorgod/adapter/IntrusionRecordDetailsAdapter.java
// public class IntrusionRecordDetailsAdapter extends RecyclerView.Adapter<IntrusionRecordDetailsAdapter.ViewHolder> {
// 
//     private static final String TAG = "IntrusionRecordAdapter";
// 
//     private List<File> mPictureList;
// 
//     private Context mContext;
// 
//     static class ViewHolder extends RecyclerView.ViewHolder {
//         TextView title;
//         ImageView content;
// 
//         public ViewHolder(View view) {
//             super(view);
// 
//             title = (TextView) view.findViewById(R.id.intru_details_title);
//             content = (ImageView) view.findViewById(R.id.intru_details_content);
//         }
//     }
// 
//     public IntrusionRecordDetailsAdapter(File folder) {
//         mPictureList = new ArrayList<>(Arrays.asList(folder.listFiles()));
//     }
// 
//     @Override
//     public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//         if (mContext == null) {
//             mContext = parent.getContext();
//         }
// 
//         View view = LayoutInflater.from(mContext).inflate(R.layout.intru_details_item, parent, false);
//         final IntrusionRecordDetailsAdapter.ViewHolder holder = new IntrusionRecordDetailsAdapter.ViewHolder(view);
// 
//         return holder;
//     }
// 
//     @Override
//     public void onBindViewHolder(IntrusionRecordDetailsAdapter.ViewHolder holder, final int position) {
//         LogUtil.d(TAG, mPictureList.get(position).getAbsolutePath());
//         String time = getDateFromMills(mPictureList.get(position).getName().split("_")[0]);
//         String appName = mPictureList.get(position).getName().split("_")[1].substring(0, mPictureList.get(position).getName().split("_")[1].lastIndexOf("."));
//         holder.title.setText(mContext.getString(R.string.settings_intru_rec_detail_item_title, time, appName));
//         Glide.with(mContext).load(mPictureList.get(position).getAbsoluteFile()).into(holder.content);
//         holder.content.setOnLongClickListener(new View.OnLongClickListener() {
//             @Override
//             public boolean onLongClick(View view) {
//                 showConfigChangedDialog(mPictureList.get(position));
//                 return true;
//             }
//         });
//     }
// 
//     @Override
//     public int getItemCount() {
//         return mPictureList.size();
//     }
// 
//     private void showConfigChangedDialog(final File picture) {
//         AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
//         builder.setIcon(R.drawable.ic_warning_white_48dp)
//                 .setTitle(R.string.settings_intru_rec_detail_dialog_title)
//                 .setPositiveButton(R.string.dialog_action_yes, new DialogInterface.OnClickListener() {
//                     @Override
//                     public void onClick(DialogInterface dialog, int which) {
//                         // User choose to delete this picture.
//                         picture.delete();
//                         mPictureList.remove(picture);
//                         dialog.dismiss();
//                         IntrusionRecordDetailsAdapter.this.notifyDataSetChanged();
//                     }
//                 })
//                 .setNegativeButton(R.string.dialog_action_no, new DialogInterface.OnClickListener() {
//                     @Override
//                     public void onClick(DialogInterface dialog, int which) {
//                         dialog.dismiss();
//                     }
//                 });
//         builder.create().show();
//     }
// 
//     private String getDateFromMills(String mills) {
//         Date date = new Date(Long.valueOf(mills));
//         SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//         return formatter.format(date);
//     }
// }


// Path: app/src/main/java/com/createchance/doorgod/ui/IntrusionRecordDetailsActivity.java
import android.os.Bundle;
import android.os.Environment;
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.support.v7.widget.Toolbar;
import android.view.MenuItem;
import com.createchance.doorgod.R;
import com.createchance.doorgod.adapter.IntrusionRecordDetailsAdapter;

package com.createchance.doorgod.ui;



public class IntrusionRecordDetailsActivity extends AppCompatActivity {

    private static final String TAG = "IntrusionRecordDetailsA";

    private RecyclerView mDetailList;
    private IntrusionRecordDetailsAdapter mAdapter;