From f558f0d9372ecf4eeba86dd52bf67f38ff79c0b8 Mon Sep 17 00:00:00 2001 From: Michael Kolb Date: Thu, 13 Jan 2011 19:24:18 -0800 Subject: change tabbar overflow handling http://b/issue?id=3350118 remove arrows and fade scroll gap off to the left scroll under new tab button to right Change-Id: I1dcd45aadcce7881717f5af6bbdbc28bf21e7dc3 --- src/com/android/browser/TabScrollView.java | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'src/com/android/browser/TabScrollView.java') diff --git a/src/com/android/browser/TabScrollView.java b/src/com/android/browser/TabScrollView.java index f501e64..09dddee 100644 --- a/src/com/android/browser/TabScrollView.java +++ b/src/com/android/browser/TabScrollView.java @@ -16,15 +16,10 @@ package com.android.browser; -import android.animation.Animator; -import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.content.Context; -import android.graphics.Canvas; -import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.View; -import android.view.animation.AccelerateInterpolator; import android.widget.HorizontalScrollView; import android.widget.LinearLayout; @@ -36,8 +31,6 @@ public class TabScrollView extends HorizontalScrollView { private Context mContext; private LinearLayout mContentView; private int mSelected; - private Drawable mArrowLeft; - private Drawable mArrowRight; private int mAnimationDuration; private int mTabOverlap; @@ -79,10 +72,11 @@ public class TabScrollView extends HorizontalScrollView { mContentView.setOrientation(LinearLayout.HORIZONTAL); mContentView.setLayoutParams( new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT)); + mContentView.setPadding( + (int) ctx.getResources().getDimension(R.dimen.tab_first_padding_left), + 0, 0, 0); addView(mContentView); mSelected = -1; - mArrowLeft = ctx.getResources().getDrawable(R.drawable.ic_arrow_left); - mArrowRight = ctx.getResources().getDrawable(R.drawable.ic_arrow_right); // prevent ProGuard from removing the property methods setScroll(getScroll()); } @@ -153,24 +147,6 @@ public class TabScrollView extends HorizontalScrollView { } } - @Override - protected void dispatchDraw(Canvas canvas) { - super.dispatchDraw(canvas); - int l = getScrollX(); - int r = l + getWidth(); - int dis = 8; - if (l > 0) { - int aw = mArrowLeft.getIntrinsicWidth(); - mArrowLeft.setBounds(l + dis, 0, l + dis + aw, getHeight()); - mArrowLeft.draw(canvas); - } - if (r < mContentView.getWidth()) { - int aw = mArrowRight.getIntrinsicWidth(); - mArrowRight.setBounds(r - dis - aw, 0, r - dis, getHeight()); - mArrowRight.draw(canvas); - } - } - // TODO: These animations are broken and don't work correctly, removing for now // as animateOut is actually causing issues // private void animateIn(View tab) { -- cgit v1.1