Search in sources :

Example 6 with DecorCaptionView

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

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 7 with DecorCaptionView

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

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 8 with DecorCaptionView

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

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 9 with DecorCaptionView

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

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 10 with DecorCaptionView

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

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)

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