Merge "Rename private fields to break bad code examples" into froyo

This commit is contained in:
Romain Guy
2010-03-29 12:28:20 -07:00
committed by Android (Google) Code Review

View File

@@ -51,8 +51,8 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
private int mSelectedTab = 0; private int mSelectedTab = 0;
private Drawable mBottomLeftStrip; private Drawable mLeftStrip;
private Drawable mBottomRightStrip; private Drawable mRightStrip;
private boolean mDrawBottomStrips = true; private boolean mDrawBottomStrips = true;
private boolean mStripMoved; private boolean mStripMoved;
@@ -78,8 +78,8 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
mDrawBottomStrips = a.getBoolean(R.styleable.TabWidget_stripEnabled, true); mDrawBottomStrips = a.getBoolean(R.styleable.TabWidget_stripEnabled, true);
mDividerDrawable = a.getDrawable(R.styleable.TabWidget_divider); mDividerDrawable = a.getDrawable(R.styleable.TabWidget_divider);
mBottomLeftStrip = a.getDrawable(R.styleable.TabWidget_stripLeft); mLeftStrip = a.getDrawable(R.styleable.TabWidget_stripLeft);
mBottomRightStrip = a.getDrawable(R.styleable.TabWidget_stripRight); mRightStrip = a.getDrawable(R.styleable.TabWidget_stripRight);
a.recycle(); a.recycle();
@@ -114,22 +114,22 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
if (context.getApplicationInfo().targetSdkVersion <= Build.VERSION_CODES.DONUT) { if (context.getApplicationInfo().targetSdkVersion <= Build.VERSION_CODES.DONUT) {
// Donut apps get old color scheme // Donut apps get old color scheme
if (mBottomLeftStrip == null) { if (mLeftStrip == null) {
mBottomLeftStrip = resources.getDrawable( mLeftStrip = resources.getDrawable(
com.android.internal.R.drawable.tab_bottom_left_v4); com.android.internal.R.drawable.tab_bottom_left_v4);
} }
if (mBottomRightStrip == null) { if (mRightStrip == null) {
mBottomRightStrip = resources.getDrawable( mRightStrip = resources.getDrawable(
com.android.internal.R.drawable.tab_bottom_right_v4); com.android.internal.R.drawable.tab_bottom_right_v4);
} }
} else { } else {
// Use modern color scheme for Eclair and beyond // Use modern color scheme for Eclair and beyond
if (mBottomLeftStrip == null) { if (mLeftStrip == null) {
mBottomLeftStrip = resources.getDrawable( mLeftStrip = resources.getDrawable(
com.android.internal.R.drawable.tab_bottom_left); com.android.internal.R.drawable.tab_bottom_left);
} }
if (mBottomRightStrip == null) { if (mRightStrip == null) {
mBottomRightStrip = resources.getDrawable( mRightStrip = resources.getDrawable(
com.android.internal.R.drawable.tab_bottom_right); 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 * @param drawable the left strip drawable
*/ */
public void setLeftStripDrawable(Drawable drawable) { public void setLeftStripDrawable(Drawable drawable) {
mBottomLeftStrip = drawable; mLeftStrip = drawable;
requestLayout(); requestLayout();
invalidate(); invalidate();
} }
@@ -210,7 +210,7 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
* left strip drawable * left strip drawable
*/ */
public void setLeftStripDrawable(int resId) { public void setLeftStripDrawable(int resId) {
mBottomLeftStrip = mContext.getResources().getDrawable(resId); mLeftStrip = mContext.getResources().getDrawable(resId);
requestLayout(); requestLayout();
invalidate(); invalidate();
} }
@@ -221,7 +221,7 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
* @param drawable the right strip drawable * @param drawable the right strip drawable
*/ */
public void setRightStripDrawable(Drawable drawable) { public void setRightStripDrawable(Drawable drawable) {
mBottomRightStrip = drawable; mRightStrip = drawable;
requestLayout(); requestLayout();
invalidate(); } invalidate(); }
@@ -232,7 +232,7 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
* right strip drawable * right strip drawable
*/ */
public void setRightStripDrawable(int resId) { public void setRightStripDrawable(int resId) {
mBottomRightStrip = mContext.getResources().getDrawable(resId); mRightStrip = mContext.getResources().getDrawable(resId);
requestLayout(); requestLayout();
invalidate(); invalidate();
} }
@@ -282,8 +282,8 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
final View selectedChild = getChildTabViewAt(mSelectedTab); final View selectedChild = getChildTabViewAt(mSelectedTab);
final Drawable leftStrip = mBottomLeftStrip; final Drawable leftStrip = mLeftStrip;
final Drawable rightStrip = mBottomRightStrip; final Drawable rightStrip = mRightStrip;
leftStrip.setState(selectedChild.getDrawableState()); leftStrip.setState(selectedChild.getDrawableState());
rightStrip.setState(selectedChild.getDrawableState()); rightStrip.setState(selectedChild.getDrawableState());