Search in sources :

Example 1 with SyncNlModel

use of com.android.tools.idea.uibuilder.SyncNlModel in project android by JetBrains.

the class SceneKeepDimensTest method setFakeResource.

private void setFakeResource(String dimension, String value) {
    Configuration configuration = Mockito.mock(Configuration.class);
    ResourceResolver resolver = Mockito.mock(ResourceResolver.class);
    ResourceValue resourceValue = Mockito.mock(ResourceValue.class);
    when(configuration.getResourceResolver()).thenReturn(resolver);
    when(configuration.getDensity()).thenReturn(Density.MEDIUM);
    when(resolver.findResValue(dimension, false)).thenReturn(resourceValue);
    when(resolver.resolveResValue(resourceValue)).thenReturn(resourceValue);
    when(resourceValue.getValue()).thenReturn(value);
    ((SyncNlModel) myModel).setConfiguration(configuration);
}
Also used : FolderConfiguration(com.android.ide.common.resources.configuration.FolderConfiguration) Configuration(com.android.tools.idea.configurations.Configuration) ResourceResolver(com.android.ide.common.resources.ResourceResolver) ResourceValue(com.android.ide.common.rendering.api.ResourceValue) SyncNlModel(com.android.tools.idea.uibuilder.SyncNlModel)

Aggregations

ResourceValue (com.android.ide.common.rendering.api.ResourceValue)1 ResourceResolver (com.android.ide.common.resources.ResourceResolver)1 FolderConfiguration (com.android.ide.common.resources.configuration.FolderConfiguration)1 Configuration (com.android.tools.idea.configurations.Configuration)1 SyncNlModel (com.android.tools.idea.uibuilder.SyncNlModel)1