use of me.ccrama.redditslide.Views.PreCachingLayoutManagerComments in project Slide by ccrama.
the class CommentPage method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle bundle = this.getArguments();
subreddit = bundle.getString("subreddit", "");
fullname = bundle.getString("id", "");
page = bundle.getInt("page", 0);
single = bundle.getBoolean("single", false);
context = bundle.getString("context", "");
contextNumber = bundle.getInt("contextNumber", 5);
np = bundle.getBoolean("np", false);
archived = bundle.getBoolean("archived", false);
locked = bundle.getBoolean("locked", false);
contest = bundle.getBoolean("contest", false);
loadMore = (!context.isEmpty() && !context.equals(Reddit.EMPTY_STRING));
if (!single)
loadMore = false;
int subredditStyle = new ColorPreferences(getActivity()).getThemeSubreddit(subreddit);
contextThemeWrapper = new ContextThemeWrapper(getActivity(), subredditStyle);
mLayoutManager = new PreCachingLayoutManagerComments(getActivity());
}
use of me.ccrama.redditslide.Views.PreCachingLayoutManagerComments in project Slide by ccrama.
the class CommentPage method doResult.
public void doResult(Intent data) {
if (data.hasExtra("fullname")) {
String fullname = data.getExtras().getString("fullname");
adapter.currentSelectedItem = fullname;
adapter.reset(getContext(), comments, rv, comments.submission, true);
adapter.notifyDataSetChanged();
int i = 2;
for (CommentObject n : comments.comments) {
if (n instanceof CommentItem && n.comment.getComment().getFullName().contains(fullname)) {
((PreCachingLayoutManagerComments) rv.getLayoutManager()).scrollToPositionWithOffset(i, toolbar.getHeight());
break;
}
i++;
}
}
}
Aggregations