зеркало из https://github.com/mozilla/gecko-dev.git
Bug 757776 - Show reading list icon on awesomebar search (r=mfinkle)
This commit is contained in:
Родитель
89ddf8a7b0
Коммит
d6fcaf2657
|
@ -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) {
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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",
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 372 B |
Двоичные данные
mobile/android/base/resources/drawable-xhdpi-v11/ic_awesomebar_reader.png
Normal file
Двоичные данные
mobile/android/base/resources/drawable-xhdpi-v11/ic_awesomebar_reader.png
Normal file
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 531 B |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 293 B |
Загрузка…
Ссылка в новой задаче