Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 04aaa83

Browse files
committed
Added method IPhotoView getIPhotoViewImplementation(), closing Baseflow#139
1 parent edc5f84 commit 04aaa83

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

‎library/src/main/java/uk/co/senab/photoview/IPhotoView.java‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,20 +207,20 @@ public interface IPhotoView {
207207
* @param listener - Listener to be registered.
208208
*/
209209
void setOnViewTapListener(PhotoViewAttacher.OnViewTapListener listener);
210-
210+
211211
/**
212212
* Enables rotation via PhotoView internal functions.
213213
*
214214
* @param rotationDegree - Degree to rotate PhotoView to, should be in range 0 to 360
215215
*/
216216
void setRotationTo(float rotationDegree);
217-
217+
218218
/**
219219
* Enables rotation via PhotoView internal functions.
220220
*
221221
* @param rotationDegree - Degree to rotate PhotoView by, should be in range 0 to 360
222222
*/
223-
void setRotationBy(float rotationDegree);
223+
void setRotationBy(float rotationDegree);
224224

225225
/**
226226
* Returns a callback listener to be invoked when the View is tapped with a single tap.
@@ -295,4 +295,12 @@ public interface IPhotoView {
295295
* @param milliseconds duration of zoom interpolation
296296
*/
297297
void setZoomTransitionDuration(int milliseconds);
298+
299+
/**
300+
* Will return instance of IPhotoView (eg. PhotoViewAttacher), can be used to provide better
301+
* integration
302+
*
303+
* @return IPhotoView implementation instance if available, null if not
304+
*/
305+
IPhotoView getIPhotoViewImplementation();
298306
}

‎library/src/main/java/uk/co/senab/photoview/PhotoView.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,11 @@ public void setZoomTransitionDuration(int milliseconds) {
266266
mAttacher.setZoomTransitionDuration(milliseconds);
267267
}
268268

269+
@Override
270+
public IPhotoView getIPhotoViewImplementation() {
271+
return mAttacher;
272+
}
273+
269274
@Override
270275
protected void onDetachedFromWindow() {
271276
mAttacher.cleanup();

‎library/src/main/java/uk/co/senab/photoview/PhotoViewAttacher.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,11 @@ public void setZoomTransitionDuration(int milliseconds) {
788788
this.ZOOM_DURATION = milliseconds;
789789
}
790790

791+
@Override
792+
public IPhotoView getIPhotoViewImplementation() {
793+
return this;
794+
}
795+
791796
/**
792797
* Helper method that 'unpacks' a Matrix and returns the required value
793798
*

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /