From 65fe2c08fa5332f5e2aaa805a029855e876e485e Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Mon, 29 Mar 2010 12:27:30 -0700 Subject: [PATCH] Rename private fields to break bad code examples Change-Id: I4a3e8df5de159c703db244212f78824e4105ba90 --- core/java/android/widget/TabWidget.java | 36 ++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/core/java/android/widget/TabWidget.java b/core/java/android/widget/TabWidget.java index 52a560c559183..5a133fc79ad0f 100644 --- a/core/java/android/widget/TabWidget.java +++ b/core/java/android/widget/TabWidget.java @@ -51,8 +51,8 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { private int mSelectedTab = 0; - private Drawable mBottomLeftStrip; - private Drawable mBottomRightStrip; + private Drawable mLeftStrip; + private Drawable mRightStrip; private boolean mDrawBottomStrips = true; private boolean mStripMoved; @@ -78,8 +78,8 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { mDrawBottomStrips = a.getBoolean(R.styleable.TabWidget_stripEnabled, true); mDividerDrawable = a.getDrawable(R.styleable.TabWidget_divider); - mBottomLeftStrip = a.getDrawable(R.styleable.TabWidget_stripLeft); - mBottomRightStrip = a.getDrawable(R.styleable.TabWidget_stripRight); + mLeftStrip = a.getDrawable(R.styleable.TabWidget_stripLeft); + mRightStrip = a.getDrawable(R.styleable.TabWidget_stripRight); a.recycle(); @@ -114,22 +114,22 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { if (context.getApplicationInfo().targetSdkVersion <= Build.VERSION_CODES.DONUT) { // Donut apps get old color scheme - if (mBottomLeftStrip == null) { - mBottomLeftStrip = resources.getDrawable( + if (mLeftStrip == null) { + mLeftStrip = resources.getDrawable( com.android.internal.R.drawable.tab_bottom_left_v4); } - if (mBottomRightStrip == null) { - mBottomRightStrip = resources.getDrawable( + if (mRightStrip == null) { + mRightStrip = resources.getDrawable( com.android.internal.R.drawable.tab_bottom_right_v4); } } else { // Use modern color scheme for Eclair and beyond - if (mBottomLeftStrip == null) { - mBottomLeftStrip = resources.getDrawable( + if (mLeftStrip == null) { + mLeftStrip = resources.getDrawable( com.android.internal.R.drawable.tab_bottom_left); } - if (mBottomRightStrip == null) { - mBottomRightStrip = resources.getDrawable( + if (mRightStrip == null) { + mRightStrip = resources.getDrawable( com.android.internal.R.drawable.tab_bottom_right); } } @@ -198,7 +198,7 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { * @param drawable the left strip drawable */ public void setLeftStripDrawable(Drawable drawable) { - mBottomLeftStrip = drawable; + mLeftStrip = drawable; requestLayout(); invalidate(); } @@ -210,7 +210,7 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { * left strip drawable */ public void setLeftStripDrawable(int resId) { - mBottomLeftStrip = mContext.getResources().getDrawable(resId); + mLeftStrip = mContext.getResources().getDrawable(resId); requestLayout(); invalidate(); } @@ -221,7 +221,7 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { * @param drawable the right strip drawable */ public void setRightStripDrawable(Drawable drawable) { - mBottomRightStrip = drawable; + mRightStrip = drawable; requestLayout(); invalidate(); } @@ -232,7 +232,7 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { * right strip drawable */ public void setRightStripDrawable(int resId) { - mBottomRightStrip = mContext.getResources().getDrawable(resId); + mRightStrip = mContext.getResources().getDrawable(resId); requestLayout(); invalidate(); } @@ -282,8 +282,8 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { final View selectedChild = getChildTabViewAt(mSelectedTab); - final Drawable leftStrip = mBottomLeftStrip; - final Drawable rightStrip = mBottomRightStrip; + final Drawable leftStrip = mLeftStrip; + final Drawable rightStrip = mRightStrip; leftStrip.setState(selectedChild.getDrawableState()); rightStrip.setState(selectedChild.getDrawableState());