diff --git a/mobile/android/base/AwesomeBarTabs.java b/mobile/android/base/AwesomeBarTabs.java index 00c8dd1350da..3b9049bc5e8c 100644 --- a/mobile/android/base/AwesomeBarTabs.java +++ b/mobile/android/base/AwesomeBarTabs.java @@ -157,11 +157,16 @@ public class AwesomeBarTabs extends TabHost { } Integer bookmarkId = (Integer) historyItem.get(Combined.BOOKMARK_ID); + Integer display = (Integer) historyItem.get(Combined.DISPLAY); // The bookmark id will be 0 (null in database) when the url - // is not a bookmark. - int visibility = (bookmarkId == 0 ? View.GONE : View.VISIBLE); + // is not a bookmark. Reading list items are irrelevant in history + // tab. We should never show any sign or them. + int visibility = (bookmarkId != 0 && display != Combined.DISPLAY_READER ? + View.VISIBLE : View.GONE); + viewHolder.bookmarkIconView.setVisibility(visibility); + viewHolder.bookmarkIconView.setImageResource(R.drawable.ic_awesomebar_star); return convertView; } @@ -481,6 +486,7 @@ public class AwesomeBarTabs extends TabHost { byte[] favicon = cursor.getBlob(cursor.getColumnIndexOrThrow(URLColumns.FAVICON)); Integer bookmarkId = cursor.getInt(cursor.getColumnIndexOrThrow(Combined.BOOKMARK_ID)); Integer historyId = cursor.getInt(cursor.getColumnIndexOrThrow(Combined.HISTORY_ID)); + Integer display = cursor.getInt(cursor.getColumnIndexOrThrow(Combined.DISPLAY)); // Use the URL instead of an empty title for consistency with the normal URL // bar view - this is the equivalent of getDisplayTitle() in Tab.java @@ -495,6 +501,7 @@ public class AwesomeBarTabs extends TabHost { historyItem.put(Combined.BOOKMARK_ID, bookmarkId); historyItem.put(Combined.HISTORY_ID, historyId); + historyItem.put(Combined.DISPLAY, display); return historyItem; } @@ -1088,10 +1095,19 @@ public class AwesomeBarTabs extends TabHost { int bookmarkIdIndex = cursor.getColumnIndexOrThrow(Combined.BOOKMARK_ID); long id = cursor.getLong(bookmarkIdIndex); + int displayIndex = cursor.getColumnIndexOrThrow(Combined.DISPLAY); + int display = cursor.getInt(displayIndex); + // The bookmark id will be 0 (null in database) when the url // is not a bookmark. int visibility = (id == 0 ? View.GONE : View.VISIBLE); bookmarkIconView.setVisibility(visibility); + + if (display == Combined.DISPLAY_READER) { + bookmarkIconView.setImageResource(R.drawable.ic_awesomebar_reader); + } else { + bookmarkIconView.setImageResource(R.drawable.ic_awesomebar_star); + } } public void setOnUrlOpenListener(OnUrlOpenListener listener) { diff --git a/mobile/android/base/Makefile.in b/mobile/android/base/Makefile.in index da09f2e80207..fa9732ed99cc 100644 --- a/mobile/android/base/Makefile.in +++ b/mobile/android/base/Makefile.in @@ -368,6 +368,7 @@ RES_DRAWABLE_BASE = \ res/drawable/awesomebar_tab_pressed.9.png \ res/drawable/ic_addons_empty.png \ res/drawable/ic_awesomebar_go.png \ + res/drawable/ic_awesomebar_reader.png \ res/drawable/ic_awesomebar_search.png \ res/drawable/ic_awesomebar_star.png \ res/drawable/ic_menu_back.xml \ @@ -445,6 +446,7 @@ RES_DRAWABLE_HDPI = \ res/drawable-hdpi/awesomebar_tab_pressed.9.png \ res/drawable-hdpi/ic_addons_empty.png \ res/drawable-hdpi/ic_awesomebar_go.png \ + res/drawable-hdpi/ic_awesomebar_reader.png \ res/drawable-hdpi/ic_awesomebar_search.png \ res/drawable-hdpi/ic_awesomebar_star.png \ res/drawable-hdpi/ic_menu_bookmark_add.png \ @@ -549,6 +551,7 @@ RES_DRAWABLE_XHDPI_V11 = \ res/drawable-xhdpi-v11/awesomebar_tab_pressed.9.png \ res/drawable-xhdpi-v11/ic_addons_empty.png \ res/drawable-xhdpi-v11/ic_awesomebar_go.png \ + res/drawable-xhdpi-v11/ic_awesomebar_reader.png \ res/drawable-xhdpi-v11/ic_awesomebar_search.png \ res/drawable-xhdpi-v11/ic_awesomebar_star.png \ res/drawable-xhdpi-v11/ic_menu_back.png \ diff --git a/mobile/android/base/db/LocalBrowserDB.java b/mobile/android/base/db/LocalBrowserDB.java index 8dbeee389cfb..5d9a773d0609 100644 --- a/mobile/android/base/db/LocalBrowserDB.java +++ b/mobile/android/base/db/LocalBrowserDB.java @@ -253,6 +253,7 @@ public class LocalBrowserDB implements BrowserDB.BrowserDBIface { Combined.URL, Combined.TITLE, Combined.FAVICON, + Combined.DISPLAY, Combined.DATE_LAST_VISITED, Combined.VISITS }, History.DATE_LAST_VISITED + " > 0", diff --git a/mobile/android/base/resources/drawable-hdpi/ic_awesomebar_reader.png b/mobile/android/base/resources/drawable-hdpi/ic_awesomebar_reader.png new file mode 100644 index 000000000000..7adf4a3e6bfd Binary files /dev/null and b/mobile/android/base/resources/drawable-hdpi/ic_awesomebar_reader.png differ diff --git a/mobile/android/base/resources/drawable-xhdpi-v11/ic_awesomebar_reader.png b/mobile/android/base/resources/drawable-xhdpi-v11/ic_awesomebar_reader.png new file mode 100644 index 000000000000..9ea7fc4ed305 Binary files /dev/null and b/mobile/android/base/resources/drawable-xhdpi-v11/ic_awesomebar_reader.png differ diff --git a/mobile/android/base/resources/drawable/ic_awesomebar_reader.png b/mobile/android/base/resources/drawable/ic_awesomebar_reader.png new file mode 100644 index 000000000000..dd312a7f629e Binary files /dev/null and b/mobile/android/base/resources/drawable/ic_awesomebar_reader.png differ