Skip to content

Commit 354a72c

Browse files
Andrew Wangfacebook-github-bot
Andrew Wang
authored andcommitted
Pull up RecyclerViewLayoutManagerOverrideParams from RecyclerBinder
Summary: Pull up RecyclerViewLayoutManagerOverrideParams and convert it to Kotlin. Reviewed By: adityasharat Differential Revision: D68280011 fbshipit-source-id: d4e1da579f4a0aee975a134e6feba5188c36c44e
1 parent 5ead65d commit 354a72c

File tree

4 files changed

+28
-37
lines changed

4 files changed

+28
-37
lines changed

litho-widget/src/main/java/com/facebook/litho/widget/GridLayoutInfo.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import androidx.recyclerview.widget.RecyclerView;
2828
import com.facebook.litho.LayoutManagerOverrideParams;
2929
import com.facebook.litho.SizeSpec;
30-
import com.facebook.litho.widget.RecyclerBinder.RecyclerViewLayoutManagerOverrideParams;
3130
import java.util.List;
3231
import javax.annotation.Nullable;
3332

litho-widget/src/main/java/com/facebook/litho/widget/RecyclerBinder.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
import com.facebook.litho.ComponentsReporter;
5858
import com.facebook.litho.ComponentsSystrace;
5959
import com.facebook.litho.EventHandler;
60-
import com.facebook.litho.LayoutManagerOverrideParams;
6160
import com.facebook.litho.LithoStartupLogger;
6261
import com.facebook.litho.LithoView;
6362
import com.facebook.litho.LithoVisibilityEventsController;
@@ -4161,40 +4160,6 @@ private int getNormalizedPosition(int position) {
41614160
return mIsCircular ? position % mComponentTreeHolders.size() : position;
41624161
}
41634162

4164-
public static class RecyclerViewLayoutManagerOverrideParams extends RecyclerView.LayoutParams
4165-
implements LayoutManagerOverrideParams {
4166-
4167-
private final int mWidthMeasureSpec;
4168-
private final int mHeightMeasureSpec;
4169-
private final boolean mIsFullSpan;
4170-
4171-
private RecyclerViewLayoutManagerOverrideParams(
4172-
int width,
4173-
int height,
4174-
int overrideWidthMeasureSpec,
4175-
int overrideHeightMeasureSpec,
4176-
boolean isFullSpan) {
4177-
super(width, height);
4178-
mWidthMeasureSpec = overrideWidthMeasureSpec;
4179-
mHeightMeasureSpec = overrideHeightMeasureSpec;
4180-
mIsFullSpan = isFullSpan;
4181-
}
4182-
4183-
@Override
4184-
public int getWidthMeasureSpec() {
4185-
return mWidthMeasureSpec;
4186-
}
4187-
4188-
@Override
4189-
public int getHeightMeasureSpec() {
4190-
return mHeightMeasureSpec;
4191-
}
4192-
4193-
public boolean isFullSpan() {
4194-
return mIsFullSpan;
4195-
}
4196-
}
4197-
41984163
private ComponentTreeHolder createComponentTreeHolder(RenderInfo renderInfo) {
41994164
if (mComponentWarmer != null) {
42004165
final Object tag = renderInfo.getCustomAttribute(ComponentWarmer.COMPONENT_WARMER_TAG);
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.facebook.litho.widget
18+
19+
import androidx.recyclerview.widget.RecyclerView
20+
import com.facebook.litho.LayoutManagerOverrideParams
21+
22+
class RecyclerViewLayoutManagerOverrideParams(
23+
width: Int,
24+
height: Int,
25+
override val widthMeasureSpec: Int,
26+
override val heightMeasureSpec: Int,
27+
val isFullSpan: Boolean
28+
) : RecyclerView.LayoutParams(width, height), LayoutManagerOverrideParams

litho-widget/src/main/java/com/facebook/litho/widget/StaggeredGridLayoutInfo.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
2727
import com.facebook.litho.LayoutManagerOverrideParams;
2828
import com.facebook.litho.SizeSpec;
29-
import com.facebook.litho.widget.RecyclerBinder.RecyclerViewLayoutManagerOverrideParams;
3029
import java.lang.ref.WeakReference;
3130
import java.util.List;
3231

0 commit comments

Comments
 (0)