use of com.android.tools.idea.uibuilder.property.editors.NlBaseComponentEditor in project android by JetBrains.
the class ProgressBarInspectorProviderTest method testChangingIndeterminateChangesVisibilityOfEditors.
public void testChangingIndeterminateChangesVisibilityOfEditors() {
List<NlComponent> components = ImmutableList.of(myProgressBar);
Map<String, NlProperty> properties = getPropertyMap(components);
assertThat(myProvider.isApplicable(components, properties, myPropertiesManager)).isTrue();
InspectorComponent inspector = myProvider.createCustomInspector(components, properties, myPropertiesManager);
inspector.refresh();
assertThat(isEditorVisible(inspector, ATTR_STYLE, "")).isTrue();
assertThat(isEditorVisible(inspector, ATTR_PROGRESS_DRAWABLE)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_INDETERMINATE_DRAWABLE)).isFalse();
assertThat(isEditorVisible(inspector, ATTR_PROGRESS_TINT)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_INDETERMINATE_TINT)).isFalse();
assertThat(isEditorVisible(inspector, ATTR_MAXIMUM)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_PROGRESS)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_VISIBILITY)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_VISIBILITY, TOOLS_URI)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_INDETERMINATE)).isTrue();
NlBaseComponentEditor indeterminateEditor = (NlBaseComponentEditor) getEditor(inspector, ATTR_INDETERMINATE, ANDROID_URI);
indeterminateEditor.stopEditing("true");
assertThat(isEditorVisible(inspector, ATTR_STYLE, "")).isTrue();
assertThat(isEditorVisible(inspector, ATTR_PROGRESS_DRAWABLE)).isFalse();
assertThat(isEditorVisible(inspector, ATTR_INDETERMINATE_DRAWABLE)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_PROGRESS_TINT)).isFalse();
assertThat(isEditorVisible(inspector, ATTR_INDETERMINATE_TINT)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_MAXIMUM)).isFalse();
assertThat(isEditorVisible(inspector, ATTR_PROGRESS)).isFalse();
assertThat(isEditorVisible(inspector, ATTR_VISIBILITY)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_VISIBILITY, TOOLS_URI)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_INDETERMINATE)).isTrue();
indeterminateEditor.stopEditing("false");
assertThat(isEditorVisible(inspector, ATTR_STYLE, "")).isTrue();
assertThat(isEditorVisible(inspector, ATTR_PROGRESS_DRAWABLE)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_INDETERMINATE_DRAWABLE)).isFalse();
assertThat(isEditorVisible(inspector, ATTR_PROGRESS_TINT)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_INDETERMINATE_TINT)).isFalse();
assertThat(isEditorVisible(inspector, ATTR_MAXIMUM)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_PROGRESS)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_VISIBILITY)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_VISIBILITY, TOOLS_URI)).isTrue();
assertThat(isEditorVisible(inspector, ATTR_INDETERMINATE)).isTrue();
}
Aggregations