[android] #4800 - correct background offsets from attributes

This commit is contained in:
Tobrun
2016-04-26 20:54:57 +02:00
parent e2510fce79
commit bf493f96cd
7 changed files with 34 additions and 46 deletions

View File

@@ -49,14 +49,9 @@ public class MyLocationViewSettingsTest {
@Test
public void testBackgroundDrawable() {
Drawable backgroundDrawable = mock(Drawable.class);
locationViewSettings.setBackgroundDrawable(backgroundDrawable);
assertEquals("foreground should match", backgroundDrawable, locationViewSettings.getBackgroundDrawable());
}
@Test
public void testBackgroundOffset() {
int[] offset = new int[]{1, 2, 3, 4};
locationViewSettings.setBackgroundOffset(1, 2, 3, 4);
locationViewSettings.setBackgroundDrawable(backgroundDrawable, offset);
assertEquals("foreground should match", backgroundDrawable, locationViewSettings.getBackgroundDrawable());
assertTrue("offsets should match", Arrays.equals(offset, locationViewSettings.getBackgroundOffset()));
}
@@ -68,7 +63,7 @@ public class MyLocationViewSettingsTest {
}
@Test
public void testBackgroundTint(){
public void testBackgroundTint() {
int color = Color.RED;
locationViewSettings.setBackgroundTintColor(Color.RED);
assertEquals("color should match", color, locationViewSettings.getBackgroundTintColor());