Skip to content

Commit 4b1a890

Browse files
hunterstichdsn5ft
authored andcommitted
[Carousel] Renamed Maskable.getMaskRect to Maskable.getMaskRectF
PiperOrigin-RevId: 508626230
1 parent fc0f53a commit 4b1a890

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/java/com/google/android/material/carousel/Maskable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ interface Maskable {
4343

4444
/** Gets a {@link RectF} that this {@link View} is masking itself by. */
4545
@NonNull
46-
RectF getMaskRect();
46+
RectF getMaskRectF();
4747

4848
/** Adds an {@link OnMaskChangedListener}. */
4949
void addOnMaskChangedListener(@NonNull OnMaskChangedListener listener);

lib/java/com/google/android/material/carousel/MaskableFrameLayout.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public float getMaskXPercentage() {
100100
/** Gets a {@link RectF} that this {@link View} is masking itself by. */
101101
@NonNull
102102
@Override
103-
public RectF getMaskRect() {
103+
public RectF getMaskRectF() {
104104
return maskRect;
105105
}
106106

@@ -178,7 +178,7 @@ private static void initMaskOutlineProvider(MaskableFrameLayout maskableFrameLay
178178
new ViewOutlineProvider() {
179179
@Override
180180
public void getOutline(View view, Outline outline) {
181-
RectF maskRect = ((MaskableFrameLayout) view).getMaskRect();
181+
RectF maskRect = ((MaskableFrameLayout) view).getMaskRectF();
182182
float cornerSize = ((MaskableFrameLayout) view).getCornerRadiusFromShapeAppearance();
183183
if (!maskRect.isEmpty()) {
184184
outline.setRoundRect(

lib/javatests/com/google/android/material/carousel/CarouselLayoutManagerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ protected KeylineState onFirstChildMeasuredWithMargins(
117117
setAdapterItems(recyclerView, layoutManager, adapter, createDataSetWithSize(1));
118118

119119
MaskableFrameLayout child = (MaskableFrameLayout) recyclerView.getChildAt(0);
120-
assertThat(child.getMaskRect().width()).isEqualTo(450F * .2F);
120+
assertThat(child.getMaskRectF().width()).isEqualTo(450F * .2F);
121121
}
122122

123123
@Test
@@ -134,10 +134,10 @@ protected KeylineState onFirstChildMeasuredWithMargins(
134134
setAdapterItems(recyclerView, layoutManager, adapter, createDataSetWithSize(10));
135135

136136
MaskableFrameLayout firstChild = (MaskableFrameLayout) recyclerView.getChildAt(0);
137-
int maskLeft = (int) firstChild.getMaskRect().left;
137+
int maskLeft = (int) firstChild.getMaskRectF().left;
138138
MaskableFrameLayout lastChild =
139139
(MaskableFrameLayout) recyclerView.getChildAt(recyclerView.getChildCount() - 1);
140-
int maskRight = (int) (lastChild.getWidth() - lastChild.getMaskRect().right);
140+
int maskRight = (int) (lastChild.getWidth() - lastChild.getMaskRectF().right);
141141

142142
assertThat(firstChild.getLeft() + maskLeft).isEqualTo(0);
143143
assertThat(lastChild.getRight() - maskRight).isEqualTo(DEFAULT_RECYCLER_VIEW_WIDTH);

0 commit comments

Comments
 (0)