-
Notifications
You must be signed in to change notification settings - Fork 763
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow user to create its GridLayoutInfo through GridLayoutInfoFactory
Summary: This is a feature request from [this post](https://fb.workplace.com/groups/1430200360634661/permalink/2386733414981346/) that allow user to provide its own `GridLayoutManager` when creating a GridLayoutInfo. In `LinearLayoutInfo` we already have `LinearLayoutInfoFactory` for user to use its own LinearLayoutManager, this diff is providing similar APIs to `GridLayoutInfo`. Reviewed By: astreet Differential Revision: D16560816 fbshipit-source-id: 6cfa71c5d4099f92aa26d3c4521bc6e795adbd31
- Loading branch information
1 parent
e61ac4f
commit 4568d58
Showing
3 changed files
with
95 additions
and
10 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...ctions-widget/src/main/java/com/facebook/litho/sections/widget/GridLayoutInfoFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright 2014-present Facebook, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.facebook.litho.sections.widget; | ||
|
||
import android.content.Context; | ||
import com.facebook.litho.widget.GridLayoutInfo; | ||
|
||
/** A Factory used to create {@link GridLayoutInfo}s in {@link GridRecyclerConfiguration}. */ | ||
public interface GridLayoutInfoFactory { | ||
/** | ||
* @return a new {@link GridLayoutInfo} that will be used to compute the layouts of the children | ||
* of the {@link GridRecyclerConfiguration}. | ||
*/ | ||
GridLayoutInfo createGridLayoutInfo( | ||
Context c, | ||
int spanCount, | ||
int orientation, | ||
boolean reverseLayout, | ||
boolean allowGridMeasuresOverride); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters