Search in sources :

Example 21 with ViewManager

use of android.view.ViewManager in project XobotOS by xamarin.

the class Activity method makeVisible.

void makeVisible() {
    if (!mWindowAdded) {
        ViewManager wm = getWindowManager();
        wm.addView(mDecor, getWindow().getAttributes());
        mWindowAdded = true;
    }
    mDecor.setVisibility(View.VISIBLE);
}
Also used : ViewManager(android.view.ViewManager)

Example 22 with ViewManager

use of android.view.ViewManager in project XobotOS by xamarin.

the class ActivityThread method handleResumeActivity.

final void handleResumeActivity(IBinder token, boolean clearHide, boolean isForward) {
    // If we are getting ready to gc after going to the background, well
    // we are back active so skip it.
    unscheduleGcIdler();
    ActivityClientRecord r = performResumeActivity(token, clearHide);
    if (r != null) {
        final Activity a = r.activity;
        if (localLOGV)
            Slog.v(TAG, "Resume " + r + " started activity: " + a.mStartedActivity + ", hideForNow: " + r.hideForNow + ", finished: " + a.mFinished);
        final int forwardBit = isForward ? WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION : 0;
        // If the window hasn't yet been added to the window manager,
        // and this guy didn't finish itself or start another activity,
        // then go ahead and add the window.
        boolean willBeVisible = !a.mStartedActivity;
        if (!willBeVisible) {
            try {
                willBeVisible = ActivityManagerNative.getDefault().willActivityBeVisible(a.getActivityToken());
            } catch (RemoteException e) {
            }
        }
        if (r.window == null && !a.mFinished && willBeVisible) {
            r.window = r.activity.getWindow();
            View decor = r.window.getDecorView();
            decor.setVisibility(View.INVISIBLE);
            ViewManager wm = a.getWindowManager();
            WindowManager.LayoutParams l = r.window.getAttributes();
            a.mDecor = decor;
            l.type = WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
            l.softInputMode |= forwardBit;
            if (a.mVisibleFromClient) {
                a.mWindowAdded = true;
                wm.addView(decor, l);
            }
        // If the window has already been added, but during resume
        // we started another activity, then don't yet make the
        // window visible.
        } else if (!willBeVisible) {
            if (localLOGV)
                Slog.v(TAG, "Launch " + r + " mStartedActivity set");
            r.hideForNow = true;
        }
        // Get rid of anything left hanging around.
        cleanUpPendingRemoveWindows(r);
        // simply finishing, and we are not starting another activity.
        if (!r.activity.mFinished && willBeVisible && r.activity.mDecor != null && !r.hideForNow) {
            if (r.newConfig != null) {
                if (DEBUG_CONFIGURATION)
                    Slog.v(TAG, "Resuming activity " + r.activityInfo.name + " with newConfig " + r.newConfig);
                performConfigurationChanged(r.activity, r.newConfig);
                r.newConfig = null;
            }
            if (localLOGV)
                Slog.v(TAG, "Resuming " + r + " with isForward=" + isForward);
            WindowManager.LayoutParams l = r.window.getAttributes();
            if ((l.softInputMode & WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION) != forwardBit) {
                l.softInputMode = (l.softInputMode & (~WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION)) | forwardBit;
                if (r.activity.mVisibleFromClient) {
                    ViewManager wm = a.getWindowManager();
                    View decor = r.window.getDecorView();
                    wm.updateViewLayout(decor, l);
                }
            }
            r.activity.mVisibleFromServer = true;
            mNumVisibleActivities++;
            if (r.activity.mVisibleFromClient) {
                r.activity.makeVisible();
            }
        }
        if (!r.onlyLocalRequest) {
            r.nextIdle = mNewActivities;
            mNewActivities = r;
            if (localLOGV)
                Slog.v(TAG, "Scheduling idle handler for " + r);
            Looper.myQueue().addIdleHandler(new Idler());
        }
        r.onlyLocalRequest = false;
    } else {
        // just end this activity.
        try {
            ActivityManagerNative.getDefault().finishActivity(token, Activity.RESULT_CANCELED, null);
        } catch (RemoteException ex) {
        }
    }
}
Also used : ViewManager(android.view.ViewManager) RemoteException(android.os.RemoteException) View(android.view.View) WindowManager(android.view.WindowManager)

Example 23 with ViewManager

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

the class Activity method makeVisible.

void makeVisible() {
    if (!mWindowAdded) {
        ViewManager wm = getWindowManager();
        wm.addView(mDecor, getWindow().getAttributes());
        mWindowAdded = true;
        DecorView.setAddedToWindow(mDecor);
    }
    mDecor.setVisibility(View.VISIBLE);
}
Also used : ViewManager(android.view.ViewManager)

Example 24 with ViewManager

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

the class PhoneWindow method closeAllPanels.

@Override
public final void closeAllPanels() {
    final ViewManager wm = getWindowManager();
    if (wm == null) {
        return;
    }
    final PanelFeatureState[] panels = mPanels;
    final int N = panels != null ? panels.length : 0;
    for (int i = 0; i < N; i++) {
        final PanelFeatureState panel = panels[i];
        if (panel != null) {
            closePanel(panel, true);
        }
    }
    closeContextMenu();
}
Also used : ViewManager(android.view.ViewManager)

Example 25 with ViewManager

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

the class Activity method makeVisible.

void makeVisible() {
    if (!mWindowAdded) {
        ViewManager wm = getWindowManager();
        wm.addView(mDecor, getWindow().getAttributes());
        mWindowAdded = true;
        DecorView.setAddedToWindow(mDecor);
    }
    mDecor.setVisibility(View.VISIBLE);
}
Also used : ViewManager(android.view.ViewManager)

Aggregations

ViewManager (android.view.ViewManager)32 WindowManager (android.view.WindowManager)13 RemoteException (android.os.RemoteException)7 View (android.view.View)7 IWindowManager (android.view.IWindowManager)6 LayoutParams (android.view.WindowManager.LayoutParams)6 ViewRootImpl (android.view.ViewRootImpl)5 WebView (android.webkit.WebView)5 DecorView (com.android.internal.policy.DecorView)4