List of usage examples for android.widget LinearLayout VERTICAL
int VERTICAL
To view the source code for android.widget LinearLayout VERTICAL.
Click Source Link
From source file:aierjun.com.aierjunlibrary.widget.tablayout.SlidingTabFragmentViewPager.java
protected void init() { setOrientation(LinearLayout.VERTICAL); tabs = new PagerSlidingTabStrip(getContext()); tabs.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); pager = new ViewPager(getContext()); pager.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); addView(tabs);/*from w ww . j a v a2 s .c o m*/ addView(pager); }
From source file:android.support.v7ox.widget.ButtonBarLayout.java
public void setAllowStacking(boolean allowStacking) { if (mAllowStacking != allowStacking) { mAllowStacking = allowStacking;//from w w w . j a v a 2 s . c o m if (!mAllowStacking && getOrientation() == LinearLayout.VERTICAL) { setStacked(false); } requestLayout(); } }
From source file:com.mifos.mifosxdroid.formwidgets.FormWidget.java
public FormWidget(Context context, String name) { layout = new LinearLayout(context); layout.setLayoutParams(defaultLayoutParams); layout.setOrientation(LinearLayout.VERTICAL); layout.setPadding(4, 4, 4, 4);/*from w w w . j av a 2 s . c o m*/ property = name; displayText = name.replace("", " "); displayText = toTitleCase(displayText); returnType = SCHEMA_KEY_TEXT; }
From source file:com.github.preferencefragment.preference.LaunchingPreferences.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /*// w w w .j a v a 2s . c o m * These preferences have defaults, so before using them go apply those * defaults. This will only execute once -- when the defaults are applied * a boolean preference is set so they will not be applied again. */ PreferenceManager.setDefaultValues(this, R.xml.advanced_preferences, false); // Simple layout LinearLayout layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); setContentView(layout); // Create a simple button that will launch the preferences Button launchPreferences = new Button(this); launchPreferences.setText(getString(R.string.launch_preference_activity)); launchPreferences.setOnClickListener(this); layout.addView(launchPreferences, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); mCounterText = new TextView(this); layout.addView(mCounterText, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); updateCounterText(); }
From source file:org.mitre.svmp.auth.module.PasswordChangeModule.java
public View generateUI(Context context) { // create the password change inputs input1 = new EditText(context); input1.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); input1.setHint("New password"); input2 = new EditText(context); input2.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); input2.setHint("Confirm new password"); LinearLayout view = new LinearLayout(context); view.setOrientation(LinearLayout.VERTICAL); view.addView(input1);//from w w w .j av a 2s. co m view.addView(input2); return view; }
From source file:io.mattcarroll.hover.defaulthovermenu.toolbar.ToolbarNavigatorContent.java
private void init() { setOrientation(LinearLayout.VERTICAL); LayoutInflater.from(getContext()).inflate(R.layout.view_toolbar_navigator, this, true); mToolbar = (Toolbar) findViewById(R.id.toolbar); mToolbar.setNavigationOnClickListener(new OnClickListener() { @Override//from w w w .j ava 2s.c o m public void onClick(View v) { popContent(); } }); mBackArrowDrawable = createBackArrowDrawable(); mContentContainer = (FrameLayout) findViewById(R.id.content_container); mContentLayoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); mContentStack = new Stack<>(); }
From source file:com.javielinux.dialogs.CreateDefaultColumnsUserDialogFragment.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { userId = getArguments().getLong("user_id"); userEntity = new Entity("users", userId); CharSequence[] choices = new CharSequence[3]; choices[0] = getString(R.string.timeline); choices[1] = getString(R.string.mentions); choices[2] = getString(R.string.direct_messages); final boolean[] isChoices = new boolean[] { true, true, true }; LinearLayout llTitle = new LinearLayout(getActivity()); llTitle.setOrientation(LinearLayout.VERTICAL); final CheckBox boxInvite = new CheckBox(getActivity()); boxInvite.setText(R.string.follow_tweettopics); boxInvite.setChecked(true);//from www .j a v a 2 s.c om llTitle.addView(boxInvite); TextView txtTitle = new TextView(getActivity()); txtTitle.setText(R.string.create_columns); txtTitle.setTextSize(25); llTitle.addView(txtTitle); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setCustomTitle(llTitle); builder.setMultiChoiceItems(choices, isChoices, new DialogInterface.OnMultiChoiceClickListener() { public void onClick(DialogInterface dialog, int whichButton, boolean isChecked) { isChoices[whichButton] = isChecked; } }); builder.setCancelable(false); builder.setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // choices int count = DataFramework.getInstance().getEntityListCount("columns", "") + 1; if (isChoices[0]) { Entity type = new Entity("type_columns", (long) TweetTopicsUtils.COLUMN_TIMELINE); Entity timeline = new Entity("columns"); timeline.setValue("description", type.getString("description")); timeline.setValue("type_id", type); timeline.setValue("position", count); timeline.setValue("user_id", userEntity.getId()); timeline.save(); count++; } if (isChoices[1]) { Entity type = new Entity("type_columns", (long) TweetTopicsUtils.COLUMN_MENTIONS); Entity mentions = new Entity("columns"); mentions.setValue("description", type.getString("description")); mentions.setValue("type_id", type); mentions.setValue("position", count); mentions.setValue("user_id", userEntity.getId()); mentions.save(); count++; } if (isChoices[2]) { Entity type = new Entity("type_columns", (long) TweetTopicsUtils.COLUMN_DIRECT_MESSAGES); Entity dms = new Entity("columns"); dms.setValue("description", type.getString("description")); dms.setValue("type_id", type); dms.setValue("position", count); dms.setValue("user_id", userEntity.getId()); dms.save(); } ((TweetTopicsActivity) getActivity()).refreshColumns(); // create friend if (boxInvite.isChecked()) { Utils.showMessage(getActivity(), getActivity().getString(R.string.thanks)); new Thread(new Runnable() { @Override public void run() { try { ConnectionManager.getInstance().getTwitter(userEntity.getId()) .createFriendship("tweettopics_app"); } catch (TwitterException e1) { e1.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } } }).start(); } } }); return builder.create(); }
From source file:com.waz.zclient.ui.views.tab.TabIndicatorLayout.java
public TabIndicatorLayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); setOrientation(LinearLayout.VERTICAL); selectedPosition = 0;// ww w . j a v a 2 s. co m textViewContainer = new LinearLayout(getContext()); tabIndicatorView = new TabIndicatorView(context); addView(textViewContainer); LinearLayout.LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, getResources().getDimensionPixelSize(R.dimen.sign_tab_indicator_marker__height)); params.topMargin = getResources().getDimensionPixelSize(R.dimen.wire__padding__small); addView(tabIndicatorView, params); }
From source file:org.ligi.android.dubwise_uavtalk.dashboard.DownloadDashboardImagesStatusAlertDialog.java
/** * /*from ww w . ja v a 2s . c om*/ * @param activity * @param autoclose - if the alert should close when connection is established * */ public static void show(Context activity, boolean autoclose, Intent after_connection_intent) { LinearLayout lin = new LinearLayout(activity); lin.setOrientation(LinearLayout.VERTICAL); ScrollView sv = new ScrollView(activity); TextView details_text_view = new TextView(activity); LinearLayout lin_in_scrollview = new LinearLayout(activity); lin_in_scrollview.setOrientation(LinearLayout.VERTICAL); sv.addView(lin_in_scrollview); lin_in_scrollview.addView(details_text_view); details_text_view.setText("no text"); ProgressBar progress = new ProgressBar(activity, null, android.R.attr.progressBarStyleHorizontal); progress.setMax(img_lst.length); lin.addView(progress); lin.addView(sv); new AlertDialog.Builder(activity).setTitle("Download Status").setView(lin) .setPositiveButton("OK", new DialogDiscardingOnClickListener()).show(); class AlertDialogUpdater implements Runnable { private Handler h = new Handler(); private TextView myTextView; private ProgressBar myProgress; public AlertDialogUpdater(TextView ab, ProgressBar progress) { myTextView = ab; myProgress = progress; } public void run() { for (int i = 0; i < img_lst.length; i++) { class MsgUpdater implements Runnable { private int i; public MsgUpdater(int i) { this.i = i; } public void run() { myProgress.setProgress(i + 1); if (i != img_lst.length - 1) myTextView.setText("Downloading " + img_lst[i] + ".png"); else myTextView.setText("Ready - please restart DUBwise to apply changes!"); } } h.post(new MsgUpdater(i)); try { URLConnection ucon = new URL(url_lst[i]).openConnection(); BufferedInputStream bis = new BufferedInputStream(ucon.getInputStream()); ByteArrayBuffer baf = new ByteArrayBuffer(50); int current = 0; while ((current = bis.read()) != -1) baf.append((byte) current); File path = new File( Environment.getExternalStorageDirectory() + "/dubwise/images/dashboard"); path.mkdirs(); FileOutputStream fos = new FileOutputStream( new File(path.getAbsolutePath() + "/" + img_lst[i] + ".png")); fos.write(baf.toByteArray()); fos.close(); } catch (Exception e) { } try { Thread.sleep(199); } catch (InterruptedException e) { } } } } new Thread(new AlertDialogUpdater(details_text_view, progress)).start(); }
From source file:net.peterkuterna.android.apps.devoxxfrsched.ui.ProgressFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final Context context = getActivity(); FrameLayout root = new FrameLayout(context); LinearLayout pframe = new LinearLayout(context); pframe.setId(INTERNAL_PROGRESS_CONTAINER_ID); pframe.setOrientation(LinearLayout.VERTICAL); pframe.setVisibility(View.GONE); pframe.setGravity(Gravity.CENTER);/*from ww w .ja va2 s . c om*/ ProgressBar progress = new ProgressBar(context, null, android.R.attr.progressBarStyleLarge); pframe.addView(progress, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); root.addView(pframe, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); FrameLayout cframe = new FrameLayout(context); cframe.setId(INTERNAL_CONTENT_CONTAINER_ID); TextView tv = new TextView(context); tv.setId(INTERNAL_EMPTY_ID); tv.setGravity(Gravity.CENTER); cframe.addView(tv, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); View contentView = onCreateContentView(inflater, cframe, savedInstanceState); cframe.addView(contentView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); root.addView(cframe, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); root.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); return root; }