use of com.android.layoutlib.bridge.intensive.setup.LayoutLibTestCallback in project android_frameworks_base by ResurrectionRemix.
the class Main method createSessionParams.
private SessionParams createSessionParams(String layoutFileName, ConfigGenerator deviceConfig) throws ClassNotFoundException {
// Create the layout pull parser.
LayoutPullParser parser = createLayoutPullParser(layoutFileName);
// Create LayoutLibCallback.
LayoutLibTestCallback layoutLibCallback = new LayoutLibTestCallback(getLogger());
layoutLibCallback.initResources();
// Create session params.
return getSessionParams(parser, deviceConfig, layoutLibCallback, "AppTheme", true, RenderingMode.NORMAL, 22);
}
use of com.android.layoutlib.bridge.intensive.setup.LayoutLibTestCallback in project android_frameworks_base by ResurrectionRemix.
the class Main method testExpand.
/** Test expand_layout.xml */
@Test
public void testExpand() throws ClassNotFoundException {
// Create the layout pull parser.
LayoutPullParser parser = createLayoutPullParser("expand_vert_layout.xml");
// Create LayoutLibCallback.
LayoutLibTestCallback layoutLibCallback = new LayoutLibTestCallback(getLogger());
layoutLibCallback.initResources();
ConfigGenerator customConfigGenerator = new ConfigGenerator().setScreenWidth(300).setScreenHeight(20).setDensity(Density.XHIGH).setNavigation(Navigation.NONAV);
SessionParams params = getSessionParams(parser, customConfigGenerator, layoutLibCallback, "Theme.Material.Light.NoActionBar.Fullscreen", false, RenderingMode.V_SCROLL, 22);
renderAndVerify(params, "expand_vert_layout.png");
customConfigGenerator = new ConfigGenerator().setScreenWidth(20).setScreenHeight(300).setDensity(Density.XHIGH).setNavigation(Navigation.NONAV);
parser = createLayoutPullParser("expand_horz_layout.xml");
params = getSessionParams(parser, customConfigGenerator, layoutLibCallback, "Theme.Material.Light.NoActionBar.Fullscreen", false, RenderingMode.H_SCROLL, 22);
renderAndVerify(params, "expand_horz_layout.png");
}
use of com.android.layoutlib.bridge.intensive.setup.LayoutLibTestCallback in project android_frameworks_base by crdroidandroid.
the class Main method testVectorDrawable.
/**
* Test a vector drawable that uses trimStart and trimEnd. It also tests all the primitives
* for vector drawables (lines, moves and cubic and quadratic curves).
*/
@Test
public void testVectorDrawable() throws ClassNotFoundException {
// Create the layout pull parser.
LayoutPullParser parser = createLayoutPullParser("vector_drawable.xml");
// Create LayoutLibCallback.
LayoutLibTestCallback layoutLibCallback = new LayoutLibTestCallback(getLogger());
layoutLibCallback.initResources();
SessionParams params = getSessionParams(parser, ConfigGenerator.NEXUS_5, layoutLibCallback, "Theme.Material.NoActionBar.Fullscreen", false, RenderingMode.V_SCROLL, 22);
renderAndVerify(params, "vector_drawable.png", TimeUnit.SECONDS.toNanos(2));
}
use of com.android.layoutlib.bridge.intensive.setup.LayoutLibTestCallback in project android_frameworks_base by crdroidandroid.
the class Main method testExpand.
/** Test expand_layout.xml */
@Test
public void testExpand() throws ClassNotFoundException {
// Create the layout pull parser.
LayoutPullParser parser = createLayoutPullParser("expand_vert_layout.xml");
// Create LayoutLibCallback.
LayoutLibTestCallback layoutLibCallback = new LayoutLibTestCallback(getLogger());
layoutLibCallback.initResources();
ConfigGenerator customConfigGenerator = new ConfigGenerator().setScreenWidth(300).setScreenHeight(20).setDensity(Density.XHIGH).setNavigation(Navigation.NONAV);
SessionParams params = getSessionParams(parser, customConfigGenerator, layoutLibCallback, "Theme.Material.Light.NoActionBar.Fullscreen", false, RenderingMode.V_SCROLL, 22);
renderAndVerify(params, "expand_vert_layout.png");
customConfigGenerator = new ConfigGenerator().setScreenWidth(20).setScreenHeight(300).setDensity(Density.XHIGH).setNavigation(Navigation.NONAV);
parser = createLayoutPullParser("expand_horz_layout.xml");
params = getSessionParams(parser, customConfigGenerator, layoutLibCallback, "Theme.Material.Light.NoActionBar.Fullscreen", false, RenderingMode.H_SCROLL, 22);
renderAndVerify(params, "expand_horz_layout.png");
}
use of com.android.layoutlib.bridge.intensive.setup.LayoutLibTestCallback in project android_frameworks_base by crdroidandroid.
the class Main method createSessionParams.
private SessionParams createSessionParams(String layoutFileName, ConfigGenerator deviceConfig) throws ClassNotFoundException {
// Create the layout pull parser.
LayoutPullParser parser = createLayoutPullParser(layoutFileName);
// Create LayoutLibCallback.
LayoutLibTestCallback layoutLibCallback = new LayoutLibTestCallback(getLogger());
layoutLibCallback.initResources();
// Create session params.
return getSessionParams(parser, deviceConfig, layoutLibCallback, "AppTheme", true, RenderingMode.NORMAL, 22);
}
Aggregations