Backed out changeset 6220841fe652 (bug 1220928)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 30 Mar 2016 14:38:04 +0200
changeset 290890 6c3e6356f8a75eb3b6171d02c67e96b27b43bb14
parent 290889 7709b4037ab17c6101b6f8255e592179fb7b9dd6
child 290891 d27578912ddd678b2a6f428da25924573508d7ba
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1220928
milestone48.0a1
backs out6220841fe652e4711e0a31b4bd0f5f7a358b7a6b
Backed out changeset 6220841fe652 (bug 1220928)
mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryAdapter.java
mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryPanel.java
mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryRecyclerView.java
--- a/mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryAdapter.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryAdapter.java
@@ -15,18 +15,17 @@ import android.view.ViewGroup;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.db.RemoteClient;
 
 import java.util.Collections;
 import java.util.List;
 
 public class CombinedHistoryAdapter extends RecyclerView.Adapter<CombinedHistoryItem> {
     private static final String LOGTAG = "GeckoCombinedHistAdapt";
-
-    public enum ItemType {
+    private enum ItemType {
         CLIENT, HISTORY;
 
         public static ItemType viewTypeToItemType(int viewType) {
             if (viewType >= ItemType.values().length) {
                 Log.e(LOGTAG, "No corresponding ItemType!");
             }
             return ItemType.values()[viewType];
         }
--- a/mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryPanel.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryPanel.java
@@ -40,17 +40,16 @@ public class CombinedHistoryPanel extend
 
     @Override
     public void onViewCreated(View view, Bundle savedInstanceState) {
         super.onViewCreated(view, savedInstanceState);
 
         mRecyclerView = (CombinedHistoryRecyclerView) view.findViewById(R.id.combined_recycler_view);
         mAdapter = new CombinedHistoryAdapter(getContext());
         mRecyclerView.setAdapter(mAdapter);
-        mRecyclerView.setOnHistoryClickedListener(mUrlOpenListener);
         mClearHistoryButton = view.findViewById(R.id.clear_history_button);
         // TODO: link up click handler for clear history button
         // TODO: Handle date headers.
     }
 
     @Override
     public void onActivityCreated(Bundle savedInstanceState) {
         super.onActivityCreated(savedInstanceState);
--- a/mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryRecyclerView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryRecyclerView.java
@@ -5,27 +5,21 @@
 
 package org.mozilla.gecko.home;
 
 import android.content.Context;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.util.AttributeSet;
 import android.view.View;
-import org.mozilla.gecko.Telemetry;
-import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.widget.RecyclerViewClickSupport;
 
-import java.util.EnumSet;
-
 public class CombinedHistoryRecyclerView extends RecyclerView
         implements RecyclerViewClickSupport.OnItemClickListener, RecyclerViewClickSupport.OnItemLongClickListener {
 
-    protected HomePager.OnUrlOpenListener mOnUrlOpenListener;
-
     public CombinedHistoryRecyclerView(Context context) {
         super(context);
         init(context);
     }
 
     public CombinedHistoryRecyclerView(Context context, AttributeSet attributeSet) {
         super(context, attributeSet);
         init(context);
@@ -35,42 +29,19 @@ public class CombinedHistoryRecyclerView
         super(context, attributeSet, defStyle);
         init(context);
     }
 
     private void init(Context context) {
         LinearLayoutManager layoutManager = new LinearLayoutManager(context);
         layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
         setLayoutManager(layoutManager);
-
-        RecyclerViewClickSupport.addTo(this)
-            .setOnItemClickListener(this)
-            .setOnItemLongClickListener(this);
-    }
-
-    public void setOnHistoryClickedListener(HomePager.OnUrlOpenListener listener) {
-        this.mOnUrlOpenListener = listener;
     }
 
     @Override
-    public void onItemClicked(RecyclerView recyclerView, int position, View v) {
-        final int viewType = getAdapter().getItemViewType(position);
-        final CombinedHistoryAdapter.ItemType itemType = CombinedHistoryAdapter.ItemType.viewTypeToItemType(viewType);
-
-        switch(itemType) {
-            case CLIENT:
-                // TODO: open new panel with all the remote children, and hide all the other items
-                return;
-            case HISTORY:
-                if (mOnUrlOpenListener != null) {
-                    final TwoLinePageRow historyItem = (TwoLinePageRow) v;
-                    Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.LIST_ITEM, "history");
-                    mOnUrlOpenListener.onUrlOpen(historyItem.getUrl(), EnumSet.of(HomePager.OnUrlOpenListener.Flags.ALLOW_SWITCH_TO_TAB));
-                }
-        }
-    }
+    public void onItemClicked(RecyclerView recyclerView, int position, View v) {}
 
     @Override
     public boolean onItemLongClicked(RecyclerView recyclerView, int position, View v) {
         // TODO: open context menu if not a date title
         return showContextMenuForChild(this);
     }
 }