Disable swipe back in google map view
This commit is contained in:
parent
0b0d485093
commit
99bdc317ac
@ -60,6 +60,7 @@ public class LocationActivity extends BaseFragment implements NotificationCenter
|
|||||||
@Override
|
@Override
|
||||||
public boolean onFragmentCreate() {
|
public boolean onFragmentCreate() {
|
||||||
super.onFragmentCreate();
|
super.onFragmentCreate();
|
||||||
|
swipeBackEnabled = false;
|
||||||
NotificationCenter.getInstance().addObserver(this, MessagesController.closeChats);
|
NotificationCenter.getInstance().addObserver(this, MessagesController.closeChats);
|
||||||
if (messageObject != null) {
|
if (messageObject != null) {
|
||||||
NotificationCenter.getInstance().addObserver(this, MessagesController.updateInterfaces);
|
NotificationCenter.getInstance().addObserver(this, MessagesController.updateInterfaces);
|
||||||
|
@ -265,6 +265,10 @@ public class ActionBarActivity extends Activity {
|
|||||||
public boolean onTouchEvent(MotionEvent ev) {
|
public boolean onTouchEvent(MotionEvent ev) {
|
||||||
if(android.os.Build.VERSION.SDK_INT >= 11 && !checkTransitionAnimation() && !inActionMode && fragmentsStack.size() > 1 && !animationInProgress) {
|
if(android.os.Build.VERSION.SDK_INT >= 11 && !checkTransitionAnimation() && !inActionMode && fragmentsStack.size() > 1 && !animationInProgress) {
|
||||||
if (ev != null && ev.getAction() == MotionEvent.ACTION_DOWN && !startedTracking && !maybeStartTracking) {
|
if (ev != null && ev.getAction() == MotionEvent.ACTION_DOWN && !startedTracking && !maybeStartTracking) {
|
||||||
|
BaseFragment currentFragment = fragmentsStack.get(fragmentsStack.size() - 1);
|
||||||
|
if (!currentFragment.swipeBackEnabled) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
startedTrackingPointerId = ev.getPointerId(0);
|
startedTrackingPointerId = ev.getPointerId(0);
|
||||||
maybeStartTracking = true;
|
maybeStartTracking = true;
|
||||||
startedTrackingX = (int) ev.getX();
|
startedTrackingX = (int) ev.getX();
|
||||||
|
@ -28,6 +28,7 @@ public class BaseFragment {
|
|||||||
protected int classGuid = 0;
|
protected int classGuid = 0;
|
||||||
protected Bundle arguments;
|
protected Bundle arguments;
|
||||||
private AlertDialog visibleDialog = null;
|
private AlertDialog visibleDialog = null;
|
||||||
|
protected boolean swipeBackEnabled = true;
|
||||||
|
|
||||||
public BaseFragment() {
|
public BaseFragment() {
|
||||||
classGuid = ConnectionsManager.getInstance().generateClassGuid();
|
classGuid = ConnectionsManager.getInstance().generateClassGuid();
|
||||||
|
Loading…
Reference in New Issue
Block a user