diff options
| author | Michael Kolb <kolby@google.com> | 2011-07-13 14:50:56 -0700 |
|---|---|---|
| committer | Michael Kolb <kolby@google.com> | 2011-07-13 14:51:09 -0700 |
| commit | 308b301d37295044c5beac52c5b1a8de0853304f (patch) | |
| tree | 00af58dee458f2ca791cb924c78a94e85cb6915e /src | |
| parent | ef654f1dd80f55609060005342fc4f2cde62990c (diff) | |
| download | packages_apps_Browser-308b301d37295044c5beac52c5b1a8de0853304f.tar.gz packages_apps_Browser-308b301d37295044c5beac52c5b1a8de0853304f.tar.bz2 packages_apps_Browser-308b301d37295044c5beac52c5b1a8de0853304f.zip | |
fix tab switcher close/refresh issue
Bug: 5015810
Also fixes the case when closing a tab without changing the
selected position the list would be empty.
Change-Id: Ibf4de0b33c696d14e15b82c07e697b1f1736565a
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/browser/NavScreen.java | 12 | ||||
| -rw-r--r-- | src/com/android/browser/view/Gallery.java | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/com/android/browser/NavScreen.java b/src/com/android/browser/NavScreen.java index 1c35b452f..6a51e8757 100644 --- a/src/com/android/browser/NavScreen.java +++ b/src/com/android/browser/NavScreen.java @@ -156,8 +156,11 @@ public class NavScreen extends RelativeLayout private void onCloseTab(Tab tab) { if (tab != null) { - switchToSelected(); - mUiController.closeCurrentTab(); + if (tab == mUiController.getCurrentTab()) { + mUiController.closeCurrentTab(); + } else { + mUiController.closeTab(tab); + } mAdapter.notifyDataSetChanged(); } } @@ -229,8 +232,10 @@ public class NavScreen extends RelativeLayout @Override public void onClick(View v) { if (tabview.isClose(v)) { - onCloseTab((Tab) (mScroller.getSelectedItem())); + onCloseTab(tab); } else if (tabview.isTitle(v)) { + mScroller.setSelection(position); + switchToSelected(); mUi.getTitleBar().setSkipTitleBarAnimations(true); close(false); mUi.editUrl(false); @@ -238,7 +243,6 @@ public class NavScreen extends RelativeLayout } else if (tabview.isWebView(v)) { mScroller.setSelection(position); close(); - } } }); diff --git a/src/com/android/browser/view/Gallery.java b/src/com/android/browser/view/Gallery.java index 5ab78b4a0..aa6ed6564 100644 --- a/src/com/android/browser/view/Gallery.java +++ b/src/com/android/browser/view/Gallery.java @@ -224,6 +224,7 @@ public class Gallery extends ViewGroup implements // Nothing selected checkSelectionChanged(); } + layout(0, false); } else { // checkFocus(); mOldSelectedPosition = INVALID_POSITION; @@ -231,6 +232,7 @@ public class Gallery extends ViewGroup implements resetList(); // Nothing selected checkSelectionChanged(); + invalidate(); } } @@ -240,7 +242,6 @@ public class Gallery extends ViewGroup implements void resetList() { mDataChanged = false; removeAllViewsInLayout(); - invalidate(); } public void setCallbackDuringFling(boolean shouldCallback) { |
