Disable navigation drawer in gallery view when system bars are not visible

This commit is contained in:
David A. Velasco 2015-06-03 11:05:10 +02:00
parent 05e2bf041d
commit 6779b77f3b

View file

@ -8,7 +8,7 @@
* it under the terms of the GNU General Public License version 2, * it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation. * as published by the Free Software Foundation.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hd that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -32,6 +32,7 @@ import android.os.Handler;
import android.os.IBinder; import android.os.IBinder;
import android.os.Message; import android.os.Message;
import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBar;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
@ -120,8 +121,10 @@ public class PreviewImageActivity extends FileActivity implements
ActionBar actionBar = getSupportActionBar(); ActionBar actionBar = getSupportActionBar();
if (visible) { if (visible) {
actionBar.show(); actionBar.show();
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
} else { } else {
actionBar.hide(); actionBar.hide();
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
} }
} }
}); });
@ -496,6 +499,7 @@ public class PreviewImageActivity extends FileActivity implements
if (visible) { if (visible) {
hideSystemUI(mFullScreenAnchorView); hideSystemUI(mFullScreenAnchorView);
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
// actionBar.hide(); // propagated through // actionBar.hide(); // propagated through
// OnSystemUiVisibilityChangeListener() // OnSystemUiVisibilityChangeListener()
} else { } else {
@ -509,9 +513,11 @@ public class PreviewImageActivity extends FileActivity implements
ActionBar actionBar = getSupportActionBar(); ActionBar actionBar = getSupportActionBar();
if (!actionBar.isShowing()) { if (!actionBar.isShowing()) {
actionBar.show(); actionBar.show();
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
} else { } else {
actionBar.hide(); actionBar.hide();
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
} }