Search in sources :

Example 1 with IWindowManagerImpl

use of android.view.IWindowManagerImpl in project android_frameworks_base by ParanoidAndroid.

the class RenderSessionImpl method init.

/**
     * Initializes and acquires the scene, creating various Android objects such as context,
     * inflater, and parser.
     *
     * @param timeout the time to wait if another rendering is happening.
     *
     * @return whether the scene was prepared
     *
     * @see #acquire(long)
     * @see #release()
     */
@Override
public Result init(long timeout) {
    Result result = super.init(timeout);
    if (result.isSuccess() == false) {
        return result;
    }
    SessionParams params = getParams();
    BridgeContext context = getContext();
    RenderResources resources = getParams().getResources();
    DisplayMetrics metrics = getContext().getMetrics();
    // use default of true in case it's not found to use alpha by default
    mIsAlphaChannelImage = getBooleanThemeValue(resources, "windowIsFloating", true);
    mWindowIsFloating = getBooleanThemeValue(resources, "windowIsFloating", true);
    findBackground(resources);
    findStatusBar(resources, metrics);
    findActionBar(resources, metrics);
    findNavigationBar(resources, metrics);
    // FIXME: find those out, and possibly add them to the render params
    boolean hasSystemNavBar = true;
    boolean hasNavigationBar = true;
    IWindowManager iwm = new IWindowManagerImpl(getContext().getConfiguration(), metrics, Surface.ROTATION_0, hasSystemNavBar, hasNavigationBar);
    WindowManagerGlobal_Delegate.setWindowManagerService(iwm);
    // build the inflater and parser.
    mInflater = new BridgeInflater(context, params.getProjectCallback());
    context.setBridgeInflater(mInflater);
    mBlockParser = new BridgeXmlBlockParser(params.getLayoutDescription(), context, false);
    return SUCCESS.createResult();
}
Also used : SessionParams(com.android.ide.common.rendering.api.SessionParams) BridgeInflater(android.view.BridgeInflater) IWindowManager(android.view.IWindowManager) IWindowManagerImpl(android.view.IWindowManagerImpl) RenderResources(com.android.ide.common.rendering.api.RenderResources) BridgeContext(com.android.layoutlib.bridge.android.BridgeContext) DisplayMetrics(android.util.DisplayMetrics) BridgeXmlBlockParser(com.android.layoutlib.bridge.android.BridgeXmlBlockParser) Result(com.android.ide.common.rendering.api.Result)

Example 2 with IWindowManagerImpl

use of android.view.IWindowManagerImpl in project android_frameworks_base by DirtyUnicorns.

the class RenderSessionImpl method init.

/**
     * Initializes and acquires the scene, creating various Android objects such as context,
     * inflater, and parser.
     *
     * @param timeout the time to wait if another rendering is happening.
     *
     * @return whether the scene was prepared
     *
     * @see #acquire(long)
     * @see #release()
     */
@Override
public Result init(long timeout) {
    Result result = super.init(timeout);
    if (!result.isSuccess()) {
        return result;
    }
    SessionParams params = getParams();
    BridgeContext context = getContext();
    // use default of true in case it's not found to use alpha by default
    mIsAlphaChannelImage = ResourceHelper.getBooleanThemeValue(params.getResources(), "windowIsFloating", true, true);
    mLayoutBuilder = new Layout.Builder(params, context);
    // FIXME: find those out, and possibly add them to the render params
    boolean hasNavigationBar = true;
    //noinspection ConstantConditions
    IWindowManager iwm = new IWindowManagerImpl(getContext().getConfiguration(), context.getMetrics(), Surface.ROTATION_0, hasNavigationBar);
    WindowManagerGlobal_Delegate.setWindowManagerService(iwm);
    // build the inflater and parser.
    mInflater = new BridgeInflater(context, params.getLayoutlibCallback());
    context.setBridgeInflater(mInflater);
    mBlockParser = new BridgeXmlBlockParser(params.getLayoutDescription(), context, false);
    return SUCCESS.createResult();
}
Also used : SessionParams(com.android.ide.common.rendering.api.SessionParams) BridgeInflater(android.view.BridgeInflater) LinearLayout(android.widget.LinearLayout) FrameLayout(android.widget.FrameLayout) IWindowManager(android.view.IWindowManager) IWindowManagerImpl(android.view.IWindowManagerImpl) BridgeContext(com.android.layoutlib.bridge.android.BridgeContext) BridgeXmlBlockParser(com.android.layoutlib.bridge.android.BridgeXmlBlockParser) Result(com.android.ide.common.rendering.api.Result)

Example 3 with IWindowManagerImpl

use of android.view.IWindowManagerImpl in project platform_frameworks_base by android.

the class RenderSessionImpl method init.

/**
     * Initializes and acquires the scene, creating various Android objects such as context,
     * inflater, and parser.
     *
     * @param timeout the time to wait if another rendering is happening.
     *
     * @return whether the scene was prepared
     *
     * @see #acquire(long)
     * @see #release()
     */
@Override
public Result init(long timeout) {
    Result result = super.init(timeout);
    if (!result.isSuccess()) {
        return result;
    }
    SessionParams params = getParams();
    BridgeContext context = getContext();
    // use default of true in case it's not found to use alpha by default
    mIsAlphaChannelImage = ResourceHelper.getBooleanThemeValue(params.getResources(), "windowIsFloating", true, true);
    mLayoutBuilder = new Layout.Builder(params, context);
    // FIXME: find those out, and possibly add them to the render params
    boolean hasNavigationBar = true;
    //noinspection ConstantConditions
    IWindowManager iwm = new IWindowManagerImpl(getContext().getConfiguration(), context.getMetrics(), Surface.ROTATION_0, hasNavigationBar);
    WindowManagerGlobal_Delegate.setWindowManagerService(iwm);
    // build the inflater and parser.
    mInflater = new BridgeInflater(context, params.getLayoutlibCallback());
    context.setBridgeInflater(mInflater);
    mBlockParser = new BridgeXmlBlockParser(params.getLayoutDescription(), context, false);
    return SUCCESS.createResult();
}
Also used : SessionParams(com.android.ide.common.rendering.api.SessionParams) BridgeInflater(android.view.BridgeInflater) LinearLayout(android.widget.LinearLayout) FrameLayout(android.widget.FrameLayout) IWindowManager(android.view.IWindowManager) IWindowManagerImpl(android.view.IWindowManagerImpl) BridgeContext(com.android.layoutlib.bridge.android.BridgeContext) BridgeXmlBlockParser(com.android.layoutlib.bridge.android.BridgeXmlBlockParser) Result(com.android.ide.common.rendering.api.Result)

Example 4 with IWindowManagerImpl

use of android.view.IWindowManagerImpl in project android_frameworks_base by crdroidandroid.

the class RenderSessionImpl method init.

/**
     * Initializes and acquires the scene, creating various Android objects such as context,
     * inflater, and parser.
     *
     * @param timeout the time to wait if another rendering is happening.
     *
     * @return whether the scene was prepared
     *
     * @see #acquire(long)
     * @see #release()
     */
@Override
public Result init(long timeout) {
    Result result = super.init(timeout);
    if (!result.isSuccess()) {
        return result;
    }
    SessionParams params = getParams();
    BridgeContext context = getContext();
    // use default of true in case it's not found to use alpha by default
    mIsAlphaChannelImage = ResourceHelper.getBooleanThemeValue(params.getResources(), "windowIsFloating", true, true);
    mLayoutBuilder = new Layout.Builder(params, context);
    // FIXME: find those out, and possibly add them to the render params
    boolean hasNavigationBar = true;
    //noinspection ConstantConditions
    IWindowManager iwm = new IWindowManagerImpl(getContext().getConfiguration(), context.getMetrics(), Surface.ROTATION_0, hasNavigationBar);
    WindowManagerGlobal_Delegate.setWindowManagerService(iwm);
    // build the inflater and parser.
    mInflater = new BridgeInflater(context, params.getLayoutlibCallback());
    context.setBridgeInflater(mInflater);
    mBlockParser = new BridgeXmlBlockParser(params.getLayoutDescription(), context, false);
    return SUCCESS.createResult();
}
Also used : SessionParams(com.android.ide.common.rendering.api.SessionParams) BridgeInflater(android.view.BridgeInflater) LinearLayout(android.widget.LinearLayout) FrameLayout(android.widget.FrameLayout) IWindowManager(android.view.IWindowManager) IWindowManagerImpl(android.view.IWindowManagerImpl) BridgeContext(com.android.layoutlib.bridge.android.BridgeContext) BridgeXmlBlockParser(com.android.layoutlib.bridge.android.BridgeXmlBlockParser) Result(com.android.ide.common.rendering.api.Result)

Example 5 with IWindowManagerImpl

use of android.view.IWindowManagerImpl in project android_frameworks_base by AOSPA.

the class RenderSessionImpl method init.

/**
     * Initializes and acquires the scene, creating various Android objects such as context,
     * inflater, and parser.
     *
     * @param timeout the time to wait if another rendering is happening.
     *
     * @return whether the scene was prepared
     *
     * @see #acquire(long)
     * @see #release()
     */
@Override
public Result init(long timeout) {
    Result result = super.init(timeout);
    if (!result.isSuccess()) {
        return result;
    }
    SessionParams params = getParams();
    BridgeContext context = getContext();
    // use default of true in case it's not found to use alpha by default
    mIsAlphaChannelImage = ResourceHelper.getBooleanThemeValue(params.getResources(), "windowIsFloating", true, true);
    mLayoutBuilder = new Layout.Builder(params, context);
    // FIXME: find those out, and possibly add them to the render params
    boolean hasNavigationBar = true;
    //noinspection ConstantConditions
    IWindowManager iwm = new IWindowManagerImpl(getContext().getConfiguration(), context.getMetrics(), Surface.ROTATION_0, hasNavigationBar);
    WindowManagerGlobal_Delegate.setWindowManagerService(iwm);
    // build the inflater and parser.
    mInflater = new BridgeInflater(context, params.getLayoutlibCallback());
    context.setBridgeInflater(mInflater);
    mBlockParser = new BridgeXmlBlockParser(params.getLayoutDescription(), context, false);
    return SUCCESS.createResult();
}
Also used : SessionParams(com.android.ide.common.rendering.api.SessionParams) BridgeInflater(android.view.BridgeInflater) LinearLayout(android.widget.LinearLayout) FrameLayout(android.widget.FrameLayout) IWindowManager(android.view.IWindowManager) IWindowManagerImpl(android.view.IWindowManagerImpl) BridgeContext(com.android.layoutlib.bridge.android.BridgeContext) BridgeXmlBlockParser(com.android.layoutlib.bridge.android.BridgeXmlBlockParser) Result(com.android.ide.common.rendering.api.Result)

Aggregations

BridgeInflater (android.view.BridgeInflater)6 IWindowManager (android.view.IWindowManager)6 IWindowManagerImpl (android.view.IWindowManagerImpl)6 Result (com.android.ide.common.rendering.api.Result)6 SessionParams (com.android.ide.common.rendering.api.SessionParams)6 BridgeContext (com.android.layoutlib.bridge.android.BridgeContext)6 BridgeXmlBlockParser (com.android.layoutlib.bridge.android.BridgeXmlBlockParser)6 FrameLayout (android.widget.FrameLayout)5 LinearLayout (android.widget.LinearLayout)5 DisplayMetrics (android.util.DisplayMetrics)1 RenderResources (com.android.ide.common.rendering.api.RenderResources)1