public void setToNormal() { if (mPreview != null) { mPreview.stopPreview(); } FrameLayout layout = (FrameLayout) findViewById(R.id.linear); layout.removeView(mWebView); layout.setLayoutParams( new FrameLayout.LayoutParams( FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT)); mWebView.setWebViewClient(null); mWebView.destroy(); mWebView = null; FrameLayout frame = (FrameLayout) findViewById(R.id.camera_parent); frame.setLayoutParams( new FrameLayout.LayoutParams( FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT)); displayNormalMode(); mMaskFlag = false; // setTitle(R.string.app_name); setTitle(""); if (mPreview != null) { mPreview.startPreview(); } }
public void setToHidden() { if (mPreview != null) { mPreview.stopPreview(); } mWebView = new WebView(ContShooting.this); mWebView.setWebViewClient(new WebViewClient()); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setBuiltInZoomControls(true); mWebView.getSettings().setAppCacheEnabled(false); FrameLayout layout = (FrameLayout) findViewById(R.id.linear); layout.setLayoutParams( new FrameLayout.LayoutParams( FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT, 1)); layout.addView(mWebView); if (Locale.getDefault().equals(Locale.JAPAN)) { mWebView.loadUrl(URL_JP); } else { mWebView.loadUrl(URL_OTHER); } FrameLayout frame = (FrameLayout) findViewById(R.id.camera_parent); /* int hide_width = mWidth / 4; int hide_height = hide_width * (4/3); */ /* * 隠しモードのプレビューサイズ設定 * 大=1/4, 小=1/6, 無し=1*1 */ int denom = 4; if (mHiddenSizeIdx == 2) { denom = 6; } int hide_width = mWidth / denom; int hide_height = hide_width / 3 * 4; if (mHiddenSizeIdx == 3) { hide_height = 1; hide_width = 1; } frame.setLayoutParams(new FrameLayout.LayoutParams(hide_width, hide_height, Gravity.BOTTOM)); displayHideMode(); mMaskFlag = true; setTitle(R.string.sc_hidden); if (mPreview != null) { mPreview.startPreview(); } }