Bug 1417361 - Rename OnCardLongClickListener.onClick -> onLongClick. r=liuche, a=gchang
authorMichael Comella <michael.l.comella@gmail.com>
Tue, 28 Nov 2017 17:29:53 -0800
changeset 445179 f92dde39c94c7849244bcc93b0e6b2bbc31e6679
parent 445178 b3759baf9588dfe9901f82e397832f18bb1cfe54
child 445180 51aeac094956c6cd2e466a57bdc53bb7ab5d71bc
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche, gchang
bugs1417361
milestone58.0
Bug 1417361 - Rename OnCardLongClickListener.onClick -> onLongClick. r=liuche, a=gchang This should make the code slightly simpler to follow. MozReview-Commit-ID: HrAv39eCtzb
mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamRecyclerAdapter.java
mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/TopPanelRow.java
mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesCard.java
--- a/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamRecyclerAdapter.java
+++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamRecyclerAdapter.java
@@ -133,17 +133,17 @@ public class StreamRecyclerAdapter exten
 
     @Override
     public StreamViewHolder onCreateViewHolder(final ViewGroup parent, final int type) {
         final LayoutInflater inflater = LayoutInflater.from(parent.getContext());
 
         if (type == RowItemType.TOP_PANEL.getViewType()) {
             return new TopPanelRow(inflater.inflate(TopPanelRow.LAYOUT_ID, parent, false), onUrlOpenListener, new TopPanelRow.OnCardLongClickListener() {
                 @Override
-                public boolean onClick(final TopSite topSite, final int absolutePosition,
+                public boolean onLongClick(final TopSite topSite, final int absolutePosition,
                         final View tabletContextMenuAnchor, final int faviconWidth, final int faviconHeight) {
                     openContextMenuForTopSite(topSite, absolutePosition, tabletContextMenuAnchor, parent, faviconWidth, faviconHeight);
                     return true;
                 }
             });
         } else if (type == RowItemType.TOP_STORIES_TITLE.getViewType()) {
             return new StreamTitleRow(inflater.inflate(StreamTitleRow.LAYOUT_ID, parent, false), R.string.activity_stream_topstories, R.string.activity_stream_link_more, LINK_MORE_POCKET, onUrlOpenListener);
         } else if (type == RowItemType.TOP_STORIES_ITEM.getViewType() ||
--- a/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/TopPanelRow.java
+++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/stream/TopPanelRow.java
@@ -87,11 +87,11 @@ public class TopPanelRow extends StreamV
 
         // Reset the page position: binding a new Cursor means that topsites reverts to the first page,
         // no event is sent in that case, but we need to know the right page number to send correct
         // page swipe events
         swipeListener.currentPosition = 0;
     }
 
     public interface OnCardLongClickListener {
-        boolean onClick(TopSite topSite, int absolutePosition, View tabletContextMenuAnchor, int faviconWidth, int faviconHeight);
+        boolean onLongClick(TopSite topSite, int absolutePosition, View tabletContextMenuAnchor, int faviconWidth, int faviconHeight);
     }
 }
\ No newline at end of file
--- a/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesCard.java
+++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesCard.java
@@ -47,17 +47,17 @@ import java.util.concurrent.Future;
         faviconView = (FaviconView) card.findViewById(R.id.favicon);
         title = (TextView) card.findViewById(R.id.title);
         pinIconView = (ImageView) card.findViewById(R.id.pin_icon);
 
         card.setOnLongClickListener(new View.OnLongClickListener() {
             @Override
             public boolean onLongClick(View v) {
                 if (onCardLongClickListener != null) {
-                    return onCardLongClickListener.onClick(topSite, absolutePosition, card, faviconView.getWidth(), faviconView.getHeight());
+                    return onCardLongClickListener.onLongClick(topSite, absolutePosition, card, faviconView.getWidth(), faviconView.getHeight());
                 }
                 return false;
             }
         });
 
         ViewUtil.enableTouchRipple(card);
     }