use of com.android.tools.idea.ui.properties.core.IntValueProperty in project android by JetBrains.
the class DeveloperServiceCreator method createContext.
@NotNull
private static ServiceContext createContext(@NotNull Module module) {
String buildSystemId = getBuildSystemOperations(module.getProject()).getBuildSystemId();
ServiceContext context = new ServiceContext(buildSystemId);
String packageName = MergedManifest.get(module).getPackage();
if (packageName != null) {
context.putValue("packageName", new StringValueProperty(packageName));
}
AndroidPlatform platform = AndroidPlatform.getInstance(module);
if (platform != null) {
// Add the compileSdkVersion (or buildApiVersion) such that compatible dependencies are chosen
AndroidVersion version = platform.getApiVersion();
context.putValue(ATTR_BUILD_API, new IntValueProperty(version.getFeatureLevel()));
context.putValue(ATTR_BUILD_API_STRING, new StringValueProperty(getBuildApiString(version)));
}
return context;
}
use of com.android.tools.idea.ui.properties.core.IntValueProperty in project android by JetBrains.
the class IntExpressionsTest method testLessThanEqualValueExpression.
@Test
public void testLessThanEqualValueExpression() {
BoolValueProperty result = new BoolValueProperty();
IntValueProperty lhs = new IntValueProperty();
BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
bindings.bind(result, lhs.isLessThanEqualTo(10));
assertThat(result.get()).isTrue();
lhs.set(10);
assertThat(result.get()).isTrue();
lhs.set(20);
assertThat(result.get()).isFalse();
}
use of com.android.tools.idea.ui.properties.core.IntValueProperty in project android by JetBrains.
the class IntExpressionsTest method testLessThanEqualExpression.
@Test
public void testLessThanEqualExpression() {
BoolValueProperty result = new BoolValueProperty();
IntValueProperty lhs = new IntValueProperty();
IntValueProperty rhs = new IntValueProperty();
BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
bindings.bind(result, lhs.isLessThanEqualTo(rhs));
assertThat(result.get()).isTrue();
lhs.set(10);
assertThat(result.get()).isFalse();
rhs.set(10);
assertThat(result.get()).isTrue();
rhs.set(20);
assertThat(result.get()).isTrue();
}
use of com.android.tools.idea.ui.properties.core.IntValueProperty in project android by JetBrains.
the class IntExpressionsTest method testLessThanExpression.
@Test
public void testLessThanExpression() {
BoolValueProperty result = new BoolValueProperty();
IntValueProperty lhs = new IntValueProperty();
IntValueProperty rhs = new IntValueProperty();
BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
bindings.bind(result, lhs.isLessThan(rhs));
assertThat(result.get()).isFalse();
rhs.set(10);
assertThat(result.get()).isTrue();
lhs.set(10);
assertThat(result.get()).isFalse();
}
use of com.android.tools.idea.ui.properties.core.IntValueProperty in project android by JetBrains.
the class IntExpressionsTest method testGreaterThanExpression.
@Test
public void testGreaterThanExpression() {
BoolValueProperty result = new BoolValueProperty();
IntValueProperty lhs = new IntValueProperty();
IntValueProperty rhs = new IntValueProperty();
BindingsManager bindings = new BindingsManager(INVOKE_IMMEDIATELY_STRATEGY);
bindings.bind(result, lhs.isGreaterThan(rhs));
assertThat(result.get()).isFalse();
lhs.set(10);
assertThat(result.get()).isTrue();
rhs.set(10);
assertThat(result.get()).isFalse();
}
Aggregations