List of usage examples for android.widget FrameLayout setMinimumHeight
@RemotableViewMethod public void setMinimumHeight(int minHeight)
From source file:com.vuze.android.remote.AndroidUtilsUI.java
public static AlertDialog.Builder createTextBoxDialog(Context context, int newtag_title, int newtag_hint, final OnTextBoxDialogClick onClickListener) { AlertDialog.Builder builder = new AlertDialog.Builder(context); FrameLayout container = new FrameLayout(context); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); params.gravity = Gravity.CENTER_VERTICAL; container.setMinimumHeight(AndroidUtilsUI.dpToPx(100)); int padding = AndroidUtilsUI.dpToPx(20); params.leftMargin = padding;// w w w . j av a 2s. c o m params.rightMargin = padding; final MaterialEditText textView = AndroidUtilsUI.createFancyTextView(context); textView.setHint(newtag_hint); textView.setFloatingLabelText(context.getResources().getString(newtag_hint)); textView.setSingleLine(); textView.setLayoutParams(params); container.addView(textView); if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) { builder.setInverseBackgroundForced(true); } builder.setView(container); builder.setTitle(newtag_title); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { onClickListener.onClick(dialog, which, textView); } }); builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); return builder; }
From source file:com.chute.components.android.imagesharer.activity.DialogActivity.java
@Override public View getWebView() { webView = new WebView(getApplicationContext()); webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); webView.setWebViewClient(new BaseWebViewClient()); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setDomStorageEnabled(true); webView.setKeepScreenOn(true);/*from ww w .ja va 2 s . c o m*/ webView.getSettings().setBuiltInZoomControls(true); webView.getSettings().setUserAgentString( "Mozilla/5.0 (Linux; U; Android 2.0; en-us; Droid Build/ESD20) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17"); webView.getSettings().setAllowFileAccess(true); webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); FrameLayout frameLayout = new FrameLayout(getApplicationContext()); frameLayout.setMinimumHeight(150); progressBar = new ProgressBar(getApplicationContext()); FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(100, 100); layoutParams.gravity = Gravity.CENTER; progressBar.setLayoutParams(layoutParams); frameLayout.addView(webView); frameLayout.addView(progressBar); return frameLayout; }
From source file:io.nuclei.cyto.ui.view.BottomSheetView.java
private void init(Context context) { ViewConfiguration viewConfiguration = ViewConfiguration.get(context); mMinFlingVelocity = viewConfiguration.getScaledMinimumFlingVelocity(); mTouchSlop = viewConfiguration.getScaledTouchSlop(); setClickable(true);//from w ww. ja v a 2s .c o m mBackground = new View(context); mBackground.setBackgroundColor(mBackgroundColor = DEFAULT_BACKGROUND_COLOR); mBackground.setLayoutParams( new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); mBackground.setVisibility(GONE); mBackground.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if ((mState & STATE_MOVING) != STATE_MOVING) { if ((mState & STATE_LOCKED) == STATE_LOCKED) removeState(STATE_LOCKED); setState(STATE_CLOSED); } } }); addView(mBackground); FrameLayout content = new FrameLayout(context); content.setLayoutParams( new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); content.setMinimumHeight(1); content.setBackgroundDrawable(new ColorDrawable(Color.WHITE)); content.setClickable(true); addView(content); mContent = content; mOffsetHelper = new ViewOffsetHelper(mContent); onPrepare(); }
From source file:com.jgraves.achievementunlocked.AchievementsList_Fragment.java
private void addAchievementToList(Long id, String name, int points) { Log.i(ExploraApp.TAG, "Adding achievement image request of id " + id + " with height, " + imageViewHeight); FrameLayout fl = new FrameLayout(getActivity()); touchMap.put(fl, id);//from w ww . j a va2 s . co m fl.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Long id = touchMap.get(v); Log.i(ExploraApp.TAG, "TOUCHED " + id); Intent intent = new Intent(getActivity(), Activity_AchievementInfo.class); intent.putExtra("achievement_id", Long.toString(id)); startActivity(intent); } }); TextView tv_name = new TextView(getActivity()); TextView tv_points = new TextView(getActivity()); ImageView iv = new ImageView(getActivity()); fl.setMinimumHeight(imageViewHeight); fl.setMinimumWidth(ExploraApp.screenWidth); robotoTypeface = Typeface.createFromAsset(getActivity().getAssets(), "Roboto-Thin.ttf"); tv_name.setText(name); tv_name.setTextSize(15f); tv_points.setTextSize(15f); tv_name.setTypeface(robotoTypeface); tv_points.setTypeface(robotoTypeface); tv_points.setText(Integer.toString(points)); tv_points.setGravity(Gravity.RIGHT); tv_points.setTextColor(Color.WHITE); tv_name.setTextColor(Color.WHITE); iv.setMinimumHeight(imageViewHeight); iv.setMinimumWidth(ExploraApp.screenWidth); fl.addView(iv); fl.addView(tv_name); fl.addView(tv_points); ll_images_container.addView(fl); sv_images.bringChildToFront(mQuickReturnView); DefaultImageListener listener = new DefaultImageListener(iv); ImageRequest imageRequest = new ImageRequest( ExploraApp.url_main + "/achievement/" + id + "/photo?y=" + imageViewHeight + "&x=" + ExploraApp.screenWidth, listener, ExploraApp.screenWidth, imageViewHeight, Bitmap.Config.ARGB_8888, listener); ExploraApp.mRequestQueue.add(imageRequest); }