Java Code Examples for android.widget.Button#setHeight()
The following examples show how to use
android.widget.Button#setHeight() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ZoomControlView.java From appinventor-extensions with Apache License 2.0 | 5 votes |
private void initButton(Button button, String text) { button.setText(text); button.setTextSize(22); button.setPadding(0, 0, 0, 0); button.setWidth((int)(30 * density)); button.setHeight((int)(30 * density)); button.setSingleLine(); button.setGravity(Gravity.CENTER); }
Example 2
Source File: EspViewTest.java From espresso-macchiato with MIT License | 5 votes |
private void givenViewLargerThanScreen() { ScrollView scrollView = new ScrollView(getActivity()); scrollView.setId(android.R.id.candidatesArea); addViewToLayout(scrollView, BaseActivity.rootLayout); view = new Button(activityTestRule.getActivity()); view.setHeight(3000); view.setWidth(2000); view.setId(viewId); addViewToLayout(view, android.R.id.candidatesArea); }
Example 3
Source File: MainActivity.java From AndroidFlowLayout with MIT License | 5 votes |
private void addChildTo(FlowLayout flowLayout) { for (int i = 'A'; i < 'Z'; i++) { Button btn = new CheckableButton(this); btn.setHeight(dp2px(32)); btn.setTextSize(16); btn.setTextColor(getResources().getColorStateList(R.color.checkable_text_color)); btn.setBackgroundResource(R.drawable.checkable_background); StringBuilder sb = new StringBuilder(); for (int j = 0; j < i - 'A' + 4; j++) { sb.append((char) i); } btn.setText(sb.toString()); flowLayout.addView(btn); } }