Search in sources :

Example 1 with BeerBelly

use of com.hippo.beerbelly.BeerBelly in project EhViewer by seven332.

the class GalleryDetailScene method showCoverGalleryList.

private void showCoverGalleryList() {
    Context context = getContext2();
    if (null == context) {
        return;
    }
    long gid = getGid();
    if (-1L == gid) {
        return;
    }
    File temp = AppConfig.createTempFile();
    if (null == temp) {
        return;
    }
    BeerBelly beerBelly = EhApplication.getConaco(context).getBeerBelly();
    OutputStream os = null;
    try {
        os = new FileOutputStream(temp);
        if (beerBelly.pullFromDiskCache(EhCacheKeyFactory.getThumbKey(gid), os)) {
            ListUrlBuilder lub = new ListUrlBuilder();
            lub.setMode(ListUrlBuilder.MODE_IMAGE_SEARCH);
            lub.setImagePath(temp.getPath());
            lub.setUseSimilarityScan(true);
            lub.setShowExpunged(true);
            GalleryListScene.startScene(this, lub);
        }
    } catch (FileNotFoundException e) {
    // Ignore
    } finally {
        IOUtils.closeQuietly(os);
    }
}
Also used : Context(android.content.Context) ListUrlBuilder(com.hippo.ehviewer.client.data.ListUrlBuilder) FileOutputStream(java.io.FileOutputStream) OutputStream(java.io.OutputStream) FileOutputStream(java.io.FileOutputStream) FileNotFoundException(java.io.FileNotFoundException) BeerBelly(com.hippo.beerbelly.BeerBelly) File(java.io.File)

Aggregations

Context (android.content.Context)1 BeerBelly (com.hippo.beerbelly.BeerBelly)1 ListUrlBuilder (com.hippo.ehviewer.client.data.ListUrlBuilder)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 FileOutputStream (java.io.FileOutputStream)1 OutputStream (java.io.OutputStream)1