Android WindowManager.LayoutParams - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android WindowManager.LayoutParams class.

This code example shows how to use the following methods:
         
        mHandler.post(new Runnable() {
 
            public void run() { 
                mReady = true;
                WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
                        LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,
                        WindowManager.LayoutParams.TYPE_APPLICATION,
                        WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
                                | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
                        PixelFormat.TRANSLUCENT);
                mWindowManager.addView(mDialogText, lp);
            }}); 
    } 
     
    @Override 
    protected void onResume() { 
        super.onResume(); 
        mReady = true;
    } 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
     * Testing the ability for a service to insert views into the current window 
     */ 
    public void insertOverlay() { 
    	mHandler.post(new Runnable() { 
    		public void run() { 
		    	LayoutParams param = new LayoutParams(LayoutParams.TYPE_SYSTEM_OVERLAY,
						   LayoutParams.FLAG_LAYOUT_IN_SCREEN);
		    	param.token = wmbinder;
		    	window.addView(overlayView, param);
    		} 
    	}); 
    } 
     
    public void removeOverlay() { 
    	mHandler.post(new Runnable() { 
    		public void run() { 
    			try { 
	    	    	if (overlayView != null)
	    	    		window.removeView(overlayView);
    			} catch (Exception e) {
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		mStopped = true;
		mDetectTopActivity = null;
	} 
	private void initLayoutParams(){ 
		mWindowManager = (WindowManager)getSystemService(Service.WINDOW_SERVICE);
    	mLayoutParams = new WindowManager.LayoutParams();
		mLayoutParams.type = LayoutParams.TYPE_PHONE; // ����window type
		mLayoutParams.format = PixelFormat.RGBA_8888; // ����ͼƬ��ʽ��Ч��Ϊ����͸��
        mLayoutParams.alpha = 1.0f;
        //����Window flag 
		mLayoutParams.flags = LayoutParams.FLAG_NOT_TOUCH_MODAL
				| LayoutParams.FLAG_NOT_FOCUSABLE;
        /* 
         * �����flags���Ե�Ч����ͬ������ 
         * ����ɴ������������κ��¼�,ͬʱ��Ӱ�������¼���Ӧ�� 
         mLayoutParams.flags=LayoutParams.FLAG_NOT_TOUCH_MODAL  
                               | LayoutParams.FLAG_NOT_FOCUSABLE 
                               | LayoutParams.FLAG_NOT_TOUCHABLE; 
        */ 
//        mLayoutParams.gravity=Gravity.LEFT|Gravity.TOP;   //������������Ͻ� 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    private static View floatingViewObj = null;
 
    /** 
     * 参数设定类 
     */ 
    public static WindowManager.LayoutParams params = new WindowManager.LayoutParams();
    public static int STATUS_BAR_HEIGHT = 0;
    /** 
     * 要显示在窗口最前面的对象 
     */ 
    private static View view_obj = null;
 
    /** 
     * 要显示在窗口最前面的方法 
     *  
     * @param context 
     *            调用对象Context getApplicationContext() 
     * @param window 
     *            调用对象 Window getWindow() 
     * @param floatingViewObj 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
			// ロック画面を作って 
			mLockView = GameStater.createReversiView(_c);
			 
			// android.view.WindowManager.LayoutParams 
			// ロック画面表示用のパラメータ 
			LayoutParams params = new LayoutParams();
			 
			// 全画面 
			params.width = LayoutParams.MATCH_PARENT;
			params.height = LayoutParams.MATCH_PARENT;
			 
			// SystemAlert 
			params.type = LayoutParams.TYPE_SYSTEM_ALERT;
			 
			if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2){
 
				// フラグセット 
				params.flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | 
						WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD;
			} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		/** 
		 * comment for compatibility android 2.1 
		 */ 
		//imageView.setAlpha(0.8f); 
		 
		layout = new LayoutParams();
		layout.width = LayoutParams.WRAP_CONTENT;
		layout.height = LayoutParams.WRAP_CONTENT;
		layout.gravity = Gravity.LEFT | Gravity.TOP;
		 
		Display display = windowManager.getDefaultDisplay();
		DisplayMetrics outMetrics = new DisplayMetrics();
		display.getMetrics(outMetrics);
		 
		int[] location = new int[2];
		this.getLocationOnScreen(location);
		layout.x = location[0];
		layout.y = location[1];
		 
		Log.i(tag, "location[0] = " + location[0]);
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
This code example shows how to use the following methods:
			Log.w(TAG, "[showUpdateInfo] updateInfo is null.");
			return; 
		} 
		WindowManager wm = (WindowManager)getSystemService(Context.WINDOW_SERVICE);
 
		WindowManager.LayoutParams params = new WindowManager.LayoutParams(
				LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,
				WindowManager.LayoutParams.TYPE_SYSTEM_ALERT
						| WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,
				WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
						| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
				PixelFormat.TRANSLUCENT);
		params.flags |= WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
				| WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
				| WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
				| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
 
		params.height = LayoutParams.WRAP_CONTENT;
		params.width = LayoutParams.WRAP_CONTENT;
		params.format = PixelFormat.TRANSLUCENT;
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
			Drawable image = getResources().getDrawable(imageResource);
			image.setAlpha(100);
 
			tiv = new TouchImageView(this, ruta, image);
 
			LayoutParams lp = new LayoutParams(
					android.view.ViewGroup.LayoutParams.WRAP_CONTENT,
					android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
 
			// tiv.setPadding(50, 0, 50, 0); 
			tiv.setLayoutParams(lp);
 
			// tiv.setImageResource(imageResource); 
			// tiv.setImageDrawable(image); 
			tiv.setMaxZoom(4f);
 
			alParent = new MiFrameLayout(this, tiv);
			/* 
			 * alParent.setLayoutParams(new LayoutParams( 
			 * android.view.ViewGroup.LayoutParams.FILL_PARENT, 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	private void setOverlayEnabled(boolean enabled)
	{ 
		WindowManager mWindowManager = (WindowManager) getApplicationContext().getSystemService(WINDOW_SERVICE);
		if(enabled)
		{ 
			WindowManager.LayoutParams mWmlp = new WindowManager.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
			mWmlp.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
			mWmlp.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
			mWmlp.format = PixelFormat.TRANSPARENT;
			try{ mWindowManager.addView(mOverlayView, mWmlp); }catch(IllegalStateException e){/* View already attached to the window manager*/}	
			mOverlayEnabled = true;
			//Toast.makeText(this, "Setting view on ", Toast.LENGTH_SHORT).show(); 
		}else{ 
			try{ mWindowManager.removeView(mOverlayView); }
			catch(IllegalArgumentException e){
				/* View not attached to the window manager*/ 
				System.out.println("");
				}			 
			mOverlayEnabled = false;
			//Toast.makeText(this, "Setting view off...", Toast.LENGTH_SHORT).show(); 
4
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Android WindowManager.LayoutParams Questions & Answers:

See Code Examples for Android WindowManager.LayoutParams Methods: