Bug 963046 - Add image_url column to HomeProvider's fake items (r=margaret)
authorLucas Rocha <lucasr@mozilla.com>
Thu, 06 Feb 2014 21:06:39 +0000
changeset 184622 b85c89584af9d8c3b4e90294d4af80c9a65d718c
parent 184621 144c332f9e4f2776aeebd8a553290bacd46e4947
child 184623 4577b30df743032f4aefb60d2c76422183451c80
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs963046
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 963046 - Add image_url column to HomeProvider's fake items (r=margaret)
mobile/android/base/db/HomeProvider.java
mobile/android/base/resources/raw/fake_home_items.json
--- a/mobile/android/base/db/HomeProvider.java
+++ b/mobile/android/base/db/HomeProvider.java
@@ -98,29 +98,31 @@ public class HomeProvider extends SQLite
             return null;
         }
 
         final String[] itemsColumns = new String[] {
             HomeItems._ID,
             HomeItems.DATASET_ID,
             HomeItems.URL,
             HomeItems.TITLE,
-            HomeItems.DESCRIPTION
+            HomeItems.DESCRIPTION,
+            HomeItems.IMAGE_URL
         };
 
         final MatrixCursor c = new MatrixCursor(itemsColumns);
         for (int i = 0; i < items.length(); i++) {
             try {
                 final JSONObject item = items.getJSONObject(i);
                 c.addRow(new Object[] {
                     item.getInt("id"),
                     item.getString("dataset_id"),
                     item.getString("url"),
                     item.getString("title"),
-                    item.getString("description")
+                    item.getString("description"),
+                    item.getString("image_url")
                 });
             } catch (JSONException e) {
                 Log.e(LOGTAG, "Error creating cursor row for fake home item", e);
             }
         }
         return c;
     }
 
--- a/mobile/android/base/resources/raw/fake_home_items.json
+++ b/mobile/android/base/resources/raw/fake_home_items.json
@@ -1,13 +1,15 @@
 [{
     "id": 1,
     "dataset_id": "fake-dataset",
     "url": "http://example.com/first",
     "title": "First Example",
-    "description": "This is an example"
+    "description": "This is an example",
+    "image_url": "http://lorempixel.com/64/64?id=1"
 }, {
     "id": 2,
     "dataset_id": "fake-dataset",
     "url": "http://example.com/second",
     "title": "Second Example",
-    "description": "This is a second example"
+    "description": "This is a second example",
+    "image_url": "http://lorempixel.com/64/64?id=2"
 }]