Bug 898501: LOADER_ID OCD in ReadingListPage. [r=lucasr]
authorSriram Ramasubramanian <sriram@mozilla.com>
Mon, 29 Jul 2013 15:05:13 -0700
changeset 151462 0398421459d76af1ccd8f677fd2fe315177e34e8
parent 151461 0a243d3f33c2b922ea6e267fe5553e5ecc4485ed
child 151463 f2d68c93e066df60706cffd8a09fe8f941accf3c
push idunknown
push userunknown
push dateunknown
reviewerslucasr
bugs898501
milestone25.0a1
Bug 898501: LOADER_ID OCD in ReadingListPage. [r=lucasr]
mobile/android/base/home/ReadingListPage.java
--- a/mobile/android/base/home/ReadingListPage.java
+++ b/mobile/android/base/home/ReadingListPage.java
@@ -26,17 +26,17 @@ import android.view.ViewGroup;
 import android.widget.AdapterView;
 import android.widget.ListView;
 
 /**
  * Fragment that displays reading list contents in a ListView.
  */
 public class ReadingListPage extends HomeFragment {
     // Cursor loader ID for reading list
-    private static final int READING_LIST_LOADER_ID = 0;
+    private static final int LOADER_ID_READING_LIST = 0;
 
     // Adapter for the list of reading list items
     private ReadingListAdapter mAdapter;
 
     // The view shown by the fragment
     private ListView mList;
 
     // Callbacks used for the reading list and favicon cursor loaders
@@ -108,17 +108,17 @@ public class ReadingListPage extends Hom
 
         // Create callbacks before the initial loader is started.
         mCursorLoaderCallbacks = new CursorLoaderCallbacks();
         loadIfVisible();
     }
 
     @Override
     protected void load() {
-        getLoaderManager().initLoader(READING_LIST_LOADER_ID, null, mCursorLoaderCallbacks);
+        getLoaderManager().initLoader(LOADER_ID_READING_LIST, null, mCursorLoaderCallbacks);
     }
 
     /**
      * Cursor loader for the list of reading list items.
      */
     private static class ReadingListLoader extends SimpleCursorLoader {
         public ReadingListLoader(Context context) {
             super(context);
@@ -152,35 +152,35 @@ public class ReadingListPage extends Hom
 
     /**
      * LoaderCallbacks implementation that interacts with the LoaderManager.
      */
     private class CursorLoaderCallbacks implements LoaderCallbacks<Cursor> {
         @Override
         public Loader<Cursor> onCreateLoader(int id, Bundle args) {
             switch(id) {
-                case READING_LIST_LOADER_ID:
+                case LOADER_ID_READING_LIST:
                     return new ReadingListLoader(getActivity());
             }
             return null;
         }
 
         @Override
         public void onLoadFinished(Loader<Cursor> loader, Cursor c) {
             final int loaderId = loader.getId();
             switch(loaderId) {
-                case READING_LIST_LOADER_ID:
+                case LOADER_ID_READING_LIST:
                     mAdapter.swapCursor(c);
                     break;
            }
         }
 
         @Override
         public void onLoaderReset(Loader<Cursor> loader) {
             final int loaderId = loader.getId();
             switch(loaderId) {
-                case READING_LIST_LOADER_ID:
+                case LOADER_ID_READING_LIST:
                     mAdapter.swapCursor(null);
                     break;
             }
         }
     }
 }