2016-01-06 16:56:56 +00:00
|
|
|
/**
|
2016-07-25 06:31:32 -07:00
|
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
2016-01-06 16:56:56 +00:00
|
|
|
* 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.
|
|
|
|
*/
|
2016-07-25 06:31:32 -07:00
|
|
|
|
2016-12-05 02:56:20 -08:00
|
|
|
package com.facebook.yoga;
|
2016-01-06 16:56:56 +00:00
|
|
|
|
2016-11-28 09:20:59 -08:00
|
|
|
import com.facebook.proguard.annotations.DoNotStrip;
|
|
|
|
|
|
|
|
@DoNotStrip
|
2016-12-02 05:47:43 -08:00
|
|
|
public enum YogaMeasureMode {
|
2016-11-15 08:42:33 -08:00
|
|
|
UNDEFINED(0),
|
|
|
|
EXACTLY(1),
|
|
|
|
AT_MOST(2);
|
|
|
|
|
|
|
|
private int mIntValue;
|
|
|
|
|
2016-12-02 05:47:43 -08:00
|
|
|
YogaMeasureMode(int intValue) {
|
2016-11-15 08:42:33 -08:00
|
|
|
mIntValue = intValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int intValue() {
|
|
|
|
return mIntValue;
|
|
|
|
}
|
|
|
|
|
2016-12-02 05:47:43 -08:00
|
|
|
public static YogaMeasureMode fromInt(int value) {
|
2016-11-15 08:42:33 -08:00
|
|
|
switch (value) {
|
|
|
|
case 0: return UNDEFINED;
|
|
|
|
case 1: return EXACTLY;
|
|
|
|
case 2: return AT_MOST;
|
|
|
|
default: throw new IllegalArgumentException("Unkown enum value: " + value);
|
|
|
|
}
|
|
|
|
}
|
2016-01-06 16:56:56 +00:00
|
|
|
}
|