Search in sources :

Example 1 with ConfigGenerator

use of com.android.layoutlib.bridge.intensive.setup.ConfigGenerator in project platform_frameworks_base by android.

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");
}
Also used : SessionParams(com.android.ide.common.rendering.api.SessionParams) ConfigGenerator(com.android.layoutlib.bridge.intensive.setup.ConfigGenerator) LayoutLibTestCallback(com.android.layoutlib.bridge.intensive.setup.LayoutLibTestCallback) LayoutPullParser(com.android.layoutlib.bridge.intensive.setup.LayoutPullParser) Test(org.junit.Test)

Example 2 with ConfigGenerator

use of com.android.layoutlib.bridge.intensive.setup.ConfigGenerator in project android_frameworks_base by DirtyUnicorns.

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");
}
Also used : SessionParams(com.android.ide.common.rendering.api.SessionParams) ConfigGenerator(com.android.layoutlib.bridge.intensive.setup.ConfigGenerator) LayoutLibTestCallback(com.android.layoutlib.bridge.intensive.setup.LayoutLibTestCallback) LayoutPullParser(com.android.layoutlib.bridge.intensive.setup.LayoutPullParser) Test(org.junit.Test)

Example 3 with ConfigGenerator

use of com.android.layoutlib.bridge.intensive.setup.ConfigGenerator in project android_frameworks_base by AOSPA.

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");
}
Also used : SessionParams(com.android.ide.common.rendering.api.SessionParams) ConfigGenerator(com.android.layoutlib.bridge.intensive.setup.ConfigGenerator) LayoutLibTestCallback(com.android.layoutlib.bridge.intensive.setup.LayoutLibTestCallback) LayoutPullParser(com.android.layoutlib.bridge.intensive.setup.LayoutPullParser) Test(org.junit.Test)

Example 4 with ConfigGenerator

use of com.android.layoutlib.bridge.intensive.setup.ConfigGenerator 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");
}
Also used : SessionParams(com.android.ide.common.rendering.api.SessionParams) ConfigGenerator(com.android.layoutlib.bridge.intensive.setup.ConfigGenerator) LayoutLibTestCallback(com.android.layoutlib.bridge.intensive.setup.LayoutLibTestCallback) LayoutPullParser(com.android.layoutlib.bridge.intensive.setup.LayoutPullParser) Test(org.junit.Test)

Example 5 with ConfigGenerator

use of com.android.layoutlib.bridge.intensive.setup.ConfigGenerator 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");
}
Also used : SessionParams(com.android.ide.common.rendering.api.SessionParams) ConfigGenerator(com.android.layoutlib.bridge.intensive.setup.ConfigGenerator) LayoutLibTestCallback(com.android.layoutlib.bridge.intensive.setup.LayoutLibTestCallback) LayoutPullParser(com.android.layoutlib.bridge.intensive.setup.LayoutPullParser) Test(org.junit.Test)

Aggregations

SessionParams (com.android.ide.common.rendering.api.SessionParams)5 ConfigGenerator (com.android.layoutlib.bridge.intensive.setup.ConfigGenerator)5 LayoutLibTestCallback (com.android.layoutlib.bridge.intensive.setup.LayoutLibTestCallback)5 LayoutPullParser (com.android.layoutlib.bridge.intensive.setup.LayoutPullParser)5 Test (org.junit.Test)5