Search in sources :

Example 1 with GalleryPreview

use of com.hippo.ehviewer.client.data.GalleryPreview in project EhViewer by seven332.

the class GalleryPreviewsScene method onItemClick.

@Override
public boolean onItemClick(EasyRecyclerView parent, View view, int position, long id) {
    Context context = getContext2();
    if (null != context && null != mHelper && null != mGalleryInfo) {
        GalleryPreview p = mHelper.getDataAt(position);
        Intent intent = new Intent(context, GalleryActivity.class);
        intent.setAction(GalleryActivity.ACTION_EH);
        intent.putExtra(GalleryActivity.KEY_GALLERY_INFO, mGalleryInfo);
        intent.putExtra(GalleryActivity.KEY_PAGE, p.getPosition());
        startActivity(intent);
    }
    return true;
}
Also used : Context(android.content.Context) Intent(android.content.Intent) GalleryPreview(com.hippo.ehviewer.client.data.GalleryPreview)

Example 2 with GalleryPreview

use of com.hippo.ehviewer.client.data.GalleryPreview in project EhViewer by seven332.

the class GalleryPreviewsScene method onGetPreviewSetSuccess.

private void onGetPreviewSetSuccess(Pair<PreviewSet, Integer> result, int taskId) {
    if (null != mHelper && mHelper.isCurrentTask(taskId) && null != mGalleryInfo) {
        PreviewSet previewSet = result.first;
        int size = previewSet.size();
        ArrayList<GalleryPreview> list = new ArrayList<>(size);
        for (int i = 0; i < size; i++) {
            list.add(previewSet.getGalleryPreview(mGalleryInfo.gid, i));
        }
        mHelper.setPages(taskId, result.second);
        mHelper.onGetPageData(taskId, list);
    }
}
Also used : ArrayList(java.util.ArrayList) PreviewSet(com.hippo.ehviewer.client.data.PreviewSet) SuppressLint(android.annotation.SuppressLint) GalleryPreview(com.hippo.ehviewer.client.data.GalleryPreview)

Aggregations

GalleryPreview (com.hippo.ehviewer.client.data.GalleryPreview)2 SuppressLint (android.annotation.SuppressLint)1 Context (android.content.Context)1 Intent (android.content.Intent)1 PreviewSet (com.hippo.ehviewer.client.data.PreviewSet)1 ArrayList (java.util.ArrayList)1