List of usage examples for android.view ViewGroup bringChildToFront
@Override public void bringChildToFront(View child)
From source file:Main.java
public static void moveToBack(View currentView) { ViewGroup vg = ((ViewGroup) currentView.getParent()); int index = vg.indexOfChild(currentView); for (int i = 0; i < index; i++) { vg.bringChildToFront(vg.getChildAt(0)); }/*from w w w . ja v a2s . co m*/ }
From source file:com.intel.xdk.display.Display.java
@JavascriptInterface public void startAR() { arView = CameraPreview.newInstance(activity.getApplicationContext()); arView.setVisibility(View.INVISIBLE); arView.height = 100;/* www . ja v a2 s . c om*/ arView.width = 100; //no way to get current background color? arView.setBackgroundColor(Color.TRANSPARENT); SurfaceHolder sfhTrackHolder = arView.getHolder(); sfhTrackHolder.setFormat(PixelFormat.TRANSPARENT); sfhTrackHolder.setKeepScreenOn(true); sfhTrackHolder.setFixedSize(100, 100); activity.runOnUiThread(new Runnable() { public void run() { //activity.addContentView(arView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, 0.0F)); //activity.addContentView(arView, new LinearLayout.LayoutParams(400, 500, 0.0F)); ViewGroup rootView = (ViewGroup) webView.getParent().getParent(); rootView.addView(arView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); rootView.bringChildToFront((View) webView.getParent()); arView.setVisibility(View.VISIBLE); arView.showCamera(); webView.bringToFront(); webView.setBackgroundColor(0x00000000); LinearLayout ll = (LinearLayout) webView.getParent(); ll.setBackgroundColor(0x00000000); View activityView = activity.getCurrentFocus(); } }); }