Skip to content

Commit 80e4ee4

Browse files
Philip MilneAndroid (Google) Code Review
authored andcommitted
Merge "Fixes for bugs: 6104423, 6103563, 6103509, 6103807 & 6103253."
2 parents 9dcd8c2 + aac722a commit 80e4ee4

File tree

5 files changed

+164
-12
lines changed

5 files changed

+164
-12
lines changed

api/current.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26055,6 +26055,7 @@ package android.widget {
2605526055
public class AdapterViewFlipper extends android.widget.AdapterViewAnimator {
2605626056
ctor public AdapterViewFlipper(android.content.Context);
2605726057
ctor public AdapterViewFlipper(android.content.Context, android.util.AttributeSet);
26058+
method public int getFlipInterval();
2605826059
method public boolean isAutoStart();
2605926060
method public boolean isFlipping();
2606026061
method public void setAutoStart(boolean);
@@ -26730,19 +26731,27 @@ package android.widget {
2673026731
ctor public ImageView(android.content.Context, android.util.AttributeSet);
2673126732
ctor public ImageView(android.content.Context, android.util.AttributeSet, int);
2673226733
method public final void clearColorFilter();
26734+
method public boolean getAdjustViewBounds();
2673326735
method public boolean getBaselineAlignBottom();
26736+
method public android.graphics.ColorFilter getColorFilter();
26737+
method public boolean getCropToPadding();
2673426738
method public android.graphics.drawable.Drawable getDrawable();
26739+
method public int getImageAlpha();
2673526740
method public android.graphics.Matrix getImageMatrix();
26741+
method public int getMaxHeight();
26742+
method public int getMaxWidth();
2673626743
method public android.widget.ImageView.ScaleType getScaleType();
2673726744
method public int[] onCreateDrawableState(int);
2673826745
method public void setAdjustViewBounds(boolean);
26739-
method public void setAlpha(int);
26746+
method public deprecated void setAlpha(int);
2674026747
method public void setBaseline(int);
2674126748
method public void setBaselineAlignBottom(boolean);
2674226749
method public final void setColorFilter(int, android.graphics.PorterDuff.Mode);
2674326750
method public final void setColorFilter(int);
2674426751
method public void setColorFilter(android.graphics.ColorFilter);
26752+
method public void setCropToPadding(boolean);
2674526753
method protected boolean setFrame(int, int, int, int);
26754+
method public void setImageAlpha(int);
2674626755
method public void setImageBitmap(android.graphics.Bitmap);
2674726756
method public void setImageDrawable(android.graphics.drawable.Drawable);
2674826757
method public void setImageLevel(int);

core/java/android/widget/AdapterViewFlipper.java

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,29 @@ public void setAdapter(Adapter adapter) {
127127
}
128128

129129
/**
130-
* How long to wait before flipping to the next view
130+
* Returns the flip interval, in milliseconds.
131131
*
132-
* @param milliseconds
133-
* time in milliseconds
132+
* @return the flip interval in milliseconds
133+
*
134+
* @see #setFlipInterval(int)
135+
*
136+
* @attr ref android.R.styleable#AdapterViewFlipper_flipInterval
137+
*/
138+
public int getFlipInterval() {
139+
return mFlipInterval;
140+
}
141+
142+
/**
143+
* How long to wait before flipping to the next view.
144+
*
145+
* @param flipInterval flip interval in milliseconds
146+
*
147+
* @see #getFlipInterval()
148+
*
149+
* @attr ref android.R.styleable#AdapterViewFlipper_flipInterval
134150
*/
135-
public void setFlipInterval(int milliseconds) {
136-
mFlipInterval = milliseconds;
151+
public void setFlipInterval(int flipInterval) {
152+
mFlipInterval = flipInterval;
137153
}
138154

139155
/**

core/java/android/widget/ImageView.java

Lines changed: 127 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,29 @@ public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
222222
}
223223
}
224224

225+
/**
226+
* True when ImageView is adjusting its bounds
227+
* to preserve the aspect ratio of its drawable
228+
*
229+
* @return whether to adjust the bounds of this view
230+
* to presrve the original aspect ratio of the drawable
231+
*
232+
* @see #setAdjustViewBounds(boolean)
233+
*
234+
* @attr ref android.R.styleable#ImageView_adjustViewBounds
235+
*/
236+
public boolean getAdjustViewBounds() {
237+
return mAdjustViewBounds;
238+
}
239+
225240
/**
226241
* Set this to true if you want the ImageView to adjust its bounds
227242
* to preserve the aspect ratio of its drawable.
228243
* @param adjustViewBounds Whether to adjust the bounds of this view
229244
* to presrve the original aspect ratio of the drawable
230245
*
246+
* @see #getAdjustViewBounds()
247+
*
231248
* @attr ref android.R.styleable#ImageView_adjustViewBounds
232249
*/
233250
@android.view.RemotableViewMethod
@@ -237,7 +254,20 @@ public void setAdjustViewBounds(boolean adjustViewBounds) {
237254
setScaleType(ScaleType.FIT_CENTER);
238255
}
239256
}
240-
257+
258+
/**
259+
* The maximum width of this view.
260+
*
261+
* @return The maximum width of this view
262+
*
263+
* @see #setMaxWidth(int)
264+
*
265+
* @attr ref android.R.styleable#ImageView_maxWidth
266+
*/
267+
public int getMaxWidth() {
268+
return mMaxWidth;
269+
}
270+
241271
/**
242272
* An optional argument to supply a maximum width for this view. Only valid if
243273
* {@link #setAdjustViewBounds(boolean)} has been set to true. To set an image to be a maximum
@@ -253,14 +283,29 @@ public void setAdjustViewBounds(boolean adjustViewBounds) {
253283
* </p>
254284
*
255285
* @param maxWidth maximum width for this view
256-
*
286+
*
287+
* @see #getMaxWidth()
288+
*
257289
* @attr ref android.R.styleable#ImageView_maxWidth
258290
*/
259291
@android.view.RemotableViewMethod
260292
public void setMaxWidth(int maxWidth) {
261293
mMaxWidth = maxWidth;
262294
}
263-
295+
296+
/**
297+
* The maximum height of this view.
298+
*
299+
* @return The maximum height of this view
300+
*
301+
* @see #setMaxHeight(int)
302+
*
303+
* @attr ref android.R.styleable#ImageView_maxHeight
304+
*/
305+
public int getMaxHeight() {
306+
return mMaxHeight;
307+
}
308+
264309
/**
265310
* An optional argument to supply a maximum height for this view. Only valid if
266311
* {@link #setAdjustViewBounds(boolean)} has been set to true. To set an image to be a
@@ -276,7 +321,9 @@ public void setMaxWidth(int maxWidth) {
276321
* </p>
277322
*
278323
* @param maxHeight maximum height for this view
279-
*
324+
*
325+
* @see #getMaxHeight()
326+
*
280327
* @attr ref android.R.styleable#ImageView_maxHeight
281328
*/
282329
@android.view.RemotableViewMethod
@@ -522,7 +569,37 @@ public void setImageMatrix(Matrix matrix) {
522569
invalidate();
523570
}
524571
}
525-
572+
573+
/**
574+
* Return whether this ImageView crops to padding.
575+
*
576+
* @return whether this ImageView crops to padding
577+
*
578+
* @see #setCropToPadding(boolean)
579+
*
580+
* @attr ref android.R.styleable#ImageView_cropToPadding
581+
*/
582+
public boolean getCropToPadding() {
583+
return mCropToPadding;
584+
}
585+
586+
/**
587+
* Sets whether this ImageView will crop to padding.
588+
*
589+
* @param cropToPadding whether this ImageView will crop to padding
590+
*
591+
* @see #getCropToPadding()
592+
*
593+
* @attr ref android.R.styleable#ImageView_cropToPadding
594+
*/
595+
public void setCropToPadding(boolean cropToPadding) {
596+
if (mCropToPadding != cropToPadding) {
597+
mCropToPadding = cropToPadding;
598+
requestLayout();
599+
invalidate();
600+
}
601+
}
602+
526603
private void resolveUri() {
527604
if (mDrawable != null) {
528605
return;
@@ -997,11 +1074,24 @@ public final void setColorFilter(int color) {
9971074
public final void clearColorFilter() {
9981075
setColorFilter(null);
9991076
}
1000-
1077+
1078+
/**
1079+
* Returns the active color filter for this ImageView.
1080+
*
1081+
* @return the active color filter for this ImageView
1082+
*
1083+
* @see #setColorFilter(android.graphics.ColorFilter)
1084+
*/
1085+
public ColorFilter getColorFilter() {
1086+
return mColorFilter;
1087+
}
1088+
10011089
/**
10021090
* Apply an arbitrary colorfilter to the image.
10031091
*
10041092
* @param cf the colorfilter to apply (may be null)
1093+
*
1094+
* @see #getColorFilter()
10051095
*/
10061096
public void setColorFilter(ColorFilter cf) {
10071097
if (mColorFilter != cf) {
@@ -1012,6 +1102,37 @@ public void setColorFilter(ColorFilter cf) {
10121102
}
10131103
}
10141104

1105+
/**
1106+
* Returns the alpha that will be applied to the drawable of this ImageView.
1107+
*
1108+
* @return the alpha that will be applied to the drawable of this ImageView
1109+
*
1110+
* @see #setImageAlpha(int)
1111+
*/
1112+
public int getImageAlpha() {
1113+
return mAlpha;
1114+
}
1115+
1116+
/**
1117+
* Sets the alpha value that should be applied to the image.
1118+
*
1119+
* @param alpha the alpha value that should be applied to the image
1120+
*
1121+
* @see #getImageAlpha()
1122+
*/
1123+
@RemotableViewMethod
1124+
public void setImageAlpha(int alpha) {
1125+
setAlpha(alpha);
1126+
}
1127+
1128+
/**
1129+
* Sets the alpha value that should be applied to the image.
1130+
*
1131+
* @param alpha the alpha value that should be applied to the image
1132+
*
1133+
* @deprecated use #setImageAlpha(int) instead
1134+
*/
1135+
@Deprecated
10151136
@RemotableViewMethod
10161137
public void setAlpha(int alpha) {
10171138
alpha &= 0xFF; // keep it legal

core/java/android/widget/RadioGroup.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ private void setCheckedStateForView(int viewId, boolean checked) {
190190
*
191191
* @see #check(int)
192192
* @see #clearCheck()
193+
*
194+
* @attr ref android.R.styleable#RadioGroup_checkedButton
193195
*/
194196
public int getCheckedRadioButtonId() {
195197
return mCheckedId;

core/java/android/widget/RatingBar.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ public OnRatingBarChangeListener getOnRatingBarChangeListener() {
145145
* by the user).
146146
*
147147
* @param isIndicator Whether it should be an indicator.
148+
*
149+
* @attr ref android.R.styleable#RatingBar_isIndicator
148150
*/
149151
public void setIsIndicator(boolean isIndicator) {
150152
mIsUserSeekable = !isIndicator;
@@ -153,6 +155,8 @@ public void setIsIndicator(boolean isIndicator) {
153155

154156
/**
155157
* @return Whether this rating bar is only an indicator.
158+
*
159+
* @attr ref android.R.styleable#RatingBar_isIndicator
156160
*/
157161
public boolean isIndicator() {
158162
return !mIsUserSeekable;

0 commit comments

Comments
 (0)