merge from open-source master

This commit is contained in:
The Android Open Source Project
2010-01-21 11:21:25 -08:00
4 changed files with 14 additions and 5 deletions

View File

@ -68,6 +68,7 @@ public abstract class AbsSeekBar extends ProgressBar {
// ...but allow layout to override this // ...but allow layout to override this
int thumbOffset = int thumbOffset =
a.getDimensionPixelOffset(com.android.internal.R.styleable.SeekBar_thumbOffset, getThumbOffset()); a.getDimensionPixelOffset(com.android.internal.R.styleable.SeekBar_thumbOffset, getThumbOffset());
setThumbOffset(thumbOffset);
a.recycle(); a.recycle();
a = context.obtainStyledAttributes(attrs, a = context.obtainStyledAttributes(attrs,

View File

@ -177,6 +177,8 @@ public class ProgressBar extends View {
Drawable drawable = a.getDrawable(R.styleable.ProgressBar_progressDrawable); Drawable drawable = a.getDrawable(R.styleable.ProgressBar_progressDrawable);
if (drawable != null) { if (drawable != null) {
drawable = tileify(drawable, false); drawable = tileify(drawable, false);
// Calling this method can set mMaxHeight, make sure the corresponding
// XML attribute for mMaxHeight is read after calling this method
setProgressDrawable(drawable); setProgressDrawable(drawable);
} }
@ -421,6 +423,13 @@ public class ProgressBar extends View {
public void setProgressDrawable(Drawable d) { public void setProgressDrawable(Drawable d) {
if (d != null) { if (d != null) {
d.setCallback(this); d.setCallback(this);
// Make sure the ProgressBar is always tall enough
int drawableHeight = d.getMinimumHeight();
if (mMaxHeight < drawableHeight) {
mMaxHeight = drawableHeight;
requestLayout();
}
} }
mProgressDrawable = d; mProgressDrawable = d;
if (!mIndeterminate) { if (!mIndeterminate) {

View File

@ -138,14 +138,15 @@ public class ViewAnimator extends FrameLayout {
final int count = getChildCount(); final int count = getChildCount();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
final View child = getChildAt(i); final View child = getChildAt(i);
final boolean checkForFirst = (!mFirstTime || mAnimateFirstTime);
if (i == childIndex) { if (i == childIndex) {
if ((!mFirstTime || mAnimateFirstTime) && mInAnimation != null) { if (checkForFirst && mInAnimation != null) {
child.startAnimation(mInAnimation); child.startAnimation(mInAnimation);
} }
child.setVisibility(View.VISIBLE); child.setVisibility(View.VISIBLE);
mFirstTime = false; mFirstTime = false;
} else { } else {
if (mOutAnimation != null && child.getVisibility() == View.VISIBLE) { if (checkForFirst && mOutAnimation != null && child.getVisibility() == View.VISIBLE) {
child.startAnimation(mOutAnimation); child.startAnimation(mOutAnimation);
} else if (child.getAnimation() == mInAnimation) } else if (child.getAnimation() == mInAnimation)
child.clearAnimation(); child.clearAnimation();

View File

@ -1204,12 +1204,10 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
// Remove expired alerts // Remove expired alerts
if (intentsToRemove != null) { if (intentsToRemove != null) {
for (PendingIntent i : intentsToRemove) { for (PendingIntent i : intentsToRemove) {
mProximityAlerts.remove(i); ProximityAlert alert = mProximityAlerts.remove(i);
ProximityAlert alert = mProximityAlerts.get(i);
mProximitiesEntered.remove(alert); mProximitiesEntered.remove(alert);
} }
} }
} }
// Note: this is called with the lock held. // Note: this is called with the lock held.