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;
}
Aggregations