diff --git a/Clover/app/src/main/java/org/floens/chan/ui/view/NetworkPhotoView.java b/Clover/app/src/main/java/org/floens/chan/ui/view/NetworkPhotoView.java deleted file mode 100644 index 1bf2134c..00000000 --- a/Clover/app/src/main/java/org/floens/chan/ui/view/NetworkPhotoView.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Clover - 4chan browser https://github.com/Floens/Clover/ - * Copyright (C) 2014 Floens - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.floens.chan.ui.view; - -import android.content.Context; -import android.graphics.drawable.Drawable; -import android.widget.Toast; - -import com.android.volley.VolleyError; - -import org.floens.chan.R; -import org.floens.chan.ui.fragment.ImageViewFragment; - -import uk.co.senab.photoview.PhotoViewAttacher; -import uk.co.senab.photoview.PhotoViewAttacher.OnViewTapListener; - -/** - * Extends NetworkImageView. Attaches a PhotoViewAttacher when setBitmap is - * called. Sets the progressBar to false when a bitmap gets set. - */ -public class NetworkPhotoView extends CustomNetworkImageView { - private PhotoViewAttacher attacher; - private OnLongClickListener longClickListener; - private OnViewTapListener viewTapListener; - private ImageViewFragment fragment; - - public NetworkPhotoView(Context context) { - super(context); - } - - public void setImageViewFragment(ImageViewFragment fragment) { - this.fragment = fragment; - } - - public void setOnLongClickListenerToAttacher(OnLongClickListener listener) { - longClickListener = listener; - } - - public void setOnViewTapListenerToAttacher(OnViewTapListener listener) { - viewTapListener = listener; - } - - @Override - public void setImageDrawable(Drawable drawable) { - super.setImageDrawable(drawable); - - attacher = new PhotoViewAttacher(this); - attacher.setMaximumScale(getMaxScale()); - attacher.setOnLongClickListener(longClickListener); - attacher.setOnViewTapListener(viewTapListener); - - fragment.showProgressBar(false); - } - - @Override - public void onErrorResponse(VolleyError error) { - super.onErrorResponse(error); - - // TODO: out of memory. We need a new image viewer for *large* images. Maybe copy the one from the gallery. - System.gc(); - Toast.makeText(getContext(), R.string.image_preview_failed, Toast.LENGTH_LONG).show(); - - fragment.showProgressBar(false); - } - - @Override - protected void onDetachedFromWindow() { - super.onDetachedFromWindow(); - - if (attacher != null) { - attacher.cleanup(); - } - } -}