am 0e122926: Merge "Rename private fields to break bad code examples" into froyo
Merge commit '0e1229260d66b308a0ad271c20970e3decd6f55c' into froyo-plus-aosp * commit '0e1229260d66b308a0ad271c20970e3decd6f55c': Rename private fields to break bad code examples
This commit is contained in:
@@ -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());
|
||||||
|
|||||||
Reference in New Issue
Block a user