summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/view
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2011-08-01 09:56:26 -0700
committerMichael Kolb <kolby@google.com>2011-08-01 10:32:19 -0700
commitc1eeb12b6e4570520c3571aba9c04be91b4a20d5 (patch)
treed851a5fea7f68c9f151231446c3b5f0d449fc837 /src/com/android/browser/view
parentbf4dc0a894c4bec72ffb840de769ee01ff579932 (diff)
downloadandroid_packages_apps_Gello-c1eeb12b6e4570520c3571aba9c04be91b4a20d5.tar.gz
android_packages_apps_Gello-c1eeb12b6e4570520c3571aba9c04be91b4a20d5.tar.bz2
android_packages_apps_Gello-c1eeb12b6e4570520c3571aba9c04be91b4a20d5.zip
fix last tab close bug
Bug: 5098467 The controller did not update the tab list correctly and called activity finish instead. The adapter got updated and showed the last tab still Now the controller removes the last tab before calling finish, so the visible update to the tab list is correct. Change-Id: Idf29dff7d60181c63f6b3ebcbc8a1562f027b2c1
Diffstat (limited to 'src/com/android/browser/view')
-rw-r--r--src/com/android/browser/view/Gallery.java44
1 files changed, 21 insertions, 23 deletions
diff --git a/src/com/android/browser/view/Gallery.java b/src/com/android/browser/view/Gallery.java
index 59e710db..78d4bc6b 100644
--- a/src/com/android/browser/view/Gallery.java
+++ b/src/com/android/browser/view/Gallery.java
@@ -254,29 +254,27 @@ public class Gallery extends ViewGroup implements
resetList();
mItemCount = mAdapter.getCount();
// checkFocus();
- int position = mItemCount > 0 ? 0 : INVALID_POSITION;
- if (mSelectedPosition >= 0) {
- position = Math.min(mItemCount - 1, mSelectedPosition);
- }
- setSelectedPositionInt(position);
- if (mItemCount == 0) {
- // Nothing selected
- checkSelectionChanged();
- }
- if (mGapPosition > INVALID_POSITION) {
- mGapAnimator = ObjectAnimator.ofInt(this, "gap", mGap, 0);
- mGapAnimator.setDuration(250);
- mGapAnimator.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator a) {
- mGapPosition = INVALID_POSITION;
- mGap = 0;
- mGapAnimator = null;
- }
- });
- mGapAnimator.start();
- } else {
- layout(0, false);
+ if (mItemCount > 0) {
+ int position = 0;
+ if (mSelectedPosition >= 0) {
+ position = Math.min(mItemCount - 1, mSelectedPosition);
+ }
+ setSelectedPositionInt(position);
+ if (mGapPosition > INVALID_POSITION) {
+ mGapAnimator = ObjectAnimator.ofInt(this, "gap", mGap, 0);
+ mGapAnimator.setDuration(250);
+ mGapAnimator.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator a) {
+ mGapPosition = INVALID_POSITION;
+ mGap = 0;
+ mGapAnimator = null;
+ }
+ });
+ mGapAnimator.start();
+ } else {
+ layout(0, false);
+ }
}
} else {
// checkFocus();