Search in sources :

Example 1 with DecorCaptionView

use of com.android.internal.widget.DecorCaptionView in project platform_frameworks_base by android.

the class DecorView method inflateDecorCaptionView.

private DecorCaptionView inflateDecorCaptionView(LayoutInflater inflater) {
    final Context context = getContext();
    // We make a copy of the inflater, so it has the right context associated with it.
    inflater = inflater.from(context);
    final DecorCaptionView view = (DecorCaptionView) inflater.inflate(R.layout.decor_caption, null);
    setDecorCaptionShade(context, view);
    return view;
}
Also used : Context(android.content.Context) DecorCaptionView(com.android.internal.widget.DecorCaptionView)

Example 2 with DecorCaptionView

use of com.android.internal.widget.DecorCaptionView in project platform_frameworks_base by android.

the class DecorView method createDecorCaptionView.

// Free floating overlapping windows require a caption.
private DecorCaptionView createDecorCaptionView(LayoutInflater inflater) {
    DecorCaptionView decorCaptionView = null;
    for (int i = getChildCount() - 1; i >= 0 && decorCaptionView == null; i--) {
        View view = getChildAt(i);
        if (view instanceof DecorCaptionView) {
            // The decor was most likely saved from a relaunch - so reuse it.
            decorCaptionView = (DecorCaptionView) view;
            removeViewAt(i);
        }
    }
    final WindowManager.LayoutParams attrs = mWindow.getAttributes();
    final boolean isApplication = attrs.type == TYPE_BASE_APPLICATION || attrs.type == TYPE_APPLICATION || attrs.type == TYPE_DRAWN_APPLICATION;
    // Only a non floating application window on one of the allowed workspaces can get a caption
    if (!mWindow.isFloating() && isApplication && StackId.hasWindowDecor(mStackId)) {
        // dark or the light button frame.
        if (decorCaptionView == null) {
            decorCaptionView = inflateDecorCaptionView(inflater);
        }
        decorCaptionView.setPhoneWindow(mWindow, true);
    } else {
        decorCaptionView = null;
    }
    // Tell the decor if it has a visible caption.
    enableCaption(decorCaptionView != null);
    return decorCaptionView;
}
Also used : DecorCaptionView(com.android.internal.widget.DecorCaptionView) View(android.view.View) ActionBarContextView(com.android.internal.widget.ActionBarContextView) DecorCaptionView(com.android.internal.widget.DecorCaptionView) Paint(android.graphics.Paint) WindowManager(android.view.WindowManager)

Example 3 with DecorCaptionView

use of com.android.internal.widget.DecorCaptionView in project android_frameworks_base by AOSPA.

the class DecorView method createDecorCaptionView.

// Free floating overlapping windows require a caption.
private DecorCaptionView createDecorCaptionView(LayoutInflater inflater) {
    DecorCaptionView decorCaptionView = null;
    for (int i = getChildCount() - 1; i >= 0 && decorCaptionView == null; i--) {
        View view = getChildAt(i);
        if (view instanceof DecorCaptionView) {
            // The decor was most likely saved from a relaunch - so reuse it.
            decorCaptionView = (DecorCaptionView) view;
            removeViewAt(i);
        }
    }
    final WindowManager.LayoutParams attrs = mWindow.getAttributes();
    final boolean isApplication = attrs.type == TYPE_BASE_APPLICATION || attrs.type == TYPE_APPLICATION || attrs.type == TYPE_DRAWN_APPLICATION;
    // Only a non floating application window on one of the allowed workspaces can get a caption
    if (!mWindow.isFloating() && isApplication && StackId.hasWindowDecor(mStackId)) {
        // dark or the light button frame.
        if (decorCaptionView == null) {
            decorCaptionView = inflateDecorCaptionView(inflater);
        }
        decorCaptionView.setPhoneWindow(mWindow, true);
    } else {
        decorCaptionView = null;
    }
    // Tell the decor if it has a visible caption.
    enableCaption(decorCaptionView != null);
    return decorCaptionView;
}
Also used : DecorCaptionView(com.android.internal.widget.DecorCaptionView) View(android.view.View) ActionBarContextView(com.android.internal.widget.ActionBarContextView) DecorCaptionView(com.android.internal.widget.DecorCaptionView) Paint(android.graphics.Paint) WindowManager(android.view.WindowManager)

Example 4 with DecorCaptionView

use of com.android.internal.widget.DecorCaptionView in project android_frameworks_base by ResurrectionRemix.

the class DecorView method createDecorCaptionView.

// Free floating overlapping windows require a caption.
private DecorCaptionView createDecorCaptionView(LayoutInflater inflater) {
    DecorCaptionView decorCaptionView = null;
    for (int i = getChildCount() - 1; i >= 0 && decorCaptionView == null; i--) {
        View view = getChildAt(i);
        if (view instanceof DecorCaptionView) {
            // The decor was most likely saved from a relaunch - so reuse it.
            decorCaptionView = (DecorCaptionView) view;
            removeViewAt(i);
        }
    }
    final WindowManager.LayoutParams attrs = mWindow.getAttributes();
    final boolean isApplication = attrs.type == TYPE_BASE_APPLICATION || attrs.type == TYPE_APPLICATION || attrs.type == TYPE_DRAWN_APPLICATION;
    // Only a non floating application window on one of the allowed workspaces can get a caption
    if (!mWindow.isFloating() && isApplication && StackId.hasWindowDecor(mStackId)) {
        // dark or the light button frame.
        if (decorCaptionView == null) {
            decorCaptionView = inflateDecorCaptionView(inflater);
        }
        decorCaptionView.setPhoneWindow(mWindow, true);
    } else {
        decorCaptionView = null;
    }
    // Tell the decor if it has a visible caption.
    enableCaption(decorCaptionView != null);
    return decorCaptionView;
}
Also used : DecorCaptionView(com.android.internal.widget.DecorCaptionView) View(android.view.View) ActionBarContextView(com.android.internal.widget.ActionBarContextView) DecorCaptionView(com.android.internal.widget.DecorCaptionView) Paint(android.graphics.Paint) WindowManager(android.view.WindowManager)

Example 5 with DecorCaptionView

use of com.android.internal.widget.DecorCaptionView in project android_frameworks_base by crdroidandroid.

the class DecorView method createDecorCaptionView.

// Free floating overlapping windows require a caption.
private DecorCaptionView createDecorCaptionView(LayoutInflater inflater) {
    DecorCaptionView decorCaptionView = null;
    for (int i = getChildCount() - 1; i >= 0 && decorCaptionView == null; i--) {
        View view = getChildAt(i);
        if (view instanceof DecorCaptionView) {
            // The decor was most likely saved from a relaunch - so reuse it.
            decorCaptionView = (DecorCaptionView) view;
            removeViewAt(i);
        }
    }
    final WindowManager.LayoutParams attrs = mWindow.getAttributes();
    final boolean isApplication = attrs.type == TYPE_BASE_APPLICATION || attrs.type == TYPE_APPLICATION || attrs.type == TYPE_DRAWN_APPLICATION;
    // Only a non floating application window on one of the allowed workspaces can get a caption
    if (!mWindow.isFloating() && isApplication && StackId.hasWindowDecor(mStackId)) {
        // dark or the light button frame.
        if (decorCaptionView == null) {
            decorCaptionView = inflateDecorCaptionView(inflater);
        }
        decorCaptionView.setPhoneWindow(mWindow, true);
    } else {
        decorCaptionView = null;
    }
    // Tell the decor if it has a visible caption.
    enableCaption(decorCaptionView != null);
    return decorCaptionView;
}
Also used : DecorCaptionView(com.android.internal.widget.DecorCaptionView) View(android.view.View) ActionBarContextView(com.android.internal.widget.ActionBarContextView) DecorCaptionView(com.android.internal.widget.DecorCaptionView) Paint(android.graphics.Paint) WindowManager(android.view.WindowManager)

Aggregations

DecorCaptionView (com.android.internal.widget.DecorCaptionView)10 Context (android.content.Context)5 Paint (android.graphics.Paint)5 View (android.view.View)5 WindowManager (android.view.WindowManager)5 ActionBarContextView (com.android.internal.widget.ActionBarContextView)5