-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Some views (TextInput!) need padding props. Reviewed By: mdvacca Differential Revision: D17081799 fbshipit-source-id: 4f5d6a139bb4dd878f90af0ed4a30fe3810e3429
- Loading branch information
1 parent
51aacd5
commit 44bfc4b
Showing
5 changed files
with
118 additions
and
0 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
51 changes: 51 additions & 0 deletions
51
...d/src/main/java/com/facebook/react/fabric/mounting/mountitems/UpdatePaddingMountItem.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,51 @@ | ||
/** | ||
* Copyright (c) 2014-present, Facebook, Inc. | ||
* | ||
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root | ||
* directory of this source tree. | ||
*/ | ||
package com.facebook.react.fabric.mounting.mountitems; | ||
|
||
import com.facebook.react.fabric.mounting.MountingManager; | ||
|
||
/** | ||
* A MountItem that represents setting the padding properties of a view (left, top, right, bottom). | ||
* This is distinct from layout because it happens far less frequently from layout; so it is a perf | ||
* optimization to transfer this data and execute the methods strictly less than the layout-related | ||
* properties. | ||
*/ | ||
public class UpdatePaddingMountItem implements MountItem { | ||
|
||
private final int mReactTag; | ||
private final int mLeft; | ||
private final int mTop; | ||
private final int mRight; | ||
private final int mBottom; | ||
|
||
public UpdatePaddingMountItem(int reactTag, int left, int top, int right, int bottom) { | ||
mReactTag = reactTag; | ||
mLeft = left; | ||
mTop = top; | ||
mRight = right; | ||
mBottom = bottom; | ||
} | ||
|
||
@Override | ||
public void execute(MountingManager mountingManager) { | ||
mountingManager.updatePadding(mReactTag, mLeft, mTop, mRight, mBottom); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "UpdatePaddingMountItem [" | ||
+ mReactTag | ||
+ "] - left: " | ||
+ mLeft | ||
+ " - top: " | ||
+ mTop | ||
+ " - right: " | ||
+ mRight | ||
+ " - bottom: " | ||
+ mBottom; | ||
} | ||
} |