mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1299224 - pass OnUrlOpenListener into StreamRecyclerAdapter r=sebastian
This has the side effect of enabling click support for topsites. MozReview-Commit-ID: DW7WX4QDO6n --HG-- extra : histedit_source : 841fa42364397965d237c36540afc20a86bb2922
This commit is contained in:
parent
b635c55c15
commit
f0f7b67705
@ -16,6 +16,7 @@ import android.widget.FrameLayout;
|
||||
|
||||
import org.mozilla.gecko.GeckoProfile;
|
||||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.home.HomePager;
|
||||
import org.mozilla.gecko.home.SimpleCursorLoader;
|
||||
import org.mozilla.gecko.home.activitystream.topsites.TopSitesPagerAdapter;
|
||||
|
||||
@ -39,6 +40,10 @@ public class ActivityStream extends FrameLayout {
|
||||
rv.setHasFixedSize(true);
|
||||
}
|
||||
|
||||
void setOnUrlOpenListener(HomePager.OnUrlOpenListener listener) {
|
||||
adapter.setOnUrlOpenListener(listener);
|
||||
}
|
||||
|
||||
public void load(LoaderManager lm) {
|
||||
CursorLoaderCallbacks callbacks = new CursorLoaderCallbacks();
|
||||
|
||||
|
@ -29,7 +29,10 @@ public class ActivityStreamHomeFragment
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
activityStream = (ActivityStream) inflater.inflate(R.layout.activity_stream, container, false);
|
||||
if (activityStream == null) {
|
||||
activityStream = (ActivityStream) inflater.inflate(R.layout.activity_stream, container, false);
|
||||
activityStream.setOnUrlOpenListener(mUrlOpenListener);
|
||||
}
|
||||
|
||||
return activityStream;
|
||||
}
|
||||
|
@ -22,9 +22,9 @@ public class StreamRecyclerAdapter extends RecyclerView.Adapter<StreamItem> {
|
||||
private Cursor highlightsCursor;
|
||||
private Cursor topSitesCursor;
|
||||
|
||||
private final HomePager.OnUrlOpenListener onUrlOpenListener;
|
||||
private HomePager.OnUrlOpenListener onUrlOpenListener;
|
||||
|
||||
StreamRecyclerAdapter(HomePager.OnUrlOpenListener onUrlOpenListener) {
|
||||
void setOnUrlOpenListener(HomePager.OnUrlOpenListener onUrlOpenListener) {
|
||||
this.onUrlOpenListener = onUrlOpenListener;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user