// Path: app/src/main/java/com/asha/nightowl/DetailActivity.java
// public class DetailActivity extends AppCompatActivity {
// 
//     public static void launch(Context context){
//         Intent i = new Intent(context,DetailActivity.class);
//         context.startActivity(i);
//     }
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         NightOwl.owlBeforeCreate(this);
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_detail);
//         NightOwl.owlAfterCreate(this);
// 
//         Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
//         setSupportActionBar(toolbar);
//         if (getSupportActionBar() != null) getSupportActionBar().setDisplayShowHomeEnabled(true);
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         NightOwl.owlResume(this);
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         switch (item.getItemId()){
//             case android.R.id.home: this.finish(); return true;
//         }
//         return super.onOptionsItemSelected(item);
//     }
// }
// 
// Path: app/src/main/java/com/asha/nightowl/DemoUtil.java
// public static int fetchFakeImage(int positon){
// 
//     return FakeImage[positon % FakeImage.length];
// }


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import com.asha.nightowl.DetailActivity;
import com.asha.nightowl.R;
import static com.asha.nightowl.DemoUtil.fetchFakeImage;

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            if ( convertView == null ){
                if ( mLayoutInflater == null )
                    mLayoutInflater = LayoutInflater.from(parent.getContext());
                convertView = mLayoutInflater.inflate(R.layout.item_view1,parent,false);
            }
            VH vh = (VH) convertView.getTag();
            if( vh == null ){
                vh = new VH(convertView);
                convertView.setTag(vh);
            }
            vh.bind(position);
            return convertView;
        }
    }

    public static class VH {
        ImageView mImageView;

        public VH(View mView) {
            mImageView = (ImageView) mView.findViewById(R.id.image);
        }
        public void bind(int position){
// Path: app/src/main/java/com/asha/nightowl/DetailActivity.java
// public class DetailActivity extends AppCompatActivity {
// 
//     public static void launch(Context context){
//         Intent i = new Intent(context,DetailActivity.class);
//         context.startActivity(i);
//     }
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         NightOwl.owlBeforeCreate(this);
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_detail);
//         NightOwl.owlAfterCreate(this);
// 
//         Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
//         setSupportActionBar(toolbar);
//         if (getSupportActionBar() != null) getSupportActionBar().setDisplayShowHomeEnabled(true);
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         NightOwl.owlResume(this);
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         switch (item.getItemId()){
//             case android.R.id.home: this.finish(); return true;
//         }
//         return super.onOptionsItemSelected(item);
//     }
// }
// 
// Path: app/src/main/java/com/asha/nightowl/DemoUtil.java
// public static int fetchFakeImage(int positon){
// 
//     return FakeImage[positon % FakeImage.length];
// }


// Path: app/src/main/java/com/asha/nightowl/fragments/ListViewFragment.java
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import com.asha.nightowl.DetailActivity;
import com.asha.nightowl.R;
import static com.asha.nightowl.DemoUtil.fetchFakeImage;


        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            if ( convertView == null ){
                if ( mLayoutInflater == null )
                    mLayoutInflater = LayoutInflater.from(parent.getContext());
                convertView = mLayoutInflater.inflate(R.layout.item_view1,parent,false);
            }
            VH vh = (VH) convertView.getTag();
            if( vh == null ){
                vh = new VH(convertView);
                convertView.setTag(vh);
            }
            vh.bind(position);
            return convertView;
        }
    }

    public static class VH {
        ImageView mImageView;

        public VH(View mView) {
            mImageView = (ImageView) mView.findViewById(R.id.image);
        }
        public void bind(int position){
            mImageView.setImageResource(fetchFakeImage(position));