use of org.apmem.tools.layouts.logic.ConfigDefinition in project android-flowlayout by ApmeM.
the class LineDefinitionTests method CanFit_LengthMoreThenRemainingIsNotOk.
@Test
public void CanFit_LengthMoreThenRemainingIsNotOk() {
ViewDefinition view1 = CreateView(12, 34);
ViewDefinition view2 = CreateView(56, 78);
ConfigDefinition config = new ConfigDefinition();
config.setMaxWidth(100);
LineDefinition def = new LineDefinition(config);
def.addView(view1);
def.addView(view2);
boolean canFit = def.canFit(view2);
Assert.assertFalse(canFit);
}
use of org.apmem.tools.layouts.logic.ConfigDefinition in project android-flowlayout by ApmeM.
the class LineDefinitionTests method AddView_AddViewIntoList.
@Test
public void AddView_AddViewIntoList() {
ViewDefinition view1 = CreateView(12, 34);
ViewDefinition view2 = CreateView(56, 78);
ConfigDefinition config = new ConfigDefinition();
config.setMaxWidth(100);
LineDefinition def = new LineDefinition(config);
def.addView(view1);
def.addView(view2);
Assert.assertEquals(view1, def.getViews().get(0));
Assert.assertEquals(view2, def.getViews().get(1));
}
use of org.apmem.tools.layouts.logic.ConfigDefinition in project android-flowlayout by ApmeM.
the class LineDefinitionTests method AddView_SetThicknessToMaxBetweenThickness.
@Test
public void AddView_SetThicknessToMaxBetweenThickness() {
ViewDefinition view1 = CreateView(12, 34);
ViewDefinition view2 = CreateView(56, 78);
ConfigDefinition config = new ConfigDefinition();
config.setMaxWidth(100);
LineDefinition def = new LineDefinition(config);
def.addView(view1);
def.addView(view2);
Assert.assertEquals(78, def.getLineThickness());
}
use of org.apmem.tools.layouts.logic.ConfigDefinition in project android-flowlayout by ApmeM.
the class LineDefinitionTests method CanFit_LengthLessThenRemainingIsOk.
@Test
public void CanFit_LengthLessThenRemainingIsOk() {
ViewDefinition view1 = CreateView(12, 34);
ViewDefinition view2 = CreateView(56, 78);
ConfigDefinition config = new ConfigDefinition();
config.setMaxWidth(100);
LineDefinition def = new LineDefinition(config);
def.addView(view1);
def.addView(view2);
boolean canFit = def.canFit(view1);
Assert.assertTrue(canFit);
}
use of org.apmem.tools.layouts.logic.ConfigDefinition in project android-flowlayout by ApmeM.
the class LineDefinitionTests method AddView_TakesLayoutMarginsIntoAccount.
@Test
public void AddView_TakesLayoutMarginsIntoAccount() {
ViewDefinition view1 = CreateView(12, 34);
ViewDefinition view2 = CreateView(56, 78);
view1.setMargins(1, 1, 1, 1);
view2.setMargins(1, 1, 1, 1);
ConfigDefinition config = new ConfigDefinition();
config.setMaxWidth(100);
LineDefinition def = new LineDefinition(config);
def.addView(view1);
def.addView(view2);
Assert.assertEquals(72, def.getLineLength());
Assert.assertEquals(80, def.getLineThickness());
}
Aggregations