Disable swipe back in google map view

This commit is contained in:
DrKLO 2014-06-17 19:10:02 +04:00
parent 0b0d485093
commit 99bdc317ac
3 changed files with 6 additions and 0 deletions

View File

@ -60,6 +60,7 @@ public class LocationActivity extends BaseFragment implements NotificationCenter
@Override
public boolean onFragmentCreate() {
super.onFragmentCreate();
swipeBackEnabled = false;
NotificationCenter.getInstance().addObserver(this, MessagesController.closeChats);
if (messageObject != null) {
NotificationCenter.getInstance().addObserver(this, MessagesController.updateInterfaces);

View File

@ -265,6 +265,10 @@ public class ActionBarActivity extends Activity {
public boolean onTouchEvent(MotionEvent ev) {
if(android.os.Build.VERSION.SDK_INT >= 11 && !checkTransitionAnimation() && !inActionMode && fragmentsStack.size() > 1 && !animationInProgress) {
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);
maybeStartTracking = true;
startedTrackingX = (int) ev.getX();

View File

@ -28,6 +28,7 @@ public class BaseFragment {
protected int classGuid = 0;
protected Bundle arguments;
private AlertDialog visibleDialog = null;
protected boolean swipeBackEnabled = true;
public BaseFragment() {
classGuid = ConnectionsManager.getInstance().generateClassGuid();