Search in sources :

Example 1 with OnPhotoTapListener

use of uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener in project glimmr by brk3.

the class PhotoViewerFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    if (BuildConfig.DEBUG)
        Log.d(getLogTag(), "onCreateView");
    mLayout = (RelativeLayout) inflater.inflate(R.layout.photoviewer_fragment, container, false);
    mVideoButton = (ImageView) mLayout.findViewById(R.id.play_video_overlay);
    mImageView = (ImageView) mLayout.findViewById(R.id.image);
    mAttacher = new PhotoViewAttacher(mImageView);
    mTextViewTitle = (TextView) mLayout.findViewById(R.id.textViewTitle);
    mTextViewAuthor = (TextView) mLayout.findViewById(R.id.textViewAuthor);
    mProgress = (ProgressBar) mLayout.findViewById(R.id.progress);
    mAttacher.setOnPhotoTapListener(new OnPhotoTapListener() {

        @Override
        public void onPhotoTap(View view, float x, float y) {
            BusProvider.getInstance().post(new PhotoViewerVisibilityChangeEvent(!mActionBar.isShowing(), PhotoViewerFragment.this));
        }
    });
    /* If this fragment is new as part of a set, update it's overlay
         * visibility based on the state of the actionbar */
    setOverlayVisibility(mActionBar.isShowing());
    displayImage();
    return mLayout;
}
Also used : OnPhotoTapListener(uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener) PhotoViewAttacher(uk.co.senab.photoview.PhotoViewAttacher) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Aggregations

View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 PhotoViewAttacher (uk.co.senab.photoview.PhotoViewAttacher)1 OnPhotoTapListener (uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener)1