本文整理汇总了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);
}