android.widget.Button.setMinHeight()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中android.widget.Button.setMinHeight()方法的一些代码示例,展示了Button.setMinHeight()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setMinHeight()方法的具体详情如下:
包路径:android.widget.Button
类名称:Button
方法名:setMinHeight

Button.setMinHeight介绍

暂无

代码示例

代码示例来源:origin: termux/termux-app

void popup(View view, String text) {
  int width = view.getMeasuredWidth();
  int height = view.getMeasuredHeight();
  Button button = new Button(getContext(), null, android.R.attr.buttonBarButtonStyle);
  button.setText(text);
  button.setTextColor(TEXT_COLOR);
  button.setPadding(0, 0, 0, 0);
  button.setMinHeight(0);
  button.setMinWidth(0);
  button.setMinimumWidth(0);
  button.setMinimumHeight(0);
  button.setWidth(width);
  button.setHeight(height);
  button.setBackgroundColor(BUTTON_PRESSED_COLOR);
  popupWindow = new PopupWindow(this);
  popupWindow.setWidth(LayoutParams.WRAP_CONTENT);
  popupWindow.setHeight(LayoutParams.WRAP_CONTENT);
  popupWindow.setContentView(button);
  popupWindow.setOutsideTouchable(true);
  popupWindow.setFocusable(false);
  popupWindow.showAsDropDown(view, 0, -2 * height);
}

代码示例来源:origin: linfaxin/PullRefreshLoadRecyclerView

public ViewHolder() {
    super(DemoActivity.this);
    button.setMinHeight(getResources().getDisplayMetrics().heightPixels / data.size());
  }
}

代码示例来源:origin: AmazMod/AmazMod

private void setButtonTheme(Button button, String string) {
  button.setIncludeFontPadding(false);
  button.setMinHeight(24);
  button.setMinWidth(120);
  button.setText(string);
  button.setAllCaps(true);
  button.setTextColor(Color.parseColor("#000000"));
  button.setBackground(mContext.getDrawable(R.drawable.reply_grey));
}

代码示例来源:origin: AmazMod/AmazMod

private void setButtonTheme(Button button) {
  button.setIncludeFontPadding(false);
  button.setMinHeight(24);
  button.setMinWidth(120);
  button.setText(getResources().getString(R.string.close));
  button.setAllCaps(false);
  button.setTextColor(Color.parseColor("#000000"));
  button.setBackground(mContext.getDrawable(R.drawable.reply_grey));
}

代码示例来源:origin: AmazMod/AmazMod

private void setButtonTheme(Button button, String string) {
  button.setIncludeFontPadding(false);
  button.setMinHeight(24);
  button.setMinWidth(120);
  button.setText(string);
  button.setAllCaps(true);
  button.setTextColor(Color.parseColor("#000000"));
  button.setBackground(mContext.getDrawable(R.drawable.reply_grey));
}

代码示例来源:origin: AmazMod/AmazMod

public void setButtonParams(Button button, String text, Boolean mode) {
  if (mode) {
    params.setMargins(20, 12, 20, 12);
    button.setLayoutParams(params);
  }
  button.setPadding(0,15,0,15);
  button.setIncludeFontPadding(false);
  button.setMinHeight(36);
  button.setText(text);
  button.setAllCaps(true);
  button.setTextSize(TypedValue.COMPLEX_UNIT_DIP, fontSizeSP);
}

代码示例来源:origin: AmazMod/AmazMod

private void setButtonTheme(Button button) {
  /*
  LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(
      LinearLayout.LayoutParams.WRAP_CONTENT,
      LinearLayout.LayoutParams.WRAP_CONTENT);
  param.setMargins(20, 12, 20, 12);
  button.setLayoutParams(param);
  button.setPadding(0, 10, 0, 10);
  */
  button.setIncludeFontPadding(false);
  button.setMinHeight(24);
  button.setMinWidth(120);
  button.setText(getResources().getString(R.string.close));
  button.setAllCaps(false);
  button.setTextColor(Color.parseColor("#000000"));
  button.setBackground(mContext.getDrawable(R.drawable.reply_grey));
}

代码示例来源:origin: avluis/Hentoid

/**
 * Create the button for the given attribute
 *
 * @param attribute Attribute the button should represent
 * @param isSelected True if the button should appear as selected
 * @return Button representing the given Attribute, drawn as selected if needed
 */
private Button createTagSuggestionButton(Attribute attribute, boolean isSelected) {
  Button button = new Button(mContext);
  button.setText(MessageFormat.format("{0}({1})", attribute.getName(), attribute.getCount()));
  button.setBackgroundResource(R.drawable.btn_attribute_selector);
  button.setMinHeight(0);
  button.setMinimumHeight(0);
  colorButton(button, TAGFILTER_ACTIVE);
  button.setTag(attribute);
  button.setId(Math.abs(attribute.getId()));
  if (isSelected) button.setOnClickListener(v -> selectSearchTag(button));
  else button.setOnClickListener(v -> selectTagSuggestion(button));
  return button;
}

代码示例来源:origin: yaozs/YzsLib

mButtonAdd.setMinimumHeight(0);
mButtonAdd.setMinimumWidth(0);
mButtonAdd.setMinHeight(0);
mButtonAdd.setMinWidth(0);
setAddButtonBackground(addButtonBackground);
mButtonRemove.setMinimumHeight(0);
mButtonRemove.setMinimumWidth(0);
mButtonRemove.setMinHeight(0);
mButtonRemove.setMinWidth(0);
setRemoveButtonBackground(removeButtonBackground);

代码示例来源:origin: CypherpunkArmory/UserLAnd

void popup(View view, String text) {
  int width = view.getMeasuredWidth();
  int height = view.getMeasuredHeight();
  Button button = new Button(getContext(), null, android.R.attr.buttonBarButtonStyle);
  button.setText(text);
  button.setTextColor(TEXT_COLOR);
  button.setPadding(0, 0, 0, 0);
  button.setMinHeight(0);
  button.setMinWidth(0);
  button.setMinimumWidth(0);
  button.setMinimumHeight(0);
  button.setWidth(width);
  button.setHeight(height);
  button.setBackgroundColor(BUTTON_PRESSED_COLOR);
  popupWindow = new PopupWindow(this);
  popupWindow.setWidth(LayoutParams.WRAP_CONTENT);
  popupWindow.setHeight(LayoutParams.WRAP_CONTENT);
  popupWindow.setContentView(button);
  popupWindow.setOutsideTouchable(true);
  popupWindow.setFocusable(false);
  popupWindow.showAsDropDown(view, 0, -2 * height);
}

相关文章

Button类方法