forked from facebook/react-native
-
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.
Added property display: flex and none
Summary: Fix facebook#241 and successor for facebook#302 Added new property ```display``` with ```YGDisplayFlex``` and ```YGDisplayNone```. Allows to hide nodes from the layout without the need to remove it from the DOM. Closes facebook/yoga#369 Reviewed By: astreet Differential Revision: D4501141 Pulled By: emilsjolander fbshipit-source-id: 0dfeee381f6d1e4bbba81926126b83dd7abab9d6
- Loading branch information
Showing
7 changed files
with
100 additions
and
6 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.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,36 @@ | ||
/** | ||
* Copyright (c) 2014-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ | ||
|
||
package com.facebook.yoga; | ||
|
||
import com.facebook.proguard.annotations.DoNotStrip; | ||
|
||
@DoNotStrip | ||
public enum YogaDisplay { | ||
FLEX(0), | ||
NONE(1); | ||
|
||
private int mIntValue; | ||
|
||
YogaDisplay(int intValue) { | ||
mIntValue = intValue; | ||
} | ||
|
||
public int intValue() { | ||
return mIntValue; | ||
} | ||
|
||
public static YogaDisplay fromInt(int value) { | ||
switch (value) { | ||
case 0: return FLEX; | ||
case 1: return NONE; | ||
default: throw new IllegalArgumentException("Unknown enum value: " + value); | ||
} | ||
} | ||
} |
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