summaryrefslogtreecommitdiffstats
path: root/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPage.java
diff options
context:
space:
mode:
Diffstat (limited to 'mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPage.java')
-rw-r--r--mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPage.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPage.java b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPage.java
new file mode 100644
index 000000000..45fdc0d1a
--- /dev/null
+++ b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesPage.java
@@ -0,0 +1,38 @@
+/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.mozilla.gecko.home.activitystream.topsites;
+
+import android.content.Context;
+import android.support.annotation.Nullable;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.util.AttributeSet;
+import android.view.View;
+
+import org.mozilla.gecko.home.HomePager;
+import org.mozilla.gecko.widget.RecyclerViewClickSupport;
+
+import java.util.EnumSet;
+
+public class TopSitesPage
+ extends RecyclerView {
+ public TopSitesPage(Context context,
+ @Nullable AttributeSet attrs) {
+ super(context, attrs);
+
+ setLayoutManager(new GridLayoutManager(context, 1));
+ }
+
+ public void setTiles(int tiles) {
+ setLayoutManager(new GridLayoutManager(getContext(), tiles));
+ }
+
+ private HomePager.OnUrlOpenListener onUrlOpenListener;
+ private HomePager.OnUrlOpenInBackgroundListener onUrlOpenInBackgroundListener;
+
+ public TopSitesPageAdapter getAdapter() {
+ return (TopSitesPageAdapter) super.getAdapter();
+ }
+}