Search in sources :

Example 11 with FloatingActionMode

use of com.android.internal.view.FloatingActionMode in project android_frameworks_base by DirtyUnicorns.

the class StatusBarWindowView method createFloatingActionMode.

private ActionMode createFloatingActionMode(View originatingView, ActionMode.Callback2 callback) {
    if (mFloatingActionMode != null) {
        mFloatingActionMode.finish();
    }
    cleanupFloatingActionModeViews();
    final FloatingActionMode mode = new FloatingActionMode(mContext, callback, originatingView);
    mFloatingActionModeOriginatingView = originatingView;
    mFloatingToolbarPreDrawListener = new ViewTreeObserver.OnPreDrawListener() {

        @Override
        public boolean onPreDraw() {
            mode.updateViewLocationInWindow();
            return true;
        }
    };
    return mode;
}
Also used : FloatingActionMode(com.android.internal.view.FloatingActionMode) ViewTreeObserver(android.view.ViewTreeObserver)

Example 12 with FloatingActionMode

use of com.android.internal.view.FloatingActionMode in project android_frameworks_base by AOSPA.

the class StatusBarWindowView method createFloatingActionMode.

private ActionMode createFloatingActionMode(View originatingView, ActionMode.Callback2 callback) {
    if (mFloatingActionMode != null) {
        mFloatingActionMode.finish();
    }
    cleanupFloatingActionModeViews();
    final FloatingActionMode mode = new FloatingActionMode(mContext, callback, originatingView);
    mFloatingActionModeOriginatingView = originatingView;
    mFloatingToolbarPreDrawListener = new ViewTreeObserver.OnPreDrawListener() {

        @Override
        public boolean onPreDraw() {
            mode.updateViewLocationInWindow();
            return true;
        }
    };
    return mode;
}
Also used : FloatingActionMode(com.android.internal.view.FloatingActionMode) ViewTreeObserver(android.view.ViewTreeObserver)

Example 13 with FloatingActionMode

use of com.android.internal.view.FloatingActionMode in project android_frameworks_base by AOSPA.

the class StatusBarWindowView method setHandledFloatingActionMode.

private void setHandledFloatingActionMode(ActionMode mode) {
    mFloatingActionMode = mode;
    mFloatingToolbar = new FloatingToolbar(mContext, mFakeWindow);
    ((FloatingActionMode) mFloatingActionMode).setFloatingToolbar(mFloatingToolbar);
    // Will show the floating toolbar if necessary.
    mFloatingActionMode.invalidate();
    mFloatingActionModeOriginatingView.getViewTreeObserver().addOnPreDrawListener(mFloatingToolbarPreDrawListener);
}
Also used : FloatingToolbar(com.android.internal.widget.FloatingToolbar) FloatingActionMode(com.android.internal.view.FloatingActionMode)

Example 14 with FloatingActionMode

use of com.android.internal.view.FloatingActionMode in project android_frameworks_base by AOSPA.

the class DecorView method createFloatingActionMode.

private ActionMode createFloatingActionMode(View originatingView, ActionMode.Callback2 callback) {
    if (mFloatingActionMode != null) {
        mFloatingActionMode.finish();
    }
    cleanupFloatingActionModeViews();
    final FloatingActionMode mode = new FloatingActionMode(mContext, callback, originatingView);
    mFloatingActionModeOriginatingView = originatingView;
    mFloatingToolbarPreDrawListener = new ViewTreeObserver.OnPreDrawListener() {

        @Override
        public boolean onPreDraw() {
            mode.updateViewLocationInWindow();
            return true;
        }
    };
    return mode;
}
Also used : FloatingActionMode(com.android.internal.view.FloatingActionMode) ViewTreeObserver(android.view.ViewTreeObserver)

Example 15 with FloatingActionMode

use of com.android.internal.view.FloatingActionMode in project android_frameworks_base by ResurrectionRemix.

the class DecorView method createFloatingActionMode.

private ActionMode createFloatingActionMode(View originatingView, ActionMode.Callback2 callback) {
    if (mFloatingActionMode != null) {
        mFloatingActionMode.finish();
    }
    cleanupFloatingActionModeViews();
    final FloatingActionMode mode = new FloatingActionMode(mContext, callback, originatingView);
    mFloatingActionModeOriginatingView = originatingView;
    mFloatingToolbarPreDrawListener = new ViewTreeObserver.OnPreDrawListener() {

        @Override
        public boolean onPreDraw() {
            mode.updateViewLocationInWindow();
            return true;
        }
    };
    return mode;
}
Also used : FloatingActionMode(com.android.internal.view.FloatingActionMode) ViewTreeObserver(android.view.ViewTreeObserver)

Aggregations

FloatingActionMode (com.android.internal.view.FloatingActionMode)20 ViewTreeObserver (android.view.ViewTreeObserver)10 FloatingToolbar (com.android.internal.widget.FloatingToolbar)10