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

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

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

Button.setAllCaps介绍

暂无

代码示例

代码示例来源:origin: meituan/WMRouter

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  LinearLayout container = findViewById(R.id.layout_container);
  for (final String uri : URIS) {
    Button button = new Button(this);
    button.setAllCaps(false);
    button.setText(uri);
    button.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        jump(uri);
      }
    });
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
        ViewGroup.LayoutParams.MATCH_PARENT,
        ViewGroup.LayoutParams.WRAP_CONTENT);
    container.addView(button, params);
  }
}

代码示例来源:origin: meituan/WMRouter

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  LinearLayout container = findViewById(R.id.layout_container);
  for (final String uri : URIS) {
    Button button = new Button(this);
    button.setAllCaps(false);
    button.setText(uri);
    button.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        jump(uri);
      }
    });
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
        ViewGroup.LayoutParams.MATCH_PARENT,
        ViewGroup.LayoutParams.WRAP_CONTENT);
    container.addView(button, params);
  }
}

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

private Button createButton(final Class<?> clazz, String text, View.OnClickListener customListener) {
  Button button = new Button(this);
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
    button.setAllCaps(false);
  if (text == null) {
    button.setText(clazz.getSimpleName());
  } else {
    button.setText(text);
  }
  if (customListener == null) {
    button.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
        startActivity(new Intent(Samples.this, clazz));
      }
    });
  } else {
    button.setOnClickListener(customListener);
  }
  return button;
}

代码示例来源:origin: corcoran/Hangar

protected void setupButton(Button button, LinearLayout.LayoutParams params) {
  button.setSingleLine(false);
  button.setAllCaps(true);
  button.setLayoutParams(params);
}

代码示例来源: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: nshmura/strictmode-notifier

@Override public View getView(int position, View convertView, ViewGroup parent) {
  if (convertView == null) {
   convertView =
     LayoutInflater.from(MainActivity.this).inflate(R.layout.row_actions, parent, false);
  }
  final ViolationTypeInfo info = ViolationTypeInfo.convert(getItem(position));
  String text = String.format("%s error (minSdk %s)",
    ViolationTypeInfo.convert(info.violationType).violationName(),
    info.minSdkVersion);
  Button button = (Button) convertView.findViewById(R.id.button);
  button.setText(text);
  button.setEnabled(Build.VERSION.SDK_INT >= info.minSdkVersion);
  button.setOnClickListener(new View.OnClickListener() {
   @Override public void onClick(View v) {
    fireStrictModeError(info);
   }
  });
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
   button.setAllCaps(false);
  }
  return convertView;
 }
}

代码示例来源: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: MFlisar/GDPRDialog

spannableText.setSpan(new RelativeSizeSpan(0.8f), textButton.length(), spannableText.length(), 0);
spannableText.setSpan(new ForegroundColorSpan(textColor), textButton.length(), spannableText.length(), 0);
btDisagree.setAllCaps(false);
btDisagree.setTypeface(Typeface.DEFAULT);
btDisagree.setText(spannableText);

代码示例来源:origin: TobiasBielefeld/Simple-Solitaire

entry.setAllCaps(false);

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

if (!hideReplies) {
  replyButton.setTextSize(TypedValue.COMPLEX_UNIT_DIP, fontSizeSP);
  replyButton.setAllCaps(true);
  setFontLocale(replyButton, defaultLocale);
  replyButton.setText(R.string.reply);

代码示例来源:origin: AndBible/and-bible

button.setAllCaps(false);

相关文章

Button类方法