forked from facebook/litho
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Moving LayoutResult out of the Node class. Reviewed By: adityasharat Differential Revision: D42929851 fbshipit-source-id: 3bda9016975c645e4f28f3550e496e3101c98651
- Loading branch information
1 parent
5a58dfa
commit 43cff46
Showing
53 changed files
with
282 additions
and
264 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
82 changes: 82 additions & 0 deletions
82
litho-rendercore/src/main/java/com/facebook/rendercore/LayoutResult.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,82 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* 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.rendercore; | ||
|
||
import androidx.annotation.Nullable; | ||
import androidx.annotation.Px; | ||
|
||
/** | ||
* Represents the result of a Layout pass. A LayoutResult has a reference to its originating Node | ||
* and all the layout information needed to position the content of such Node. | ||
*/ | ||
public interface LayoutResult { | ||
|
||
/** @return the RenderUnit that should be rendered by this layout result. */ | ||
@Nullable | ||
RenderUnit<?> getRenderUnit(); | ||
|
||
/** | ||
* @return layout specific data that was generated during the layout pass that created this | ||
* LayoutResult. | ||
*/ | ||
@Nullable | ||
Object getLayoutData(); | ||
|
||
/** @return the number of children of this LayoutResult. */ | ||
int getChildrenCount(); | ||
|
||
/** @return the LayoutResult for the given child index */ | ||
LayoutResult getChildAt(int index); | ||
|
||
/** @return the resolved X position for the Node */ | ||
@Px | ||
int getXForChildAtIndex(int index); | ||
|
||
/** @return the resolved Y position for the Node */ | ||
@Px | ||
int getYForChildAtIndex(int index); | ||
|
||
/** @return the resolved width for the Node */ | ||
@Px | ||
int getWidth(); | ||
|
||
/** @return the resolved height for the Node */ | ||
@Px | ||
int getHeight(); | ||
|
||
/** @return the resolved top padding for the Node */ | ||
@Px | ||
int getPaddingTop(); | ||
|
||
/** @return the resolved right padding for the Node */ | ||
@Px | ||
int getPaddingRight(); | ||
|
||
/** @return the resolved bottom padding for the Node */ | ||
@Px | ||
int getPaddingBottom(); | ||
|
||
/** @return the resolved left padding for the Node */ | ||
@Px | ||
int getPaddingLeft(); | ||
|
||
/** @return the width measurement that generated this LayoutResult */ | ||
int getWidthSpec(); | ||
|
||
/** @return the height measurement that generated this LayoutResult */ | ||
int getHeightSpec(); | ||
} |
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
Oops, something went wrong.