From 689741bd5cdea5bed60c31b42a4653d42ff3efdc Mon Sep 17 00:00:00 2001 From: Sriram Ramasubramanian Date: Tue, 17 Sep 2013 16:24:48 -0400 Subject: [PATCH] Bug 917396: Move the grid to "TopSites" page. [r=lucasr] --HG-- rename : mobile/android/base/home/PinBookmarkDialog.java => mobile/android/base/home/PinSiteDialog.java rename : mobile/android/base/home/TopBookmarksAdapter.java => mobile/android/base/home/TopSitesGridAdapter.java rename : mobile/android/base/home/TopBookmarkItemView.java => mobile/android/base/home/TopSitesGridItemView.java rename : mobile/android/base/home/TopBookmarksView.java => mobile/android/base/home/TopSitesGridView.java rename : mobile/android/base/home/BookmarkThumbnailView.java => mobile/android/base/home/TopSitesThumbnailView.java rename : mobile/android/base/resources/color/top_bookmark_item_title.xml => mobile/android/base/resources/color/top_sites_grid_item_title.xml rename : mobile/android/base/resources/drawable-hdpi/top_bookmark_add.png => mobile/android/base/resources/drawable-hdpi/top_site_add.png rename : mobile/android/base/resources/drawable-mdpi/top_bookmark_add.png => mobile/android/base/resources/drawable-mdpi/top_site_add.png rename : mobile/android/base/resources/drawable-xhdpi/top_bookmark_add.png => mobile/android/base/resources/drawable-xhdpi/top_site_add.png rename : mobile/android/base/resources/drawable/bookmark_thumbnail_bg.xml => mobile/android/base/resources/drawable/top_sites_thumbnail_bg.xml rename : mobile/android/base/resources/layout/pin_bookmark_dialog.xml => mobile/android/base/resources/layout/pin_site_dialog.xml rename : mobile/android/base/resources/layout/top_bookmark_item_view.xml => mobile/android/base/resources/layout/top_sites_grid_item_view.xml rename : mobile/android/base/resources/menu/top_bookmarks_contextmenu.xml => mobile/android/base/resources/menu/top_sites_contextmenu.xml --- mobile/android/base/Makefile.in | 26 +- ...BookmarkDialog.java => PinSiteDialog.java} | 26 +- ...sAdapter.java => TopSitesGridAdapter.java} | 12 +- ...temView.java => TopSitesGridItemView.java} | 16 +- ...okmarksView.java => TopSitesGridView.java} | 74 ++-- mobile/android/base/home/TopSitesPage.java | 414 +++++++++++++++++- ...ilView.java => TopSitesThumbnailView.java} | 16 +- .../base/locales/en-US/android_strings.dtd | 8 +- ...itle.xml => top_sites_grid_item_title.xml} | 0 ...{top_bookmark_add.png => top_site_add.png} | Bin ...{top_bookmark_add.png => top_site_add.png} | Bin ...{top_bookmark_add.png => top_site_add.png} | Bin ...nail_bg.xml => top_sites_thumbnail_bg.xml} | 0 ...ookmark_dialog.xml => pin_site_dialog.xml} | 2 +- ..._view.xml => top_sites_grid_item_view.xml} | 4 +- ...textmenu.xml => top_sites_contextmenu.xml} | 16 +- .../values-large-land-v11/styles.xml | 2 +- .../resources/values-large-v11/styles.xml | 2 +- .../base/resources/values-v11/themes.xml | 6 +- .../values-xlarge-land-v11/styles.xml | 2 +- .../android/base/resources/values/attrs.xml | 14 +- .../android/base/resources/values/styles.xml | 12 +- .../android/base/resources/values/themes.xml | 6 +- mobile/android/base/strings.xml.in | 8 +- 24 files changed, 519 insertions(+), 147 deletions(-) rename mobile/android/base/home/{PinBookmarkDialog.java => PinSiteDialog.java} (89%) rename mobile/android/base/home/{TopBookmarksAdapter.java => TopSitesGridAdapter.java} (89%) rename mobile/android/base/home/{TopBookmarkItemView.java => TopSitesGridItemView.java} (89%) rename mobile/android/base/home/{TopBookmarksView.java => TopSitesGridView.java} (76%) rename mobile/android/base/home/{BookmarkThumbnailView.java => TopSitesThumbnailView.java} (86%) rename mobile/android/base/resources/color/{top_bookmark_item_title.xml => top_sites_grid_item_title.xml} (100%) rename mobile/android/base/resources/drawable-hdpi/{top_bookmark_add.png => top_site_add.png} (100%) rename mobile/android/base/resources/drawable-mdpi/{top_bookmark_add.png => top_site_add.png} (100%) rename mobile/android/base/resources/drawable-xhdpi/{top_bookmark_add.png => top_site_add.png} (100%) rename mobile/android/base/resources/drawable/{bookmark_thumbnail_bg.xml => top_sites_thumbnail_bg.xml} (100%) rename mobile/android/base/resources/layout/{pin_bookmark_dialog.xml => pin_site_dialog.xml} (96%) rename mobile/android/base/resources/layout/{top_bookmark_item_view.xml => top_sites_grid_item_view.xml} (88%) rename mobile/android/base/resources/menu/{top_bookmarks_contextmenu.xml => top_sites_contextmenu.xml} (50%) diff --git a/mobile/android/base/Makefile.in b/mobile/android/base/Makefile.in index 14c3ad0109d5..3f85798687bc 100644 --- a/mobile/android/base/Makefile.in +++ b/mobile/android/base/Makefile.in @@ -217,7 +217,6 @@ FENNEC_JAVA_FILES = \ home/BookmarksListView.java \ home/BookmarksPage.java \ home/BookmarkFolderView.java \ - home/BookmarkThumbnailView.java \ home/BrowserSearch.java \ home/HistoryPage.java \ home/HomeCursorLoaderCallbacks.java \ @@ -231,7 +230,7 @@ FENNEC_JAVA_FILES = \ home/LastTabsPage.java \ home/MostRecentPage.java \ home/MultiTypeCursorAdapter.java \ - home/PinBookmarkDialog.java \ + home/PinSiteDialog.java \ home/ReadingListPage.java \ home/SearchEngine.java \ home/SearchEngineRow.java \ @@ -239,10 +238,11 @@ FENNEC_JAVA_FILES = \ home/SimpleCursorLoader.java \ home/SuggestClient.java \ home/TabMenuStrip.java \ - home/TopBookmarkItemView.java \ - home/TopBookmarksAdapter.java \ - home/TopBookmarksView.java \ + home/TopSitesGridAdapter.java \ + home/TopSitesGridItemView.java \ + home/TopSitesGridView.java \ home/TopSitesPage.java \ + home/TopSitesThumbnailView.java \ home/TwoLinePageRow.java \ menu/GeckoMenu.java \ menu/GeckoMenuInflater.java \ @@ -493,7 +493,7 @@ RES_LAYOUT = \ res/layout/notification_icon_text.xml \ res/layout/notification_progress.xml \ res/layout/notification_progress_text.xml \ - res/layout/pin_bookmark_dialog.xml \ + res/layout/pin_site_dialog.xml \ res/layout/preference_rightalign_icon.xml \ res/layout/preference_search_engine.xml \ res/layout/preference_search_tip.xml \ @@ -512,7 +512,7 @@ RES_LAYOUT = \ res/layout/tabs_item_cell.xml \ res/layout/tabs_item_row.xml \ res/layout/text_selection_handles.xml \ - res/layout/top_bookmark_item_view.xml \ + res/layout/top_sites_grid_item_view.xml \ res/layout/two_line_page_row.xml \ res/layout/list_item_header.xml \ res/layout/select_dialog_list.xml \ @@ -717,7 +717,7 @@ RES_DRAWABLE_MDPI = \ res/drawable-mdpi/tabs_normal.png \ res/drawable-mdpi/tabs_private.png \ res/drawable-mdpi/tabs_synced.png \ - res/drawable-mdpi/top_bookmark_add.png \ + res/drawable-mdpi/top_site_add.png \ res/drawable-mdpi/urlbar_stop.png \ res/drawable-mdpi/reader.png \ res/drawable-mdpi/reader_cropped.png \ @@ -826,7 +826,7 @@ RES_DRAWABLE_HDPI = \ res/drawable-hdpi/tabs_normal.png \ res/drawable-hdpi/tabs_private.png \ res/drawable-hdpi/tabs_synced.png \ - res/drawable-hdpi/top_bookmark_add.png \ + res/drawable-hdpi/top_site_add.png \ res/drawable-hdpi/urlbar_stop.png \ res/drawable-hdpi/reader.png \ res/drawable-hdpi/reader_cropped.png \ @@ -901,7 +901,7 @@ RES_DRAWABLE_XHDPI = \ res/drawable-xhdpi/find_close.png \ res/drawable-xhdpi/find_next.png \ res/drawable-xhdpi/find_prev.png \ - res/drawable-xhdpi/top_bookmark_add.png \ + res/drawable-xhdpi/top_site_add.png \ res/drawable-xhdpi/urlbar_stop.png \ res/drawable-xhdpi/reader.png \ res/drawable-xhdpi/reader_cropped.png \ @@ -1078,7 +1078,7 @@ RES_COLOR = \ res/color/select_item_multichoice.xml \ res/color/tertiary_text.xml \ res/color/tertiary_text_inverse.xml \ - res/color/top_bookmark_item_title.xml \ + res/color/top_sites_grid_item_title.xml \ res/color/url_bar_title.xml \ res/color/url_bar_title_hint.xml \ $(NULL) @@ -1088,7 +1088,7 @@ RES_MENU = \ res/menu/gecko_app_menu.xml \ res/menu/home_contextmenu.xml \ res/menu/titlebar_contextmenu.xml \ - res/menu/top_bookmarks_contextmenu.xml \ + res/menu/top_sites_contextmenu.xml \ res/menu-large-v11/browser_app_menu.xml \ res/menu-v11/browser_app_menu.xml \ res/menu-xlarge-v11/browser_app_menu.xml \ @@ -1106,7 +1106,7 @@ RES_DRAWABLE += \ $(SYNC_RES_DRAWABLE) \ res/drawable/action_bar_button.xml \ res/drawable/action_bar_button_inverse.xml \ - res/drawable/bookmark_thumbnail_bg.xml \ + res/drawable/top_sites_thumbnail_bg.xml \ res/drawable/url_bar_bg.xml \ res/drawable/url_bar_entry.xml \ res/drawable/url_bar_nav_button.xml \ diff --git a/mobile/android/base/home/PinBookmarkDialog.java b/mobile/android/base/home/PinSiteDialog.java similarity index 89% rename from mobile/android/base/home/PinBookmarkDialog.java rename to mobile/android/base/home/PinSiteDialog.java index 3e20ea80578d..bb67a77cd13d 100644 --- a/mobile/android/base/home/PinBookmarkDialog.java +++ b/mobile/android/base/home/PinSiteDialog.java @@ -27,12 +27,12 @@ import android.widget.EditText; import android.widget.ListView; /** - * Dialog fragment that displays frecency search results, for pinning as a bookmark, in a ListView. + * Dialog fragment that displays frecency search results, for pinning a site, in a GridView. */ -class PinBookmarkDialog extends DialogFragment { +class PinSiteDialog extends DialogFragment { // Listener for url selection - public static interface OnBookmarkSelectedListener { - public void onBookmarkSelected(String url, String title); + public static interface OnSiteSelectedListener { + public void onSiteSelected(String url, String title); } // Cursor loader ID for search query @@ -57,13 +57,13 @@ class PinBookmarkDialog extends DialogFragment { private CursorLoaderCallbacks mLoaderCallbacks; // Bookmark selected listener - private OnBookmarkSelectedListener mOnBookmarkSelectedListener; + private OnSiteSelectedListener mOnSiteSelectedListener; - public static PinBookmarkDialog newInstance() { - return new PinBookmarkDialog(); + public static PinSiteDialog newInstance() { + return new PinSiteDialog(); } - private PinBookmarkDialog() { + private PinSiteDialog() { } @Override @@ -77,7 +77,7 @@ class PinBookmarkDialog extends DialogFragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // All list views are styled to look the same with a global activity theme. // If the style of the list changes, inflate it from an XML. - return inflater.inflate(R.layout.pin_bookmark_dialog, container, false); + return inflater.inflate(R.layout.pin_site_dialog, container, false); } @Override @@ -104,7 +104,7 @@ class PinBookmarkDialog extends DialogFragment { mList.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { - if (mOnBookmarkSelectedListener != null) { + if (mOnSiteSelectedListener != null) { final Cursor c = mAdapter.getCursor(); if (c == null || !c.moveToPosition(position)) { return; @@ -112,7 +112,7 @@ class PinBookmarkDialog extends DialogFragment { final String url = c.getString(c.getColumnIndexOrThrow(URLColumns.URL)); final String title = c.getString(c.getColumnIndexOrThrow(URLColumns.TITLE)); - mOnBookmarkSelectedListener.onBookmarkSelected(url, title); + mOnSiteSelectedListener.onSiteSelected(url, title); } // Dismiss the fragment and the dialog. @@ -154,8 +154,8 @@ class PinBookmarkDialog extends DialogFragment { SearchLoader.restart(getLoaderManager(), LOADER_ID_SEARCH, mLoaderCallbacks, mSearchTerm); } - public void setOnBookmarkSelectedListener(OnBookmarkSelectedListener listener) { - mOnBookmarkSelectedListener = listener; + public void setOnSiteSelectedListener(OnSiteSelectedListener listener) { + mOnSiteSelectedListener = listener; } private static class SearchAdapter extends CursorAdapter { diff --git a/mobile/android/base/home/TopBookmarksAdapter.java b/mobile/android/base/home/TopSitesGridAdapter.java similarity index 89% rename from mobile/android/base/home/TopBookmarksAdapter.java rename to mobile/android/base/home/TopSitesGridAdapter.java index e848ba649d3e..00a4aa782bf8 100644 --- a/mobile/android/base/home/TopBookmarksAdapter.java +++ b/mobile/android/base/home/TopSitesGridAdapter.java @@ -20,9 +20,9 @@ import android.view.ViewGroup; import java.util.Map; /** - * A cursor adapter holding the pinned and top bookmarks. + * A cursor adapter holding the pinned and top sites. */ -public class TopBookmarksAdapter extends CursorAdapter { +public class TopSitesGridAdapter extends CursorAdapter { // Cache to store the thumbnails. private Map mThumbnails; @@ -42,7 +42,7 @@ public class TopBookmarksAdapter extends CursorAdapter { } } - public TopBookmarksAdapter(Context context, Cursor cursor) { + public TopSitesGridAdapter(Context context, Cursor cursor) { super(context, cursor); } @@ -82,14 +82,14 @@ public class TopBookmarksAdapter extends CursorAdapter { pinned = ((TopSitesCursorWrapper) cursor).isPinned(); } - TopBookmarkItemView view = (TopBookmarkItemView) bindView; + TopSitesGridItemView view = (TopSitesGridItemView) bindView; view.setTitle(title); view.setUrl(url); view.setPinned(pinned); // If there is no url, then show "add bookmark". if (TextUtils.isEmpty(url)) { - view.displayThumbnail(R.drawable.top_bookmark_add); + view.displayThumbnail(R.drawable.top_site_add); } else { // Show the thumbnail. Thumbnail thumbnail = (mThumbnails != null ? mThumbnails.get(url) : null); @@ -108,6 +108,6 @@ public class TopBookmarksAdapter extends CursorAdapter { */ @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { - return new TopBookmarkItemView(context); + return new TopSitesGridItemView(context); } } diff --git a/mobile/android/base/home/TopBookmarkItemView.java b/mobile/android/base/home/TopSitesGridItemView.java similarity index 89% rename from mobile/android/base/home/TopBookmarkItemView.java rename to mobile/android/base/home/TopSitesGridItemView.java index bdf76a0152c1..668b296c1276 100644 --- a/mobile/android/base/home/TopBookmarkItemView.java +++ b/mobile/android/base/home/TopSitesGridItemView.java @@ -19,13 +19,13 @@ import android.widget.LinearLayout; import android.widget.TextView; /** - * A view that displays the thumbnail and the title/url for a bookmark. + * A view that displays the thumbnail and the title/url for a top/pinned site. * If the title/url is longer than the width of the view, they are faded out. * If there is no valid url, a default string is shown at 50% opacity. * This is denoted by the empty state. */ -public class TopBookmarkItemView extends RelativeLayout { - private static final String LOGTAG = "GeckoTopBookmarkItemView"; +public class TopSitesGridItemView extends LinearLayout { + private static final String LOGTAG = "GeckoTopSitesGridItemView"; // Empty state, to denote there is no valid url. private static final int[] STATE_EMPTY = { android.R.attr.state_empty }; @@ -44,18 +44,18 @@ public class TopBookmarkItemView extends RelativeLayout { // Empty state. private boolean mIsEmpty = true; - public TopBookmarkItemView(Context context) { + public TopSitesGridItemView(Context context) { this(context, null); } - public TopBookmarkItemView(Context context, AttributeSet attrs) { - this(context, attrs, R.attr.topBookmarkItemViewStyle); + public TopSitesGridItemView(Context context, AttributeSet attrs) { + this(context, attrs, R.attr.topSitesGridItemViewStyle); } - public TopBookmarkItemView(Context context, AttributeSet attrs, int defStyle) { + public TopSitesGridItemView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); - LayoutInflater.from(context).inflate(R.layout.top_bookmark_item_view, this); + LayoutInflater.from(context).inflate(R.layout.top_sites_grid_item_view, this); mTitleView = (TextView) findViewById(R.id.title); mThumbnailView = (ImageView) findViewById(R.id.thumbnail); diff --git a/mobile/android/base/home/TopBookmarksView.java b/mobile/android/base/home/TopSitesGridView.java similarity index 76% rename from mobile/android/base/home/TopBookmarksView.java rename to mobile/android/base/home/TopSitesGridView.java index 9a25ccb563cc..111bb39a0ebc 100644 --- a/mobile/android/base/home/TopBookmarksView.java +++ b/mobile/android/base/home/TopSitesGridView.java @@ -25,19 +25,19 @@ import android.widget.GridView; import java.util.EnumSet; /** - * A grid view of top bookmarks and pinned tabs. - * Each cell in the grid is a TopBookmarkItemView. + * A grid view of top and pinned sites. + * Each cell in the grid is a TopSitesGridItemView. */ -public class TopBookmarksView extends GridView { - private static final String LOGTAG = "GeckoTopBookmarksView"; +public class TopSitesGridView extends GridView { + private static final String LOGTAG = "GeckoTopSitesGridView"; - // Listener for pinning bookmarks. - public static interface OnPinBookmarkListener { - public void onPinBookmark(int position); + // Listener for pinning sites. + public static interface OnPinSiteListener { + public void onPinSite(int position); } - // Max number of bookmarks that needs to be shown. - private final int mMaxBookmarks; + // Max number of top sites that needs to be shown. + private final int mMaxSites; // Number of columns to show. private final int mNumColumns; @@ -57,29 +57,29 @@ public class TopBookmarksView extends GridView { // On URL open listener. private OnUrlOpenListener mUrlOpenListener; - // Pin bookmark listener. - private OnPinBookmarkListener mPinBookmarkListener; + // Pin site listener. + private OnPinSiteListener mPinSiteListener; // Context menu info. - private TopBookmarksContextMenuInfo mContextMenuInfo; + private TopSitesGridContextMenuInfo mContextMenuInfo; - public TopBookmarksView(Context context) { + public TopSitesGridView(Context context) { this(context, null); } - public TopBookmarksView(Context context, AttributeSet attrs) { - this(context, attrs, R.attr.topBookmarksViewStyle); + public TopSitesGridView(Context context, AttributeSet attrs) { + this(context, attrs, R.attr.topSitesGridViewStyle); } - public TopBookmarksView(Context context, AttributeSet attrs, int defStyle) { + public TopSitesGridView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); - mMaxBookmarks = getResources().getInteger(R.integer.number_of_top_sites); + mMaxSites = getResources().getInteger(R.integer.number_of_top_sites); mNumColumns = getResources().getInteger(R.integer.number_of_top_sites_cols); setNumColumns(mNumColumns); - TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TopBookmarksView, defStyle, 0); - mHorizontalSpacing = a.getDimensionPixelOffset(R.styleable.TopBookmarksView_android_horizontalSpacing, 0x00); - mVerticalSpacing = a.getDimensionPixelOffset(R.styleable.TopBookmarksView_android_verticalSpacing, 0x00); + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TopSitesGridView, defStyle, 0); + mHorizontalSpacing = a.getDimensionPixelOffset(R.styleable.TopSitesGridView_android_horizontalSpacing, 0x00); + mVerticalSpacing = a.getDimensionPixelOffset(R.styleable.TopSitesGridView_android_verticalSpacing, 0x00); a.recycle(); } @@ -93,18 +93,18 @@ public class TopBookmarksView extends GridView { setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { - TopBookmarkItemView row = (TopBookmarkItemView) view; + TopSitesGridItemView row = (TopSitesGridItemView) view; String url = row.getUrl(); - // If the url is empty, the user can pin a bookmark. + // If the url is empty, the user can pin a site. // If not, navigate to the page given by the url. if (!TextUtils.isEmpty(url)) { if (mUrlOpenListener != null) { mUrlOpenListener.onUrlOpen(url, EnumSet.noneOf(OnUrlOpenListener.Flags.class)); } } else { - if (mPinBookmarkListener != null) { - mPinBookmarkListener.onPinBookmark(position); + if (mPinSiteListener != null) { + mPinSiteListener.onPinSite(position); } } } @@ -114,8 +114,8 @@ public class TopBookmarksView extends GridView { @Override public boolean onItemLongClick(AdapterView parent, View view, int position, long id) { Cursor cursor = (Cursor) parent.getItemAtPosition(position); - mContextMenuInfo = new TopBookmarksContextMenuInfo(view, position, id, cursor); - return showContextMenuForChild(TopBookmarksView.this); + mContextMenuInfo = new TopSitesGridContextMenuInfo(view, position, id, cursor); + return showContextMenuForChild(TopSitesGridView.this); } }); } @@ -125,7 +125,7 @@ public class TopBookmarksView extends GridView { super.onDetachedFromWindow(); mUrlOpenListener = null; - mPinBookmarkListener = null; + mPinSiteListener = null; } /** @@ -160,7 +160,7 @@ public class TopBookmarksView extends GridView { ThumbnailHelper.getInstance().setThumbnailWidth(childWidth); // Get the first child from the adapter. - final View child = new TopBookmarkItemView(getContext()); + final View child = new TopSitesGridItemView(getContext()); // Set a default LayoutParams on the child, if it doesn't have one on its own. AbsListView.LayoutParams params = (AbsListView.LayoutParams) child.getLayoutParams(); @@ -171,14 +171,14 @@ public class TopBookmarksView extends GridView { } // Measure the exact width of the child, and the height based on the width. - // Note: the child (and BookmarkThumbnailView) takes care of calculating its height. + // Note: the child (and TopSitesThumbnailView) takes care of calculating its height. int childWidthSpec = MeasureSpec.makeMeasureSpec(childWidth, MeasureSpec.EXACTLY); int childHeightSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); child.measure(childWidthSpec, childHeightSpec); final int childHeight = child.getMeasuredHeight(); - // Number of rows required to show these bookmarks. - final int rows = (int) Math.ceil((double) mMaxBookmarks / mNumColumns); + // Number of rows required to show these top sites. + final int rows = (int) Math.ceil((double) mMaxSites / mNumColumns); final int childrenHeight = childHeight * rows; final int totalVerticalSpacing = rows > 0 ? (rows - 1) * mVerticalSpacing : 0; @@ -204,18 +204,18 @@ public class TopBookmarksView extends GridView { } /** - * Set a pin bookmark listener to be used by this view. + * Set a pin site listener to be used by this view. * - * @param listener A pin bookmark listener for this view. + * @param listener A pin site listener for this view. */ - public void setOnPinBookmarkListener(OnPinBookmarkListener listener) { - mPinBookmarkListener = listener; + public void setOnPinSiteListener(OnPinSiteListener listener) { + mPinSiteListener = listener; } /** * A ContextMenuInfo for TopBoomarksView that adds details from the cursor. */ - public static class TopBookmarksContextMenuInfo extends AdapterContextMenuInfo { + public static class TopSitesGridContextMenuInfo extends AdapterContextMenuInfo { // URL to Title replacement regex. private static final String REGEX_URL_TO_TITLE = "^([a-z]+://)?(www\\.)?"; @@ -224,7 +224,7 @@ public class TopBookmarksView extends GridView { public String title; public boolean isPinned; - public TopBookmarksContextMenuInfo(View targetView, int position, long id, Cursor cursor) { + public TopSitesGridContextMenuInfo(View targetView, int position, long id, Cursor cursor) { super(targetView, position, id); if (cursor == null) { diff --git a/mobile/android/base/home/TopSitesPage.java b/mobile/android/base/home/TopSitesPage.java index 8ce4d6905197..1109e7df680d 100644 --- a/mobile/android/base/home/TopSitesPage.java +++ b/mobile/android/base/home/TopSitesPage.java @@ -5,24 +5,44 @@ package org.mozilla.gecko.home; +import org.mozilla.gecko.favicons.Favicons; import org.mozilla.gecko.R; +import org.mozilla.gecko.Tabs; import org.mozilla.gecko.animation.PropertyAnimator; import org.mozilla.gecko.animation.PropertyAnimator.Property; import org.mozilla.gecko.animation.ViewHelper; +import org.mozilla.gecko.db.BrowserContract.Thumbnails; import org.mozilla.gecko.db.BrowserDB; import org.mozilla.gecko.db.BrowserDB.URLColumns; +import org.mozilla.gecko.gfx.BitmapUtils; +import org.mozilla.gecko.home.HomeListView.HomeContextMenuInfo; import org.mozilla.gecko.home.HomePager.OnUrlOpenListener; +import org.mozilla.gecko.home.PinSiteDialog.OnSiteSelectedListener; +import org.mozilla.gecko.home.TopSitesGridAdapter.Thumbnail; +import org.mozilla.gecko.home.TopSitesGridView.OnPinSiteListener; +import org.mozilla.gecko.home.TopSitesGridView.TopSitesGridContextMenuInfo; +import org.mozilla.gecko.util.ThreadUtils; import android.app.Activity; import android.content.ContentResolver; import android.content.Context; import android.content.res.Configuration; import android.database.Cursor; +import android.graphics.Bitmap; import android.os.Bundle; +import android.support.v4.app.FragmentManager; import android.support.v4.app.LoaderManager; +import android.support.v4.app.LoaderManager.LoaderCallbacks; +import android.support.v4.content.AsyncTaskLoader; import android.support.v4.content.Loader; import android.support.v4.widget.CursorAdapter; +import android.text.TextUtils; +import android.util.Log; +import android.view.ContextMenu; +import android.view.ContextMenu.ContextMenuInfo; import android.view.LayoutInflater; +import android.view.MenuInflater; +import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; @@ -32,8 +52,12 @@ import android.widget.AdapterView; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; +import android.widget.Toast; import java.util.EnumSet; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; /** * Fragment that displays frecency search results in a ListView. @@ -42,15 +66,30 @@ public class TopSitesPage extends HomeFragment { // Logging tag name private static final String LOGTAG = "GeckoTopSitesPage"; - // Cursor loader ID for search query - private static final int LOADER_ID_TOP_SITES = 0; + // Cursor loader ID for list of top sites + private static final int LOADER_ID_TOP_SITES_LIST = 0; - // Adapter for the list of search results - private VisitedAdapter mAdapter; + // Cursor loader ID for grid of top sites + private static final int LOADER_ID_TOP_SITES_GRID = 1; - // The view shown by the fragment. + // Loader ID for thumbnails + private static final int LOADER_ID_THUMBNAILS = 2; + + // Key for thumbnail urls + private static final String THUMBNAILS_URLS_KEY = "urls"; + + // Adapter for the list of top sites + private VisitedAdapter mListAdapter; + + // Adapter for the grid of top sites + private TopSitesGridAdapter mGridAdapter; + + // List of top sites private ListView mList; + // Grid of top sites + private TopSitesGridView mGrid; + // Reference to the View to display when there are no results. private View mEmptyView; @@ -66,6 +105,12 @@ public class TopSitesPage extends HomeFragment { // Callbacks used for the search and favicon cursor loaders private CursorLoaderCallbacks mCursorLoaderCallbacks; + // Callback for thumbnail loader + private ThumbnailsLoaderCallbacks mThumbnailsLoaderCallbacks; + + // Listener for pinning sites + private PinSiteListener mPinSiteListener; + // On URL open listener private OnUrlOpenListener mUrlOpenListener; @@ -98,18 +143,26 @@ public class TopSitesPage extends HomeFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - return inflater.inflate(R.layout.home_top_sites_page, container, false); + final View view = inflater.inflate(R.layout.home_top_sites_page, container, false); + + mList = (HomeListView) view.findViewById(R.id.list); + + mGrid = new TopSitesGridView(getActivity()); + mList.addHeaderView(mGrid); + + return view; } @Override public void onViewCreated(View view, Bundle savedInstanceState) { - mList = (HomeListView) view.findViewById(R.id.list); + mPinSiteListener = new PinSiteListener(); + mList.setTag(HomePager.LIST_TAG_MOST_VISITED); mList.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { - final Cursor c = mAdapter.getCursor(); + final Cursor c = mListAdapter.getCursor(); if (c == null || !c.moveToPosition(position)) { return; } @@ -121,7 +174,11 @@ public class TopSitesPage extends HomeFragment { } }); + mGrid.setOnUrlOpenListener(mUrlOpenListener); + mGrid.setOnPinSiteListener(mPinSiteListener); + registerForContextMenu(mList); + registerForContextMenu(mGrid); mBanner = (HomeBanner) view.findViewById(R.id.home_banner); mList.setOnTouchListener(new OnTouchListener() { @@ -137,7 +194,10 @@ public class TopSitesPage extends HomeFragment { public void onDestroyView() { super.onDestroyView(); mList = null; + mGrid = null; mEmptyView = null; + mListAdapter = null; + mGridAdapter = null; } @Override @@ -159,18 +219,163 @@ public class TopSitesPage extends HomeFragment { final Activity activity = getActivity(); - // Intialize the search adapter - mAdapter = new VisitedAdapter(activity, null); - mList.setAdapter(mAdapter); + // Setup the top sites grid adapter. + mGridAdapter = new TopSitesGridAdapter(activity, null); + mGrid.setAdapter(mGridAdapter); + + // Setup the top sites list adapter. + mListAdapter = new VisitedAdapter(activity, null); + mList.setAdapter(mListAdapter); // Create callbacks before the initial loader is started mCursorLoaderCallbacks = new CursorLoaderCallbacks(activity, getLoaderManager()); + mThumbnailsLoaderCallbacks = new ThumbnailsLoaderCallbacks(); loadIfVisible(); } + @Override + public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) { + if (menuInfo == null) { + return; + } + + // HomeFragment will handle the default case. + if (menuInfo instanceof HomeContextMenuInfo) { + super.onCreateContextMenu(menu, view, menuInfo); + } + + if (!(menuInfo instanceof TopSitesGridContextMenuInfo)) { + return; + } + + MenuInflater inflater = new MenuInflater(view.getContext()); + inflater.inflate(R.menu.top_sites_contextmenu, menu); + + TopSitesGridContextMenuInfo info = (TopSitesGridContextMenuInfo) menuInfo; + + if (!TextUtils.isEmpty(info.url)) { + if (info.isPinned) { + menu.findItem(R.id.top_sites_pin).setVisible(false); + } else { + menu.findItem(R.id.top_sites_unpin).setVisible(false); + } + } else { + menu.findItem(R.id.top_sites_open_new_tab).setVisible(false); + menu.findItem(R.id.top_sites_open_private_tab).setVisible(false); + menu.findItem(R.id.top_sites_pin).setVisible(false); + menu.findItem(R.id.top_sites_unpin).setVisible(false); + } + } + + @Override + public boolean onContextItemSelected(MenuItem item) { + ContextMenuInfo menuInfo = item.getMenuInfo(); + + // HomeFragment will handle the default case. + if (menuInfo == null || !(menuInfo instanceof TopSitesGridContextMenuInfo)) { + return false; + } + + TopSitesGridContextMenuInfo info = (TopSitesGridContextMenuInfo) menuInfo; + final Activity activity = getActivity(); + + final int itemId = item.getItemId(); + if (itemId == R.id.top_sites_open_new_tab || itemId == R.id.top_sites_open_private_tab) { + if (info.url == null) { + Log.e(LOGTAG, "Can't open in new tab because URL is null"); + return false; + } + + int flags = Tabs.LOADURL_NEW_TAB | Tabs.LOADURL_BACKGROUND; + if (item.getItemId() == R.id.top_sites_open_private_tab) + flags |= Tabs.LOADURL_PRIVATE; + + Tabs.getInstance().loadUrl(info.url, flags); + Toast.makeText(activity, R.string.new_tab_opened, Toast.LENGTH_SHORT).show(); + return true; + } + + if (itemId == R.id.top_sites_pin) { + final String url = info.url; + final String title = info.title; + final int position = info.position; + final Context context = getActivity().getApplicationContext(); + + ThreadUtils.postToBackgroundThread(new Runnable() { + @Override + public void run() { + BrowserDB.pinSite(context.getContentResolver(), url, title, position); + } + }); + + return true; + } + + if (itemId == R.id.top_sites_unpin) { + final int position = info.position; + final Context context = getActivity().getApplicationContext(); + + ThreadUtils.postToBackgroundThread(new Runnable() { + @Override + public void run() { + BrowserDB.unpinSite(context.getContentResolver(), position); + } + }); + + return true; + } + + if (itemId == R.id.top_sites_edit) { + mPinSiteListener.onPinSite(info.position); + return true; + } + + return false; + } + @Override protected void load() { - getLoaderManager().initLoader(LOADER_ID_TOP_SITES, null, mCursorLoaderCallbacks); + final LoaderManager manager = getLoaderManager(); + manager.initLoader(LOADER_ID_TOP_SITES_LIST, null, mCursorLoaderCallbacks); + manager.initLoader(LOADER_ID_TOP_SITES_GRID, null, mCursorLoaderCallbacks); + } + + /** + * Listener for pinning sites. + */ + private class PinSiteListener implements OnPinSiteListener, + OnSiteSelectedListener { + // Tag for the PinSiteDialog fragment. + private static final String TAG_PIN_SITE = "pin_site"; + + // Position of the pin. + private int mPosition; + + @Override + public void onPinSite(int position) { + mPosition = position; + + final FragmentManager manager = getActivity().getSupportFragmentManager(); + PinSiteDialog dialog = (PinSiteDialog) manager.findFragmentByTag(TAG_PIN_SITE); + if (dialog == null) { + dialog = PinSiteDialog.newInstance(); + } + + dialog.setOnSiteSelectedListener(this); + dialog.show(manager, TAG_PIN_SITE); + } + + @Override + public void onSiteSelected(final String url, final String title) { + final int position = mPosition; + final Context context = getActivity().getApplicationContext(); + ThreadUtils.postToBackgroundThread(new Runnable() { + @Override + public void run() { + BrowserDB.pinSite(context.getContentResolver(), url, title, position); + } + }); + } } private void handleListTouchEvent(MotionEvent event) { @@ -247,11 +452,11 @@ public class TopSitesPage extends HomeFragment { } } - private static class TopSitesCursorLoader extends SimpleCursorLoader { + private static class TopSitesListLoader extends SimpleCursorLoader { // Max number of search results private static final int SEARCH_LIMIT = 50; - public TopSitesCursorLoader(Context context) { + public TopSitesListLoader(Context context) { super(context); } @@ -262,6 +467,18 @@ public class TopSitesPage extends HomeFragment { } } + private static class TopSitesGridLoader extends SimpleCursorLoader { + public TopSitesGridLoader(Context context) { + super(context); + } + + @Override + public Cursor loadCursor() { + final int max = getContext().getResources().getInteger(R.integer.number_of_top_sites); + return BrowserDB.getTopBookmarks(getContext().getContentResolver(), max); + } + } + private class VisitedAdapter extends CursorAdapter { public VisitedAdapter(Context context, Cursor cursor) { super(context, cursor); @@ -286,8 +503,12 @@ public class TopSitesPage extends HomeFragment { @Override public Loader onCreateLoader(int id, Bundle args) { - if (id == LOADER_ID_TOP_SITES) { - return new TopSitesCursorLoader(getActivity()); + final Activity activity = getActivity(); + + if (id == LOADER_ID_TOP_SITES_LIST) { + return new TopSitesListLoader(activity); + } else if (id == LOADER_ID_TOP_SITES_GRID) { + return new TopSitesGridLoader(activity); } else { return super.onCreateLoader(id, args); } @@ -295,10 +516,29 @@ public class TopSitesPage extends HomeFragment { @Override public void onLoadFinished(Loader loader, Cursor c) { - if (loader.getId() == LOADER_ID_TOP_SITES) { - mAdapter.swapCursor(c); + final int id = loader.getId(); + + if (id == LOADER_ID_TOP_SITES_LIST) { + mListAdapter.swapCursor(c); updateUiFromCursor(c); loadFavicons(c); + } else if (id == LOADER_ID_TOP_SITES_GRID) { + mGridAdapter.swapCursor(c); + + // Load the thumbnails. + if (c.getCount() > 0 && c.moveToFirst()) { + final ArrayList urls = new ArrayList(); + do { + final String url = c.getString(c.getColumnIndexOrThrow(URLColumns.URL)); + urls.add(url); + } while (c.moveToNext()); + + if (urls.size() > 0) { + Bundle bundle = new Bundle(); + bundle.putStringArrayList(THUMBNAILS_URLS_KEY, urls); + getLoaderManager().restartLoader(LOADER_ID_THUMBNAILS, bundle, mThumbnailsLoaderCallbacks); + } + } } else { super.onLoadFinished(loader, c); } @@ -306,8 +546,12 @@ public class TopSitesPage extends HomeFragment { @Override public void onLoaderReset(Loader loader) { - if (loader.getId() == LOADER_ID_TOP_SITES) { - mAdapter.swapCursor(null); + final int id = loader.getId(); + + if (id == LOADER_ID_TOP_SITES_LIST) { + mListAdapter.swapCursor(null); + } else if (id == LOADER_ID_TOP_SITES_GRID) { + mGridAdapter.swapCursor(null); } else { super.onLoaderReset(loader); } @@ -315,7 +559,135 @@ public class TopSitesPage extends HomeFragment { @Override public void onFaviconsLoaded() { - mAdapter.notifyDataSetChanged(); + mListAdapter.notifyDataSetChanged(); + } + } + + /** + * An AsyncTaskLoader to load the thumbnails from a cursor. + */ + private static class ThumbnailsLoader extends AsyncTaskLoader> { + private Map mThumbnails; + private ArrayList mUrls; + + public ThumbnailsLoader(Context context, ArrayList urls) { + super(context); + mUrls = urls; + } + + @Override + public Map loadInBackground() { + if (mUrls == null || mUrls.size() == 0) { + return null; + } + + final Map thumbnails = new HashMap(); + + // Query the DB for thumbnails. + final ContentResolver cr = getContext().getContentResolver(); + final Cursor cursor = BrowserDB.getThumbnailsForUrls(cr, mUrls); + + try { + if (cursor != null && cursor.moveToFirst()) { + do { + // Try to get the thumbnail, if cursor is valid. + String url = cursor.getString(cursor.getColumnIndexOrThrow(Thumbnails.URL)); + final byte[] b = cursor.getBlob(cursor.getColumnIndexOrThrow(Thumbnails.DATA)); + final Bitmap bitmap = (b == null ? null : BitmapUtils.decodeByteArray(b)); + + if (bitmap != null) { + thumbnails.put(url, new Thumbnail(bitmap, true)); + } + } while (cursor.moveToNext()); + } + } finally { + if (cursor != null) { + cursor.close(); + } + } + + // Query the DB for favicons for the urls without thumbnails. + for (String url : mUrls) { + if (!thumbnails.containsKey(url)) { + final Bitmap bitmap = BrowserDB.getFaviconForUrl(cr, url); + if (bitmap != null) { + // Favicons.scaleImage can return several different size favicons, + // but will at least prevent this from being too large. + thumbnails.put(url, new Thumbnail(Favicons.scaleImage(bitmap), false)); + } + } + } + + return thumbnails; + } + + @Override + public void deliverResult(Map thumbnails) { + if (isReset()) { + mThumbnails = null; + return; + } + + mThumbnails = thumbnails; + + if (isStarted()) { + super.deliverResult(thumbnails); + } + } + + @Override + protected void onStartLoading() { + if (mThumbnails != null) { + deliverResult(mThumbnails); + } + + if (takeContentChanged() || mThumbnails == null) { + forceLoad(); + } + } + + @Override + protected void onStopLoading() { + cancelLoad(); + } + + @Override + public void onCanceled(Map thumbnails) { + mThumbnails = null; + } + + @Override + protected void onReset() { + super.onReset(); + + // Ensure the loader is stopped. + onStopLoading(); + + mThumbnails = null; + } + } + + /** + * Loader callbacks for the thumbnails on TopSitesGridView. + */ + private class ThumbnailsLoaderCallbacks implements LoaderCallbacks> { + @Override + public Loader> onCreateLoader(int id, Bundle args) { + return new ThumbnailsLoader(getActivity(), args.getStringArrayList(THUMBNAILS_URLS_KEY)); + } + + @Override + public void onLoadFinished(Loader> loader, Map thumbnails) { + if (mGridAdapter != null) { + mGridAdapter.updateThumbnails(thumbnails); + } + } + + @Override + public void onLoaderReset(Loader> loader) { + if (mGridAdapter != null) { + mGridAdapter.updateThumbnails(null); + } } } } diff --git a/mobile/android/base/home/BookmarkThumbnailView.java b/mobile/android/base/home/TopSitesThumbnailView.java similarity index 86% rename from mobile/android/base/home/BookmarkThumbnailView.java rename to mobile/android/base/home/TopSitesThumbnailView.java index bc8d04dd30e5..7e7982a992a9 100644 --- a/mobile/android/base/home/BookmarkThumbnailView.java +++ b/mobile/android/base/home/TopSitesThumbnailView.java @@ -17,10 +17,10 @@ import android.util.AttributeSet; import android.widget.ImageView; /** - * A height constrained ImageView to show thumbnails of top bookmarks. + * A height constrained ImageView to show thumbnails of top and pinned sites. */ -public class BookmarkThumbnailView extends ImageView { - private static final String LOGTAG = "GeckoBookmarkThumbnailView"; +public class TopSitesThumbnailView extends ImageView { + private static final String LOGTAG = "GeckoTopSitesThumbnailView"; // 27.34% opacity filter for the dominant color. private static final int COLOR_FILTER = 0x46FFFFFF; @@ -41,18 +41,18 @@ public class BookmarkThumbnailView extends ImageView { sBorderPaint.setStyle(Paint.Style.STROKE); } - public BookmarkThumbnailView(Context context) { + public TopSitesThumbnailView(Context context) { this(context, null); // A border will be drawn if needed. setWillNotDraw(false); } - public BookmarkThumbnailView(Context context, AttributeSet attrs) { - this(context, attrs, R.attr.bookmarkThumbnailViewStyle); + public TopSitesThumbnailView(Context context, AttributeSet attrs) { + this(context, attrs, R.attr.topSitesThumbnailViewStyle); } - public BookmarkThumbnailView(Context context, AttributeSet attrs, int defStyle) { + public TopSitesThumbnailView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @@ -95,7 +95,7 @@ public class BookmarkThumbnailView extends ImageView { @Override public void setBackgroundColor(int color) { int colorFilter = color == 0 ? DEFAULT_COLOR : color & COLOR_FILTER; - Drawable drawable = getResources().getDrawable(R.drawable.bookmark_thumbnail_bg); + Drawable drawable = getResources().getDrawable(R.drawable.top_sites_thumbnail_bg); drawable.setColorFilter(colorFilter, Mode.SRC_ATOP); setBackgroundDrawable(drawable); } diff --git a/mobile/android/base/locales/en-US/android_strings.dtd b/mobile/android/base/locales/en-US/android_strings.dtd index 371780c89cec..83a2c757faf2 100644 --- a/mobile/android/base/locales/en-US/android_strings.dtd +++ b/mobile/android/base/locales/en-US/android_strings.dtd @@ -225,9 +225,9 @@ size. --> - - - + + + @@ -289,7 +289,7 @@ size. --> - + diff --git a/mobile/android/base/resources/color/top_bookmark_item_title.xml b/mobile/android/base/resources/color/top_sites_grid_item_title.xml similarity index 100% rename from mobile/android/base/resources/color/top_bookmark_item_title.xml rename to mobile/android/base/resources/color/top_sites_grid_item_title.xml diff --git a/mobile/android/base/resources/drawable-hdpi/top_bookmark_add.png b/mobile/android/base/resources/drawable-hdpi/top_site_add.png similarity index 100% rename from mobile/android/base/resources/drawable-hdpi/top_bookmark_add.png rename to mobile/android/base/resources/drawable-hdpi/top_site_add.png diff --git a/mobile/android/base/resources/drawable-mdpi/top_bookmark_add.png b/mobile/android/base/resources/drawable-mdpi/top_site_add.png similarity index 100% rename from mobile/android/base/resources/drawable-mdpi/top_bookmark_add.png rename to mobile/android/base/resources/drawable-mdpi/top_site_add.png diff --git a/mobile/android/base/resources/drawable-xhdpi/top_bookmark_add.png b/mobile/android/base/resources/drawable-xhdpi/top_site_add.png similarity index 100% rename from mobile/android/base/resources/drawable-xhdpi/top_bookmark_add.png rename to mobile/android/base/resources/drawable-xhdpi/top_site_add.png diff --git a/mobile/android/base/resources/drawable/bookmark_thumbnail_bg.xml b/mobile/android/base/resources/drawable/top_sites_thumbnail_bg.xml similarity index 100% rename from mobile/android/base/resources/drawable/bookmark_thumbnail_bg.xml rename to mobile/android/base/resources/drawable/top_sites_thumbnail_bg.xml diff --git a/mobile/android/base/resources/layout/pin_bookmark_dialog.xml b/mobile/android/base/resources/layout/pin_site_dialog.xml similarity index 96% rename from mobile/android/base/resources/layout/pin_bookmark_dialog.xml rename to mobile/android/base/resources/layout/pin_site_dialog.xml index 6d58a4edeffe..080be86851ba 100644 --- a/mobile/android/base/resources/layout/pin_bookmark_dialog.xml +++ b/mobile/android/base/resources/layout/pin_site_dialog.xml @@ -19,7 +19,7 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="6dip" - android:hint="@string/pin_bookmark_dialog_hint" + android:hint="@string/pin_site_dialog_hint" android:background="@drawable/url_bar_entry" android:textColor="@color/url_bar_title" android:textColorHint="@color/url_bar_title_hint" diff --git a/mobile/android/base/resources/layout/top_bookmark_item_view.xml b/mobile/android/base/resources/layout/top_sites_grid_item_view.xml similarity index 88% rename from mobile/android/base/resources/layout/top_bookmark_item_view.xml rename to mobile/android/base/resources/layout/top_sites_grid_item_view.xml index 50bec658d5c2..ecaa286eb7b3 100644 --- a/mobile/android/base/resources/layout/top_bookmark_item_view.xml +++ b/mobile/android/base/resources/layout/top_sites_grid_item_view.xml @@ -6,14 +6,14 @@ - - - - + - + - + diff --git a/mobile/android/base/resources/values-large-land-v11/styles.xml b/mobile/android/base/resources/values-large-land-v11/styles.xml index 8533bb732ee8..0f773a38c40a 100644 --- a/mobile/android/base/resources/values-large-land-v11/styles.xml +++ b/mobile/android/base/resources/values-large-land-v11/styles.xml @@ -26,7 +26,7 @@ outsideOverlay - - diff --git a/mobile/android/base/resources/values-xlarge-land-v11/styles.xml b/mobile/android/base/resources/values-xlarge-land-v11/styles.xml index 555e632c2600..445f79120ad1 100644 --- a/mobile/android/base/resources/values-xlarge-land-v11/styles.xml +++ b/mobile/android/base/resources/values-xlarge-land-v11/styles.xml @@ -5,7 +5,7 @@ - - - - - diff --git a/mobile/android/base/strings.xml.in b/mobile/android/base/strings.xml.in index 0428a260fccf..bc05ef389ee9 100644 --- a/mobile/android/base/strings.xml.in +++ b/mobile/android/base/strings.xml.in @@ -222,9 +222,9 @@ &contextmenu_edit_bookmark; &contextmenu_subscribe; &contextmenu_site_settings; - &contextmenu_top_bookmarks_edit; - &contextmenu_top_bookmarks_pin; - &contextmenu_top_bookmarks_unpin; + &contextmenu_top_sites_edit; + &contextmenu_top_sites_pin; + &contextmenu_top_sites_unpin; &pref_titlebar_mode; &pref_titlebar_mode_title; @@ -264,7 +264,7 @@ &home_reading_list_empty; &home_reading_list_hint; &home_reading_list_hint_accessible; - &pin_bookmark_dialog_hint; + &pin_site_dialog_hint; &filepicker_title; &filepicker_audio_title;