Search in sources :

Example 1 with GalleryInfo

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

the class WhatsHotParser method parse.

@SuppressWarnings("ConstantConditions")
public static List<GalleryInfo> parse(String body) throws ParseException {
    try {
        List<GalleryInfo> galleryInfoList = new ArrayList<>(15);
        Document d = Jsoup.parse(body);
        Element pp = d.getElementById("pp");
        Elements id1List = pp.getElementsByClass("id1");
        for (int i = 0, n = id1List.size(); i < n; i++) {
            GalleryInfo galleryInfo = new GalleryInfo();
            Element id1 = id1List.get(i);
            Element id3 = JsoupUtils.getElementByClass(id1, "id3");
            Element temp = JsoupUtils.getElementByTag(id3, "a");
            String url = temp.attr("href");
            GalleryDetailUrlParser.Result result = GalleryDetailUrlParser.parse(url);
            galleryInfo.gid = result.gid;
            galleryInfo.token = result.token;
            temp = JsoupUtils.getElementByTag(temp, "img");
            galleryInfo.thumb = EhUtils.handleThumbUrlResolution(temp.attr("src"));
            galleryInfo.title = temp.attr("title");
            galleryInfo.generateSLang();
            galleryInfoList.add(galleryInfo);
        }
        return galleryInfoList;
    } catch (Exception e) {
        throw new ParseException("Parse whats hot error", body);
    }
}
Also used : Element(org.jsoup.nodes.Element) GalleryInfo(com.hippo.ehviewer.client.data.GalleryInfo) ArrayList(java.util.ArrayList) ParseException(com.hippo.ehviewer.client.exception.ParseException) Document(org.jsoup.nodes.Document) Elements(org.jsoup.select.Elements) ParseException(com.hippo.ehviewer.client.exception.ParseException)

Example 2 with GalleryInfo

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

the class FavoritesScene method onClickSecondaryFab.

@Override
@Implemented(FabLayout.OnClickFabListener.class)
public void onClickSecondaryFab(FabLayout view, FloatingActionButton fab, int position) {
    Context context = getContext2();
    if (null == context || null == mRecyclerView || null == mHelper) {
        return;
    }
    if (!mRecyclerView.isInCustomChoice()) {
        switch(position) {
            case // Go to
            0:
                if (mHelper.canGoTo()) {
                    showGoToDialog();
                }
                break;
            case // Refresh
            1:
                mHelper.refresh();
                break;
        }
        view.setExpanded(false);
        return;
    }
    mModifyGiList.clear();
    SparseBooleanArray stateArray = mRecyclerView.getCheckedItemPositions();
    for (int i = 0, n = stateArray.size(); i < n; i++) {
        if (stateArray.valueAt(i)) {
            GalleryInfo gi = mHelper.getDataAtEx(stateArray.keyAt(i));
            if (gi != null) {
                mModifyGiList.add(gi);
            }
        }
    }
    switch(position) {
        case 2:
            {
                // Download
                Activity activity = getActivity2();
                if (activity != null) {
                    CommonOperations.startDownload(getActivity2(), mModifyGiList, false);
                }
                mModifyGiList.clear();
                if (mRecyclerView != null && mRecyclerView.isInCustomChoice()) {
                    mRecyclerView.outOfCustomChoiceMode();
                }
                break;
            }
        case 3:
            {
                // Delete
                DeleteDialogHelper helper = new DeleteDialogHelper();
                new AlertDialog.Builder(context).setTitle(R.string.delete_favorites_dialog_title).setMessage(getString(R.string.delete_favorites_dialog_message, mModifyGiList.size())).setPositiveButton(android.R.string.ok, helper).setOnCancelListener(helper).show();
                break;
            }
        case 4:
            {
                // Move
                MoveDialogHelper helper = new MoveDialogHelper();
                // First is local favorite, the other 10 is cloud favorite
                String[] array = new String[11];
                array[0] = getString(R.string.local_favorites);
                System.arraycopy(Settings.getFavCat(), 0, array, 1, 10);
                new AlertDialog.Builder(context).setTitle(R.string.move_favorites_dialog_title).setItems(array, helper).setOnCancelListener(helper).show();
                break;
            }
    }
}
Also used : Context(android.content.Context) AlertDialog(androidx.appcompat.app.AlertDialog) EditTextDialogBuilder(com.hippo.app.EditTextDialogBuilder) SpannableStringBuilder(android.text.SpannableStringBuilder) FavListUrlBuilder(com.hippo.ehviewer.client.data.FavListUrlBuilder) SparseBooleanArray(android.util.SparseBooleanArray) GalleryInfo(com.hippo.ehviewer.client.data.GalleryInfo) MainActivity(com.hippo.ehviewer.ui.MainActivity) Activity(android.app.Activity) SuppressLint(android.annotation.SuppressLint) Point(android.graphics.Point) Implemented(com.hippo.annotation.Implemented)

Example 3 with GalleryInfo

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

the class GalleryAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(GalleryHolder holder, int position) {
    GalleryInfo gi = getDataAt(position);
    if (null == gi) {
        return;
    }
    switch(mType) {
        default:
        case TYPE_LIST:
            {
                holder.thumb.load(EhCacheKeyFactory.getThumbKey(gi.gid), gi.thumb);
                holder.title.setText(EhUtils.getSuitableTitle(gi));
                holder.uploader.setText(gi.uploader);
                holder.rating.setRating(gi.rating);
                TextView category = holder.category;
                String newCategoryText = EhUtils.getCategory(gi.category);
                if (!newCategoryText.equals(category.getText().toString())) {
                    category.setText(newCategoryText);
                    category.setBackgroundColor(EhUtils.getCategoryColor(gi.category));
                }
                holder.posted.setText(gi.posted);
                if (gi.pages == 0 || !Settings.getShowGalleryPages()) {
                    holder.pages.setText(null);
                    holder.pages.setVisibility(View.GONE);
                } else {
                    holder.pages.setText(Integer.toString(gi.pages) + "P");
                    holder.pages.setVisibility(View.VISIBLE);
                }
                if (TextUtils.isEmpty(gi.simpleLanguage)) {
                    holder.simpleLanguage.setText(null);
                    holder.simpleLanguage.setVisibility(View.GONE);
                } else {
                    holder.simpleLanguage.setText(gi.simpleLanguage);
                    holder.simpleLanguage.setVisibility(View.VISIBLE);
                }
                holder.favourited.setVisibility((mShowFavourited && gi.favoriteSlot >= -1 && gi.favoriteSlot <= 10) ? View.VISIBLE : View.GONE);
                holder.downloaded.setVisibility(mDownloadManager.containDownloadInfo(gi.gid) ? View.VISIBLE : View.GONE);
                break;
            }
        case TYPE_GRID:
            {
                ((TileThumb) holder.thumb).setThumbSize(gi.thumbWidth, gi.thumbHeight);
                holder.thumb.load(EhCacheKeyFactory.getThumbKey(gi.gid), gi.thumb);
                View category = holder.category;
                Drawable drawable = category.getBackground();
                int color = EhUtils.getCategoryColor(gi.category);
                if (!(drawable instanceof TriangleDrawable)) {
                    drawable = new TriangleDrawable(color);
                    category.setBackgroundDrawable(drawable);
                } else {
                    ((TriangleDrawable) drawable).setColor(color);
                }
                holder.simpleLanguage.setText(gi.simpleLanguage);
                break;
            }
    }
    // Update transition name
    ViewCompat.setTransitionName(holder.thumb, TransitionNameFactory.getThumbTransitionName(gi.gid));
}
Also used : GalleryInfo(com.hippo.ehviewer.client.data.GalleryInfo) Drawable(android.graphics.drawable.Drawable) TriangleDrawable(com.hippo.drawable.TriangleDrawable) TextView(android.widget.TextView) TriangleDrawable(com.hippo.drawable.TriangleDrawable) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView)

Example 4 with GalleryInfo

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

the class GalleryDetailScene method onClick.

@Override
public void onClick(View v) {
    Context context = getContext2();
    MainActivity activity = getActivity2();
    if (null == context || null == activity) {
        return;
    }
    if (mTip == v) {
        if (request()) {
            adjustViewVisibility(STATE_REFRESH, true);
        }
    } else if (mOtherActions == v) {
        ensurePopMenu();
        if (mPopupMenu != null) {
            mPopupMenu.show();
        }
    } else if (mUploader == v) {
        String uploader = getUploader();
        if (TextUtils.isEmpty(uploader)) {
            return;
        }
        ListUrlBuilder lub = new ListUrlBuilder();
        lub.setMode(ListUrlBuilder.MODE_UPLOADER);
        lub.setKeyword(uploader);
        GalleryListScene.startScene(this, lub);
    } else if (mCategory == v) {
        int category = getCategory();
        if (category == -1) {
            return;
        }
        ListUrlBuilder lub = new ListUrlBuilder();
        lub.setCategory(category);
        GalleryListScene.startScene(this, lub);
    } else if (mDownload == v) {
        GalleryInfo galleryInfo = getGalleryInfo();
        if (galleryInfo != null) {
            if (EhApplication.getDownloadManager(context).getDownloadState(galleryInfo.gid) == DownloadInfo.STATE_INVALID) {
                CommonOperations.startDownload(activity, galleryInfo, false);
            } else {
                new AlertDialog.Builder(context).setTitle(R.string.download_remove_dialog_title).setMessage(getString(R.string.download_remove_dialog_message, galleryInfo.title)).setPositiveButton(android.R.string.ok, (dialog1, which1) -> EhApplication.getDownloadManager(context).deleteDownload(galleryInfo.gid)).show();
            }
        }
    } else if (mRead == v) {
        GalleryInfo galleryInfo = null;
        if (mGalleryInfo != null) {
            galleryInfo = mGalleryInfo;
        } else if (mGalleryDetail != null) {
            galleryInfo = mGalleryDetail;
        }
        if (galleryInfo != null) {
            Intent intent = new Intent(activity, GalleryActivity.class);
            intent.setAction(GalleryActivity.ACTION_EH);
            intent.putExtra(GalleryActivity.KEY_GALLERY_INFO, galleryInfo);
            startActivity(intent);
        }
    } else if (mInfo == v) {
        Bundle args = new Bundle();
        args.putParcelable(GalleryInfoScene.KEY_GALLERY_DETAIL, mGalleryDetail);
        startScene(new Announcer(GalleryInfoScene.class).setArgs(args));
    } else if (mHeartGroup == v) {
        if (mGalleryDetail != null && !mModifingFavorites) {
            boolean remove = false;
            if (EhDB.containLocalFavorites(mGalleryDetail.gid) || mGalleryDetail.isFavorited) {
                mModifingFavorites = true;
                CommonOperations.removeFromFavorites(activity, mGalleryDetail, new ModifyFavoritesListener(context, activity.getStageId(), getTag(), true));
                remove = true;
            }
            if (!remove) {
                mModifingFavorites = true;
                CommonOperations.addToFavorites(activity, mGalleryDetail, new ModifyFavoritesListener(context, activity.getStageId(), getTag(), false));
            }
            // Update UI
            updateFavoriteDrawable();
        }
    } else if (mShare == v) {
        String url = getGalleryDetailUrl(false);
        if (url != null) {
            AppHelper.share(activity, url);
        }
    } else if (mTorrent == v) {
        if (mGalleryDetail != null) {
            TorrentListDialogHelper helper = new TorrentListDialogHelper();
            Dialog dialog = new AlertDialog.Builder(context).setTitle(R.string.torrents).setView(R.layout.dialog_torrent_list).setOnDismissListener(helper).show();
            helper.setDialog(dialog, mGalleryDetail.torrentUrl);
        }
    } else if (mArchive == v) {
        if (mGalleryDetail == null) {
            return;
        }
        if (mGalleryDetail.apiUid < 0) {
            showTip(R.string.sign_in_first, LENGTH_LONG);
            return;
        }
        ArchiveListDialogHelper helper = new ArchiveListDialogHelper();
        Dialog dialog = new AlertDialog.Builder(context).setTitle(R.string.dialog_archive_title).setView(R.layout.dialog_archive_list).setOnDismissListener(helper).show();
        helper.setDialog(dialog, mGalleryDetail.archiveUrl);
    } else if (mRate == v) {
        if (mGalleryDetail == null) {
            return;
        }
        if (mGalleryDetail.apiUid < 0) {
            showTip(R.string.sign_in_first, LENGTH_LONG);
            return;
        }
        RateDialogHelper helper = new RateDialogHelper();
        Dialog dialog = new AlertDialog.Builder(context).setTitle(R.string.rate).setView(R.layout.dialog_rate).setNegativeButton(android.R.string.cancel, null).setPositiveButton(android.R.string.ok, helper).show();
        helper.setDialog(dialog, mGalleryDetail.rating);
    } else if (mSimilar == v) {
        showSimilarGalleryList();
    } else if (mSearchCover == v) {
        showCoverGalleryList();
    } else if (mComments == v) {
        if (mGalleryDetail == null) {
            return;
        }
        Bundle args = new Bundle();
        args.putLong(GalleryCommentsScene.KEY_API_UID, mGalleryDetail.apiUid);
        args.putString(GalleryCommentsScene.KEY_API_KEY, mGalleryDetail.apiKey);
        args.putLong(GalleryCommentsScene.KEY_GID, mGalleryDetail.gid);
        args.putString(GalleryCommentsScene.KEY_TOKEN, mGalleryDetail.token);
        args.putParcelable(GalleryCommentsScene.KEY_COMMENT_LIST, mGalleryDetail.comments);
        startScene(new Announcer(GalleryCommentsScene.class).setArgs(args).setRequestCode(this, REQUEST_CODE_COMMENT_GALLERY));
    } else if (mPreviews == v) {
        if (null != mGalleryDetail) {
            Bundle args = new Bundle();
            args.putParcelable(GalleryPreviewsScene.KEY_GALLERY_INFO, mGalleryDetail);
            startScene(new Announcer(GalleryPreviewsScene.class).setArgs(args));
        }
    } else {
        Object o = v.getTag(R.id.tag);
        if (o instanceof String) {
            String tag = (String) o;
            ListUrlBuilder lub = new ListUrlBuilder();
            lub.setMode(ListUrlBuilder.MODE_TAG);
            lub.setKeyword(tag);
            GalleryListScene.startScene(this, lub);
            return;
        }
        GalleryInfo galleryInfo = getGalleryInfo();
        o = v.getTag(R.id.index);
        if (null != galleryInfo && o instanceof Integer) {
            int index = (Integer) o;
            Intent intent = new Intent(context, GalleryActivity.class);
            intent.setAction(GalleryActivity.ACTION_EH);
            intent.putExtra(GalleryActivity.KEY_GALLERY_INFO, galleryInfo);
            intent.putExtra(GalleryActivity.KEY_PAGE, index);
            startActivity(intent);
            return;
        }
    }
}
Also used : Context(android.content.Context) Bundle(android.os.Bundle) NonNull(androidx.annotation.NonNull) PreviewSet(com.hippo.ehviewer.client.data.PreviewSet) Uri(android.net.Uri) ImageView(android.widget.ImageView) Drawable(android.graphics.drawable.Drawable) Fragment(androidx.fragment.app.Fragment) ViewCompat(androidx.core.view.ViewCompat) NoHAtHClientException(com.hippo.ehviewer.client.exception.NoHAtHClientException) RateGalleryParser(com.hippo.ehviewer.client.parser.RateGalleryParser) Ripple(com.hippo.ripple.Ripple) LoadImageView(com.hippo.widget.LoadImageView) Nullable(androidx.annotation.Nullable) GalleryInfo(com.hippo.ehviewer.client.data.GalleryInfo) DrawableManager(com.hippo.util.DrawableManager) ViewParent(android.view.ViewParent) GalleryComment(com.hippo.ehviewer.client.data.GalleryComment) Environment(android.os.Environment) Dialog(android.app.Dialog) IOUtils(com.hippo.yorozuya.IOUtils) ViewTransition(com.hippo.view.ViewTransition) RatingBar(android.widget.RatingBar) ViewUtils(com.hippo.yorozuya.ViewUtils) TransitionInflater(androidx.transition.TransitionInflater) GalleryCommentList(com.hippo.ehviewer.client.data.GalleryCommentList) FileOutputStream(java.io.FileOutputStream) TextUtils(android.text.TextUtils) EhUtils(com.hippo.ehviewer.client.EhUtils) CommonOperations(com.hippo.ehviewer.ui.CommonOperations) File(java.io.File) Filter(com.hippo.ehviewer.dao.Filter) Gravity(android.view.Gravity) ArrayAdapter(android.widget.ArrayAdapter) Settings(com.hippo.ehviewer.Settings) IntIdGenerator(com.hippo.yorozuya.IntIdGenerator) EhUrl(com.hippo.ehviewer.client.EhUrl) Announcer(com.hippo.scene.Announcer) GalleryRatingBar(com.hippo.ehviewer.widget.GalleryRatingBar) ExceptionUtils(com.hippo.util.ExceptionUtils) SimpleHandler(com.hippo.yorozuya.SimpleHandler) RoundSideRectDrawable(com.hippo.drawable.RoundSideRectDrawable) ViewAnimationUtils(com.hippo.reveal.ViewAnimationUtils) LinearLayout(android.widget.LinearLayout) GalleryActivity(com.hippo.ehviewer.ui.GalleryActivity) DrawerLayout(com.hippo.drawerlayout.DrawerLayout) ProgressView(com.hippo.widget.ProgressView) View(android.view.View) AdapterView(android.widget.AdapterView) AssertUtils(com.hippo.yorozuya.AssertUtils) AutoWrapLayout(com.hippo.widget.AutoWrapLayout) DownloadInfo(com.hippo.ehviewer.dao.DownloadInfo) FileUtils(com.hippo.yorozuya.FileUtils) UrlOpener(com.hippo.ehviewer.UrlOpener) FragmentTransaction(androidx.fragment.app.FragmentTransaction) ViewGroup(android.view.ViewGroup) FileNotFoundException(java.io.FileNotFoundException) AppConfig(com.hippo.ehviewer.AppConfig) DownloadManager(android.app.DownloadManager) List(java.util.List) TextView(android.widget.TextView) BeerBelly(com.hippo.beerbelly.BeerBelly) EhClient(com.hippo.ehviewer.client.EhClient) ListView(android.widget.ListView) EhApplication(com.hippo.ehviewer.EhApplication) HttpUrl(okhttp3.HttpUrl) ObservedTextView(com.hippo.widget.ObservedTextView) SimpleGridAutoSpanLayout(com.hippo.widget.SimpleGridAutoSpanLayout) EhRequest(com.hippo.ehviewer.client.EhRequest) Context(android.content.Context) AlertDialog(androidx.appcompat.app.AlertDialog) TransitionHelper(com.hippo.scene.TransitionHelper) Pair(android.util.Pair) Intent(android.content.Intent) IntDef(androidx.annotation.IntDef) Html(com.hippo.text.Html) MenuItem(android.view.MenuItem) MainActivity(com.hippo.ehviewer.ui.MainActivity) Retention(java.lang.annotation.Retention) EhTagDatabase(com.hippo.ehviewer.client.EhTagDatabase) SceneFragment(com.hippo.scene.SceneFragment) SuppressLint(android.annotation.SuppressLint) MotionEvent(android.view.MotionEvent) EhFilter(com.hippo.ehviewer.client.EhFilter) DialogInterface(android.content.DialogInterface) OutputStream(java.io.OutputStream) WholeLifeCircle(com.hippo.ehviewer.ui.annotation.WholeLifeCircle) LayoutInflater(android.view.LayoutInflater) ReadableTime(com.hippo.util.ReadableTime) EhDB(com.hippo.ehviewer.EhDB) GalleryDetail(com.hippo.ehviewer.client.data.GalleryDetail) AppHelper(com.hippo.util.AppHelper) R(com.hippo.ehviewer.R) EhCacheKeyFactory(com.hippo.ehviewer.client.EhCacheKeyFactory) PopupMenu(androidx.appcompat.widget.PopupMenu) ListUrlBuilder(com.hippo.ehviewer.client.data.ListUrlBuilder) URLImageGetter(com.hippo.text.URLImageGetter) GalleryTagGroup(com.hippo.ehviewer.client.data.GalleryTagGroup) AttrResources(com.hippo.android.resource.AttrResources) Activity(android.app.Activity) Resources(android.content.res.Resources) RetentionPolicy(java.lang.annotation.RetentionPolicy) AlertDialog(androidx.appcompat.app.AlertDialog) Bundle(android.os.Bundle) ListUrlBuilder(com.hippo.ehviewer.client.data.ListUrlBuilder) GalleryInfo(com.hippo.ehviewer.client.data.GalleryInfo) Intent(android.content.Intent) MainActivity(com.hippo.ehviewer.ui.MainActivity) GalleryActivity(com.hippo.ehviewer.ui.GalleryActivity) ListUrlBuilder(com.hippo.ehviewer.client.data.ListUrlBuilder) Announcer(com.hippo.scene.Announcer) Dialog(android.app.Dialog) AlertDialog(androidx.appcompat.app.AlertDialog)

Example 5 with GalleryInfo

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

the class CommonOperations method startDownload.

// TODO Add context if activity and context are different style
public static void startDownload(final MainActivity activity, final List<GalleryInfo> galleryInfos, boolean forceDefault) {
    final DownloadManager dm = EhApplication.getDownloadManager(activity);
    LongList toStart = new LongList();
    List<GalleryInfo> toAdd = new ArrayList<>();
    for (GalleryInfo gi : galleryInfos) {
        if (dm.containDownloadInfo(gi.gid)) {
            toStart.add(gi.gid);
        } else {
            toAdd.add(gi);
        }
    }
    if (!toStart.isEmpty()) {
        Intent intent = new Intent(activity, DownloadService.class);
        intent.setAction(DownloadService.ACTION_START_RANGE);
        intent.putExtra(DownloadService.KEY_GID_LIST, toStart);
        activity.startService(intent);
    }
    if (toAdd.isEmpty()) {
        activity.showTip(R.string.added_to_download_list, BaseScene.LENGTH_SHORT);
        return;
    }
    boolean justStart = forceDefault;
    String label = null;
    // Get default download label
    if (!justStart && Settings.getHasDefaultDownloadLabel()) {
        label = Settings.getDefaultDownloadLabel();
        justStart = label == null || dm.containLabel(label);
    }
    // If there is no other label, just use null label
    if (!justStart && 0 == dm.getLabelList().size()) {
        justStart = true;
        label = null;
    }
    if (justStart) {
        // Got default label
        for (GalleryInfo gi : toAdd) {
            Intent intent = new Intent(activity, DownloadService.class);
            intent.setAction(DownloadService.ACTION_START);
            intent.putExtra(DownloadService.KEY_LABEL, label);
            intent.putExtra(DownloadService.KEY_GALLERY_INFO, gi);
            activity.startService(intent);
        }
        // Notify
        activity.showTip(R.string.added_to_download_list, BaseScene.LENGTH_SHORT);
    } else {
        // Let use chose label
        List<DownloadLabel> list = dm.getLabelList();
        final String[] items = new String[list.size() + 1];
        items[0] = activity.getString(R.string.default_download_label_name);
        for (int i = 0, n = list.size(); i < n; i++) {
            items[i + 1] = list.get(i).getLabel();
        }
        new ListCheckBoxDialogBuilder(activity, items, new ListCheckBoxDialogBuilder.OnItemClickListener() {

            @Override
            public void onItemClick(ListCheckBoxDialogBuilder builder, AlertDialog dialog, int position) {
                String label;
                if (position == 0) {
                    label = null;
                } else {
                    label = items[position];
                    if (!dm.containLabel(label)) {
                        label = null;
                    }
                }
                // Start download
                for (GalleryInfo gi : toAdd) {
                    Intent intent = new Intent(activity, DownloadService.class);
                    intent.setAction(DownloadService.ACTION_START);
                    intent.putExtra(DownloadService.KEY_LABEL, label);
                    intent.putExtra(DownloadService.KEY_GALLERY_INFO, gi);
                    activity.startService(intent);
                }
                // Save settings
                if (builder.isChecked()) {
                    Settings.putHasDefaultDownloadLabel(true);
                    Settings.putDefaultDownloadLabel(label);
                } else {
                    Settings.putHasDefaultDownloadLabel(false);
                }
                // Notify
                activity.showTip(R.string.added_to_download_list, BaseScene.LENGTH_SHORT);
            }
        }, activity.getString(R.string.remember_download_label), false).setTitle(R.string.download).show();
    }
}
Also used : AlertDialog(androidx.appcompat.app.AlertDialog) GalleryInfo(com.hippo.ehviewer.client.data.GalleryInfo) ArrayList(java.util.ArrayList) Intent(android.content.Intent) LongList(com.hippo.yorozuya.collect.LongList) DownloadManager(com.hippo.ehviewer.download.DownloadManager) DownloadService(com.hippo.ehviewer.download.DownloadService) ListCheckBoxDialogBuilder(com.hippo.app.ListCheckBoxDialogBuilder) DownloadLabel(com.hippo.ehviewer.dao.DownloadLabel)

Aggregations

GalleryInfo (com.hippo.ehviewer.client.data.GalleryInfo)25 ArrayList (java.util.ArrayList)7 AlertDialog (androidx.appcompat.app.AlertDialog)6 SuppressLint (android.annotation.SuppressLint)5 Bundle (android.os.Bundle)5 View (android.view.View)5 TextView (android.widget.TextView)5 Activity (android.app.Activity)4 Context (android.content.Context)4 DialogInterface (android.content.DialogInterface)4 Intent (android.content.Intent)4 RecyclerView (androidx.recyclerview.widget.RecyclerView)4 DownloadInfo (com.hippo.ehviewer.dao.DownloadInfo)4 MainActivity (com.hippo.ehviewer.ui.MainActivity)4 Point (android.graphics.Point)3 Drawable (android.graphics.drawable.Drawable)3 AdapterView (android.widget.AdapterView)3 ListView (android.widget.ListView)3 EhApplication (com.hippo.ehviewer.EhApplication)3 EhDB (com.hippo.ehviewer.EhDB)3