This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable ViewPager when photo viewer zoomed in
Work around common limitation with GestureImageView when using with ViewPager. Requires some modifications to GestureImageView outlined at jasonpolites/gesture-imageview#30
- Loading branch information
Showing
7 changed files
with
86 additions
and
23 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.bourke.glimmr.common; | ||
|
||
import android.content.Context; | ||
|
||
import android.support.v4.view.ViewPager; | ||
|
||
import android.util.AttributeSet; | ||
|
||
import android.view.MotionEvent; | ||
|
||
/** | ||
* Extend ViewPager to allow the paging to be disabled/mEnabled. | ||
*/ | ||
public class ViewPagerDisable extends ViewPager { | ||
|
||
private boolean mEnabled; | ||
|
||
public ViewPagerDisable(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
mEnabled = true; | ||
} | ||
|
||
@Override | ||
public boolean onTouchEvent(MotionEvent event) { | ||
if (mEnabled) { | ||
return super.onTouchEvent(event); | ||
} | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean onInterceptTouchEvent(MotionEvent event) { | ||
if (mEnabled) { | ||
return super.onInterceptTouchEvent(event); | ||
} | ||
return false; | ||
} | ||
|
||
public void setPagingEnabled(boolean enabled) { | ||
mEnabled = enabled; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters