// Path: app/src/main/java/com/philliphsu/clock2/BaseFragment.java
// public abstract class BaseFragment extends Fragment {
//     /**
//      * Required empty public constructor. Subclasses do not
//      * need to implement their own.
//      */
//     public BaseFragment() {}
// 
//     /**
//      * @return the layout resource for this Fragment
//      */
//     @LayoutRes
//     protected abstract int contentLayout();
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//         View view = inflater.inflate(contentLayout(), container, false);
//         ButterKnife.bind(this, view);
//         return view;
//     }
// 
//     @Override
//     public void onDestroyView() {
//         super.onDestroyView();
//         ButterKnife.unbind(this); // Only for fragments!
//     }
// 
//     /**
//      * Callback invoked when this Fragment is part of a ViewPager and it has been
//      * selected, as indicated by {@link android.support.v4.view.ViewPager.OnPageChangeListener#onPageSelected(int)
//      * onPageSelected(int)}.
//      */
//     public void onPageSelected() {
//         // TODO: Consider making this abstract. The reason it wasn't abstract in the first place
//         // is not all Fragments in our ViewPager need to do things upon being selected. As such,
//         // those Fragments' classes would just end up stubbing this implementation.
//     }
// }
// 
// Path: app/src/main/java/com/philliphsu/clock2/data/BaseItemCursor.java
// public abstract class BaseItemCursor<T extends ObjectWithId> extends CursorWrapper {
//     private static final String TAG = "BaseItemCursor";
// 
//     public BaseItemCursor(Cursor cursor) {
//         super(cursor);
//     }
// 
//     /**
//      * @return an item instance configured for the current row,
//      * or null if the current row is invalid
//      */
//     public abstract T getItem();
// 
//     public long getId() {
//         if (isBeforeFirst() || isAfterLast()) {
//             Log.e(TAG, "Failed to retrieve id, cursor out of range");
//             return -1;
//         }
//         return getLong(getColumnIndexOrThrow("_id")); // TODO: Refer to a constant instead of a hardcoded value
//     }
// 
//     /**
//      * Helper method to determine boolean-valued columns.
//      * SQLite does not support a BOOLEAN data type.
//      */
//     protected boolean isTrue(String columnName) {
//         return getInt(getColumnIndexOrThrow(columnName)) == 1;
//     }
// }
// 
// Path: app/src/main/java/com/philliphsu/clock2/data/ObjectWithId.java
// public abstract class ObjectWithId {
//     private long id;
// 
//     public final long getId() {
//         return id;
//     }
// 
//     public final void setId(long id) {
//         this.id = id;
//     }
// 
//     public final int getIntId() {
//         return (int) id;
//     }
// }


import android.widget.TextView;
import com.philliphsu.clock2.BaseFragment;
import com.philliphsu.clock2.R;
import com.philliphsu.clock2.data.BaseItemCursor;
import com.philliphsu.clock2.data.ObjectWithId;
import butterknife.Bind;
import android.os.Bundle;
import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
    /**
     * @return the adapter instance created from {@link #onCreateAdapter()}
     */
    protected final A getAdapter() {
        return mAdapter;
    }

    /**
     * @return the LayoutManager to set on the RecyclerView. The default implementation
     * returns a vertical LinearLayoutManager.
     */
    protected RecyclerView.LayoutManager getLayoutManager() {
        // Called in onCreateView(), so the host activity is alive already.
        return new LinearLayoutManager(getActivity());
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = super.onCreateView(inflater, container, savedInstanceState);
        mList.setLayoutManager(getLayoutManager());
        mList.setAdapter(mAdapter = onCreateAdapter());
        if (hasEmptyView() && mEmptyView != null) {
            // Configure the empty view, even if there currently are items.
            mEmptyView.setText(emptyMessage());
            mEmptyView.setCompoundDrawablesRelativeWithIntrinsicBounds(0, emptyIcon(), 0, 0);
        }
        return view;
    }

// Path: app/src/main/java/com/philliphsu/clock2/BaseFragment.java
// public abstract class BaseFragment extends Fragment {
//     /**
//      * Required empty public constructor. Subclasses do not
//      * need to implement their own.
//      */
//     public BaseFragment() {}
// 
//     /**
//      * @return the layout resource for this Fragment
//      */
//     @LayoutRes
//     protected abstract int contentLayout();
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//         View view = inflater.inflate(contentLayout(), container, false);
//         ButterKnife.bind(this, view);
//         return view;
//     }
// 
//     @Override
//     public void onDestroyView() {
//         super.onDestroyView();
//         ButterKnife.unbind(this); // Only for fragments!
//     }
// 
//     /**
//      * Callback invoked when this Fragment is part of a ViewPager and it has been
//      * selected, as indicated by {@link android.support.v4.view.ViewPager.OnPageChangeListener#onPageSelected(int)
//      * onPageSelected(int)}.
//      */
//     public void onPageSelected() {
//         // TODO: Consider making this abstract. The reason it wasn't abstract in the first place
//         // is not all Fragments in our ViewPager need to do things upon being selected. As such,
//         // those Fragments' classes would just end up stubbing this implementation.
//     }
// }
// 
// Path: app/src/main/java/com/philliphsu/clock2/data/BaseItemCursor.java
// public abstract class BaseItemCursor<T extends ObjectWithId> extends CursorWrapper {
//     private static final String TAG = "BaseItemCursor";
// 
//     public BaseItemCursor(Cursor cursor) {
//         super(cursor);
//     }
// 
//     /**
//      * @return an item instance configured for the current row,
//      * or null if the current row is invalid
//      */
//     public abstract T getItem();
// 
//     public long getId() {
//         if (isBeforeFirst() || isAfterLast()) {
//             Log.e(TAG, "Failed to retrieve id, cursor out of range");
//             return -1;
//         }
//         return getLong(getColumnIndexOrThrow("_id")); // TODO: Refer to a constant instead of a hardcoded value
//     }
// 
//     /**
//      * Helper method to determine boolean-valued columns.
//      * SQLite does not support a BOOLEAN data type.
//      */
//     protected boolean isTrue(String columnName) {
//         return getInt(getColumnIndexOrThrow(columnName)) == 1;
//     }
// }
// 
// Path: app/src/main/java/com/philliphsu/clock2/data/ObjectWithId.java
// public abstract class ObjectWithId {
//     private long id;
// 
//     public final long getId() {
//         return id;
//     }
// 
//     public final void setId(long id) {
//         this.id = id;
//     }
// 
//     public final int getIntId() {
//         return (int) id;
//     }
// }


// Path: app/src/main/java/com/philliphsu/clock2/list/RecyclerViewFragment.java
import android.widget.TextView;
import com.philliphsu.clock2.BaseFragment;
import com.philliphsu.clock2.R;
import com.philliphsu.clock2.data.BaseItemCursor;
import com.philliphsu.clock2.data.ObjectWithId;
import butterknife.Bind;
import android.os.Bundle;
import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

    /**
     * @return the adapter instance created from {@link #onCreateAdapter()}
     */
    protected final A getAdapter() {
        return mAdapter;
    }

    /**
     * @return the LayoutManager to set on the RecyclerView. The default implementation
     * returns a vertical LinearLayoutManager.
     */
    protected RecyclerView.LayoutManager getLayoutManager() {
        // Called in onCreateView(), so the host activity is alive already.
        return new LinearLayoutManager(getActivity());
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = super.onCreateView(inflater, container, savedInstanceState);
        mList.setLayoutManager(getLayoutManager());
        mList.setAdapter(mAdapter = onCreateAdapter());
        if (hasEmptyView() && mEmptyView != null) {
            // Configure the empty view, even if there currently are items.
            mEmptyView.setText(emptyMessage());
            mEmptyView.setCompoundDrawablesRelativeWithIntrinsicBounds(0, emptyIcon(), 0, 0);
        }
        return view;
    }

    @Override