DO NOT MERGE ANYWHERE
Remove onBeforePop() logic so back no longer opens/closes drawer. Bug: 30814333 Change-Id: I4f6fc2a353286f69b88e5340145f7f9b3a97e819
This commit is contained in:
@@ -612,23 +612,13 @@ public abstract class BaseActivity extends Activity
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mState.hasLocationChanged()) {
|
if (popDir()) {
|
||||||
super.onBackPressed();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (onBeforePopDir() || popDir()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean onBeforePopDir() {
|
|
||||||
// Files app overrides this with some fancy logic.
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onStackPicked(DocumentStack stack) {
|
public void onStackPicked(DocumentStack stack) {
|
||||||
try {
|
try {
|
||||||
// Update the restored stack to ensure we have freshest data
|
// Update the restored stack to ensure we have freshest data
|
||||||
|
|||||||
@@ -60,12 +60,6 @@ public class FilesActivity extends BaseActivity {
|
|||||||
|
|
||||||
public static final String TAG = "FilesActivity";
|
public static final String TAG = "FilesActivity";
|
||||||
|
|
||||||
// See comments where this const is referenced for details.
|
|
||||||
private static final int DRAWER_NO_FIDDLE_DELAY = 1500;
|
|
||||||
|
|
||||||
// Track the time we opened the drawer in response to back being pressed.
|
|
||||||
// We use the time gap to figure out whether to close app or reopen the drawer.
|
|
||||||
private long mDrawerLastFiddled;
|
|
||||||
private DocumentClipper mClipper;
|
private DocumentClipper mClipper;
|
||||||
|
|
||||||
public FilesActivity() {
|
public FilesActivity() {
|
||||||
@@ -395,39 +389,6 @@ public class FilesActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do some "do what a I want" drawer fiddling, but don't
|
|
||||||
// do it if user already hit back recently and we recently
|
|
||||||
// did some fiddling.
|
|
||||||
@Override
|
|
||||||
boolean onBeforePopDir() {
|
|
||||||
int size = mState.stack.size();
|
|
||||||
|
|
||||||
if (mDrawer.isPresent()
|
|
||||||
&& (System.currentTimeMillis() - mDrawerLastFiddled) > DRAWER_NO_FIDDLE_DELAY) {
|
|
||||||
// Close drawer if it is open.
|
|
||||||
if (mDrawer.isOpen()) {
|
|
||||||
mDrawer.setOpen(false);
|
|
||||||
mDrawerLastFiddled = System.currentTimeMillis();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Intent intent = getIntent();
|
|
||||||
final boolean launchedExternally = intent != null && intent.getData() != null
|
|
||||||
&& mState.action == State.ACTION_BROWSE;
|
|
||||||
|
|
||||||
// Open the Close drawer if it is closed and we're at the top of a root, but only when
|
|
||||||
// not launched by another app.
|
|
||||||
if (size <= 1 && !launchedExternally) {
|
|
||||||
mDrawer.setOpen(true);
|
|
||||||
// Remember so we don't just close it again if back is pressed again.
|
|
||||||
mDrawerLastFiddled = System.currentTimeMillis();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Turns out only DocumentsActivity was ever calling saveStackBlocking.
|
// Turns out only DocumentsActivity was ever calling saveStackBlocking.
|
||||||
// There may be a case where we want to contribute entries from
|
// There may be a case where we want to contribute entries from
|
||||||
// Behavior here in FilesActivity, but it isn't yet obvious.
|
// Behavior here in FilesActivity, but it isn't yet obvious.
|
||||||
|
|||||||
Reference in New Issue
Block a user