当前位置: 首页>>代码示例>>Java>>正文


Java WindowManager.removeView方法代码示例

本文整理汇总了Java中android.view.WindowManager.removeView方法的典型用法代码示例。如果您正苦于以下问题:Java WindowManager.removeView方法的具体用法?Java WindowManager.removeView怎么用?Java WindowManager.removeView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.WindowManager的用法示例。


在下文中一共展示了WindowManager.removeView方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: close

import android.view.WindowManager; //导入方法依赖的package包/类
public void close() {
    if (parentActivity == null) {
        return;
    }
    showProgress = 1.0f;
    currentSticker = null;
    isVisible = false;
    AndroidUtilities.unlockOrientation(parentActivity);
    AndroidUtilities.runOnUIThread(new Runnable() {
        @Override
        public void run() {
            centerImage.setImageBitmap((Bitmap)null);
        }
    });
    try {
        if (windowView.getParent() != null) {
            WindowManager wm = (WindowManager) parentActivity.getSystemService(Context.WINDOW_SERVICE);
            wm.removeView(windowView);
        }
    } catch (Exception e) {
        FileLog.e("tmessages", e);
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:24,代码来源:StickerPreviewViewer.java

示例2: closePhoto

import android.view.WindowManager; //导入方法依赖的package包/类
public void closePhoto() {
    NotificationCenter.getInstance().removeObserver(this, NotificationCenter.messagesDeleted);
    NotificationCenter.getInstance().removeObserver(this, NotificationCenter.didCreatedNewDeleteTask);
    if (parentActivity == null) {
        return;
    }
    currentMessageObject = null;
    isVisible = false;
    AndroidUtilities.unlockOrientation(parentActivity);
    AndroidUtilities.runOnUIThread(new Runnable() {
        @Override
        public void run() {
            centerImage.setImageBitmap((Bitmap)null);
        }
    });
    try {
        if (windowView.getParent() != null) {
            WindowManager wm = (WindowManager) parentActivity.getSystemService(Context.WINDOW_SERVICE);
            wm.removeView(windowView);
        }
    } catch (Exception e) {
        FileLog.e("tmessages", e);
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:25,代码来源:SecretPhotoViewer.java

示例3: removeView

import android.view.WindowManager; //导入方法依赖的package包/类
private void removeView() {

        if (mQuickActionViewLayout != null) {
            WindowManager manager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
            if (checkAttachedToWindow(mQuickActionViewLayout)) {
                manager.removeView(mQuickActionViewLayout);
            }
            mQuickActionViewLayout = null;
            mShown = false;
        }

        if (mClickedView != null) {
            ViewParent parent = mClickedView.getParent();
            if (parent instanceof View) {
                parent.requestDisallowInterceptTouchEvent(false);
            }
        }
    }
 
开发者ID:ovenbits,项目名称:QuickActionView,代码行数:19,代码来源:QuickActionView.java

示例4: closePanel

import android.view.WindowManager; //导入方法依赖的package包/类
private void closePanel(PanelFeatureState st, boolean doCallback) {
    if (doCallback && st.featureId == 0 && this.mDecorContentParent != null && this.mDecorContentParent.isOverflowMenuShowing()) {
        checkCloseActionMenu(st.menu);
        return;
    }
    WindowManager wm = (WindowManager) this.mContext.getSystemService("window");
    if (!(wm == null || !st.isOpen || st.decorView == null)) {
        wm.removeView(st.decorView);
        if (doCallback) {
            callOnPanelClosed(st.featureId, st, null);
        }
    }
    st.isPrepared = false;
    st.isHandled = false;
    st.isOpen = false;
    st.shownPanelView = null;
    st.refreshDecorView = true;
    if (this.mPreparedPanel == st) {
        this.mPreparedPanel = null;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:22,代码来源:AppCompatDelegateImplV7.java

示例5: showDialog

import android.view.WindowManager; //导入方法依赖的package包/类
protected void showDialog(Context context) {
    final WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    int h = getNavbarHeight(context);
    int w = WindowManager.LayoutParams.MATCH_PARENT;
    WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(w, h, WindowManager.LayoutParams.TYPE_TOAST, 0, PixelFormat.TRANSLUCENT);
    layoutParams.gravity = Gravity.BOTTOM;

    ViewGroup viewGroup;
    if (mType == LIGHT) {
        viewGroup = getLightPanel(context);
    } else {
        viewGroup = getVolumePanel(context);
    }

    if (lightPanel != null && lightPanel.isAttachedToWindow()) {
        wm.removeView(lightPanel);
    }
    if (volumePanel != null && volumePanel.isAttachedToWindow()) {
        wm.removeView(volumePanel);
    }

    wm.addView(viewGroup, layoutParams);
}
 
开发者ID:EggUncle,项目名称:XposedNavigationBar,代码行数:24,代码来源:LightAndVolumeController.java

示例6: stopDragging

import android.view.WindowManager; //导入方法依赖的package包/类
private void stopDragging() {
    if (mDragView != null) {
        mDragView.setVisibility(GONE);
        WindowManager wm = (WindowManager) getContext().getSystemService(
                Context.WINDOW_SERVICE);
        wm.removeView(mDragView);
        mDragView.setImageDrawable(null);
        mDragView = null;
    }
    if (mDragBitmap != null) {
        mDragBitmap.recycle();
        mDragBitmap = null;
    }
    if (mTrashcan != null) {
        mTrashcan.setLevel(0);
    }
}
 
开发者ID:89luca89,项目名称:ThunderMusic,代码行数:18,代码来源:TouchInterceptor.java

示例7: showScreensharingBar

import android.view.WindowManager; //导入方法依赖的package包/类
private void showScreensharingBar(boolean show) {
    WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
    if (show) {
        mScreensharingBar = new ScreenSharingBar(MainActivity.this, this);

        //add screensharing bar on top of the screen
        WindowManager.LayoutParams params = new WindowManager.LayoutParams(
                WindowManager.LayoutParams.MATCH_PARENT,
                WindowManager.LayoutParams.WRAP_CONTENT,
                WindowManager.LayoutParams.TYPE_APPLICATION_PANEL,
                0 | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
                PixelFormat.TRANSLUCENT);
        params.gravity = Gravity.LEFT | Gravity.TOP;
        params.x = 0;
        params.y = 0;


        wm.addView(mScreensharingBar, params);
    } else {
        wm.removeView(mScreensharingBar);
        mScreensharingBar = null;
    }
}
 
开发者ID:opentok,项目名称:accelerator-sample-apps-android,代码行数:24,代码来源:MainActivity.java

示例8: stopDragging

import android.view.WindowManager; //导入方法依赖的package包/类
private void stopDragging() {
	if (mDragView != null) {
		mDragView.setVisibility(GONE);
		WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
		wm.removeView(mDragView);
		mDragView.setImageDrawable(null);
		mDragView = null;
	}
	if (mDragBitmap != null) {
		mDragBitmap.recycle();
		mDragBitmap = null;
	}
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:14,代码来源:DragnDropListView.java

示例9: removeFloatWindow

import android.view.WindowManager; //导入方法依赖的package包/类
/**
 * 将小悬浮窗从屏幕上移除。
 * 
 * @param context
 *            必须为应用程序的Context.
 */
public static void removeFloatWindow(Context context) {
	if (mFloatWindow != null) {
		WindowManager windowManager = getWindowManager(context);
		windowManager.removeView(mFloatWindow);
		mFloatWindow = null;
	}
}
 
开发者ID:waylife,项目名称:ViewDebugHelper,代码行数:14,代码来源:MyWindowManager.java

示例10: hide

import android.view.WindowManager; //导入方法依赖的package包/类
void hide() {
    if (!isShowing()) {
        return;
    }

    WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
    wm.removeView(mContentView);
}
 
开发者ID:commonsguy,项目名称:cwac-crossport,代码行数:9,代码来源:TooltipPopup.java

示例11: stopDragging

import android.view.WindowManager; //导入方法依赖的package包/类
private void stopDragging() {
    if (mDragView != null) {
        mDragView.setVisibility(GONE);
        WindowManager wm = (WindowManager) getContext().getSystemService("window");
        wm.removeView(mDragView);
        mDragView.setImageDrawable(null);
        mDragView = null;
    }
    if (mDragBitmap != null) {
        mDragBitmap.recycle();
        mDragBitmap = null;
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:14,代码来源:TouchInterceptor.java

示例12: onDestroy

import android.view.WindowManager; //导入方法依赖的package包/类
@Override
public void onDestroy() {
    WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE);
    if (wm != null) {
        wm.removeView(mRoot);
    }

    stopReadLogcat();
    super.onDestroy();
}
 
开发者ID:kyze8439690,项目名称:logcatviewer,代码行数:11,代码来源:FloatingLogcatService.java

示例13: removeSmallWindow

import android.view.WindowManager; //导入方法依赖的package包/类
/**
 * 将小悬浮窗从屏幕上移除。
 *
 * @param context 必须为应用程序的Context.
 */
public static void removeSmallWindow(Context context) {
    if (smallWindow != null) {
        WindowManager windowManager = getWindowManager(context);
        windowManager.removeView(smallWindow);
        preAPPInfo = null;
        smallWindow = null;
        preAPP_cache = preAPP_now;
        APP_cache = APP_now;
    }
}
 
开发者ID:EdgarNg1024,项目名称:PreAPP,代码行数:16,代码来源:MyWindowManager.java

示例14: DefineToast

import android.view.WindowManager; //导入方法依赖的package包/类
public DefineToast(Context context, String toastContent, double time) {
    mContext = context;
    wdm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    params = new WindowManager.LayoutParams();
    params.height = WindowManager.LayoutParams.WRAP_CONTENT;
    params.width = WindowManager.LayoutParams.WRAP_CONTENT;
    params.format = PixelFormat.TRANSLUCENT;
    params.flags = WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
            | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
            | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
    params.y = DpPxUtil.dip2px(context, 125);
    params.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL;

    if (!TextUtils.isEmpty(toastContent)) {
        handler = new Handler() {
            @Override
            public void handleMessage(Message msg) {
                if (msg.what == 1000) {
                    if (mView != null) {
                        if (mView.getParent() != null) {
                            wdm.removeView(mView);
                        }
                        mView = null;
                        mContext = null;
                    }
                }
            }
        };
        mView = LayoutInflater.from(context).inflate(R.layout.layout_define_toast, null);
        ((TextView) mView).setText(toastContent);
    }
    this.second = time;
}
 
开发者ID:DoloresTeam,项目名称:dolores-android,代码行数:34,代码来源:DefineToast.java

示例15: a

import android.view.WindowManager; //导入方法依赖的package包/类
public static void a(WindowManager windowManager, WebView webView, ImageButton imageButton) {
    windowManager.removeView(webView);
    windowManager.removeView(imageButton);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:o.java


注:本文中的android.view.WindowManager.removeView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。