Bug 1312033 - Activity Stream Top Sites: Never add more sites than returned by the cursor. r=ahunt

MozReview-Commit-ID: JONNSrRPNyW

--HG--
extra : rebase_source : 8f4f6adacc6b95d497a98f693783be5dfe6db94b
This commit is contained in:
Sebastian Kaspari 2016-10-25 15:16:40 +02:00
parent 463d8d9ba6
commit 1eefd99be6

View File

@ -6,12 +6,8 @@ package org.mozilla.gecko.home.activitystream.topsites;
import android.content.Context;
import android.database.Cursor;
import android.database.CursorWrapper;
import android.support.annotation.UiThread;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -63,7 +59,7 @@ public class TopSitesPageAdapter extends RecyclerView.Adapter<TopSitesCard> {
return;
}
for (int i = 0; i < tiles; i++) {
for (int i = 0; i < tiles && startIndex + i < cursor.getCount(); i++) {
cursor.moveToPosition(startIndex + i);
// The Combined View only contains pages that have been visited at least once, i.e. any