當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。