Bug 1017276 - Do not close editing mode during animation. r=lucasr

This commit is contained in:
Michael Comella 2014-05-30 09:43:48 -07:00
Родитель 507dfa727f
Коммит d6222f0d5c
1 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -377,10 +377,14 @@ public class BrowserToolbar extends ThemedRelativeLayout
editCancel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Telemetry.sendUIEvent(TelemetryContract.Event.CANCEL,
TelemetryContract.Method.ACTIONBAR,
getResources().getResourceEntryName(editCancel.getId()));
cancelEdit();
// If we exit editing mode during the animation,
// we're put into an inconsistent state (bug 1017276).
if (!isAnimatingEntry) {
Telemetry.sendUIEvent(TelemetryContract.Event.CANCEL,
TelemetryContract.Method.ACTIONBAR,
getResources().getResourceEntryName(editCancel.getId()));
cancelEdit();
}
}
});
}
@ -407,7 +411,9 @@ public class BrowserToolbar extends ThemedRelativeLayout
}
public boolean onBackPressed() {
if (isEditing()) {
// If we exit editing mode during the animation,
// we're put into an inconsistent state (bug 1017276).
if (isEditing() && !isAnimatingEntry) {
Telemetry.sendUIEvent(TelemetryContract.Event.CANCEL,
TelemetryContract.Method.BACK);
cancelEdit();