android.widget.Switch.setTextOff()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(152)

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

Switch.setTextOff介绍

暂无

代码示例

代码示例来源:origin: lygttpod/SuperTextView

mSwitch.setTextOff(mTextOff);

代码示例来源:origin: willowtreeapps/Hyperion-Android

@Override
  protected void mutate(CharSequence value) {
    view.setTextOff(value);
  }
});

代码示例来源:origin: stackoverflow.com

Switch sw = new Switch(MainActivity.this);
   sw.setTextOn("start");
   sw.setTextOff("close");
   LinearLayout linearLayout = new LinearLayout(MainActivity.this);
   linearLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));
   linearLayout.setGravity(Gravity.CENTER_HORIZONTAL);
   linearLayout.addView(sw);
   AlertDialog.Builder myDialog = new    AlertDialog.Builder(MainActivity.this);
   myDialog.setTitle("title");
   myDialog.setMessage("message");
   myDialog.setView(linearLayout);
   myDialog.show();

代码示例来源:origin: thuryn/your-local-weather

sdf = new SimpleDateFormat("EEEE", locale);
final String textOff = sdf.format(dateForSetting);
dayNameSwitch.setTextOff(textOff);
Boolean dayAbbrev = widgetSettingsDbHelper.getParamBoolean(widgetId, "forecast_day_abbrev");
boolean dayAbbrevChecked = (dayAbbrev != null)?dayAbbrev:false;

代码示例来源:origin: consp1racy/android-support-preference

private void syncSwitchView(@NonNull final View view) {
  if (view instanceof Checkable) {
    final Checkable checkable = (Checkable) view;
    final boolean isChecked = checkable.isChecked();
    if (isChecked == mChecked) return;
    if (view instanceof SwitchCompat) {
      SwitchCompat switchView = (SwitchCompat) view;
      switchView.setTextOn(this.mSwitchOn);
      switchView.setTextOff(this.mSwitchOff);
      switchView.setOnCheckedChangeListener(null);
    } else if (view instanceof Switch) {
      Switch switchView = (Switch) view;
      switchView.setTextOn(this.mSwitchOn);
      switchView.setTextOff(this.mSwitchOff);
      switchView.setOnCheckedChangeListener(null);
    }
    checkable.toggle();
    if (view instanceof SwitchCompat) {
      SwitchCompat switchView = (SwitchCompat) view;
      switchView.setOnCheckedChangeListener(mListener);
    } else if (view instanceof Switch) {
      Switch switchView = (Switch) view;
      switchView.setOnCheckedChangeListener(mListener);
    }
  }
}

相关文章