本文整理匯總了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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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;
}
}
示例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);
}
示例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);
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例10: hide
import android.view.WindowManager; //導入方法依賴的package包/類
void hide() {
if (!isShowing()) {
return;
}
WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
wm.removeView(mContentView);
}
示例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;
}
}
示例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();
}
示例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;
}
}
示例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;
}
示例15: a
import android.view.WindowManager; //導入方法依賴的package包/類
public static void a(WindowManager windowManager, WebView webView, ImageButton imageButton) {
windowManager.removeView(webView);
windowManager.removeView(imageButton);
}