summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-01-06 20:37:31 -0800
committerJohn Reck <jreck@google.com>2011-01-06 20:42:03 -0800
commit599e9105f538972be3e2eb96c651b9e12a3516cf (patch)
tree43ff4bb424299d2242797576f4770c38b4442f4e /src
parent2ab6d2509cc1d9d55a97935501689fe08f8baf0c (diff)
downloadpackages_apps_browser-599e9105f538972be3e2eb96c651b9e12a3516cf.zip
packages_apps_browser-599e9105f538972be3e2eb96c651b9e12a3516cf.tar.gz
packages_apps_browser-599e9105f538972be3e2eb96c651b9e12a3516cf.tar.bz2
Fixed close tab NPE
Bug: 3293676 This was caused by two problems. The first was the code to determine the child draw order could break. This cleans up the logic to hopefully be clearer and fixes the problem, it is more robust. The root cause though was that you could have two tabs pending being closed due to a broken animation. This simply removes the animations completely for now, how tab open/close should be animated can be addressed in another CL Change-Id: I06d993a093621bd086ae89162e332357c0e4d94c
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/TabScrollView.java43
1 files changed, 22 insertions, 21 deletions
diff --git a/src/com/android/browser/TabScrollView.java b/src/com/android/browser/TabScrollView.java
index 04ed5a3..f501e64 100644
--- a/src/com/android/browser/TabScrollView.java
+++ b/src/com/android/browser/TabScrollView.java
@@ -124,7 +124,6 @@ public class TabScrollView extends HorizontalScrollView {
void addTab(View tab) {
mContentView.addView(tab);
- animateIn(tab);
tab.setActivated(false);
}
@@ -135,7 +134,7 @@ public class TabScrollView extends HorizontalScrollView {
} else if (ix < mSelected) {
mSelected--;
}
- animateOut(tab);
+ mContentView.removeView(tab);
}
private void ensureChildVisible(View child) {
@@ -172,25 +171,27 @@ public class TabScrollView extends HorizontalScrollView {
}
}
- private void animateIn(View tab) {
- ObjectAnimator animator = ObjectAnimator.ofInt(tab, "TranslationX", 500, 0);
- animator.setDuration(mAnimationDuration);
- animator.start();
- }
-
- private void animateOut(final View tab) {
- ObjectAnimator animator = ObjectAnimator.ofInt(
- tab, "TranslationX", 0, getScrollX() - tab.getRight());
- animator.setDuration(mAnimationDuration);
- animator.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- mContentView.removeView(tab);
- }
- });
- animator.setInterpolator(new AccelerateInterpolator());
- animator.start();
- }
+// TODO: These animations are broken and don't work correctly, removing for now
+// as animateOut is actually causing issues
+// private void animateIn(View tab) {
+// ObjectAnimator animator = ObjectAnimator.ofInt(tab, "TranslationX", 500, 0);
+// animator.setDuration(mAnimationDuration);
+// animator.start();
+// }
+//
+// private void animateOut(final View tab) {
+// ObjectAnimator animator = ObjectAnimator.ofInt(
+// tab, "TranslationX", 0, getScrollX() - tab.getRight());
+// animator.setDuration(mAnimationDuration);
+// animator.addListener(new AnimatorListenerAdapter() {
+// @Override
+// public void onAnimationEnd(Animator animation) {
+// mContentView.removeView(tab);
+// }
+// });
+// animator.setInterpolator(new AccelerateInterpolator());
+// animator.start();
+// }
private void animateScroll(int newscroll) {
ObjectAnimator animator = ObjectAnimator.ofInt(this, "scroll", getScrollX(), newscroll);