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

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

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

Switch.setVisibility介绍

暂无

代码示例

代码示例来源:origin: palaima/DebugDrawer

mobile.setVisibility(mobileToggleAvailable ? View.VISIBLE : View.GONE);
view.findViewById(R.id.dd_debug_network_mobile_label).setVisibility(mobileToggleAvailable ? View.VISIBLE : View.GONE);
bluetooth = view.findViewById(R.id.dd_debug_network_bluetooth);

代码示例来源:origin: YaphetS1/WiFi-Direct-File-Transfer-App

public static void setupTopNav(Activity activity, int titleRes, boolean showSwitch) {
 TextView tvTopNavTitle = activity.findViewById(R.id.tvTopNavTitle);
 Switch swEnableWifiDirect = activity.findViewById(R.id.swEnableWifiDirect);
 tvTopNavTitle.setText(titleRes);
 if (showSwitch) {
  swEnableWifiDirect.setVisibility(View.VISIBLE);
 } else {
  swEnableWifiDirect.setVisibility(View.INVISIBLE);
 }
}

代码示例来源:origin: konradrenner/kolabnotes-android

void showExtendedOptions(){
  mPortView.setVisibility(View.VISIBLE);
  mEnableSSLView.setVisibility(View.VISIBLE);
  mSyncView.setVisibility(View.VISIBLE);
  mKolabView.setVisibility(View.VISIBLE);
  mSharedFoldersView.setVisibility(View.VISIBLE);
  mRootFolderView.setVisibility(View.VISIBLE);
  mIntervallType.setVisibility(View.VISIBLE);
}

代码示例来源:origin: konradrenner/kolabnotes-android

void hideExtendedOptions(){
  mPortView.setVisibility(View.INVISIBLE);
  mEnableSSLView.setVisibility(View.INVISIBLE);
  mSyncView.setVisibility(View.INVISIBLE);
  mKolabView.setVisibility(View.INVISIBLE);
  mSharedFoldersView.setVisibility(View.INVISIBLE);
  mRootFolderView.setVisibility(View.INVISIBLE);
  mIntervallType.setVisibility(View.INVISIBLE);
}

代码示例来源:origin: ymback/NGA-CLIENT-VER-OPEN-SOURCE

@Override
public void onBindViewHolder(final ViewHolderEx viewHolderEx, int i) {
  SubBoard board = mBoardList.get(i);
  viewHolderEx.mCheckableView.setChecked(board.isChecked());
  viewHolderEx.mTitleView.setText(board.getName());
  if (TextUtils.isEmpty(board.getDescription())) {
    viewHolderEx.mSummaryView.setVisibility(View.GONE);
  } else {
    viewHolderEx.mSummaryView.setVisibility(View.VISIBLE);
    viewHolderEx.mSummaryView.setText(board.getDescription());
  }
  viewHolderEx.mCheckableView.setOnClickListener(mOnClickListener);
  viewHolderEx.mCheckableView.setVisibility(board.getType() >= 0 ? View.VISIBLE : View.GONE);
  viewHolderEx.itemView.setOnClickListener(mOnClickListener);
  viewHolderEx.mCheckableView.setTag(board);
  viewHolderEx.itemView.setTag(board);
}

代码示例来源:origin: zhaoyang21cn/iLiveSDK_Android_Suixinbo

private void setUpView(){
  TextView tvName = (TextView) findViewById(R.id.name);
  tvName.setText(name);
  TextView tvContent = (TextView) findViewById(R.id.content);
  tvContent.setText(getShortenStr(content));
  View bottomLine = findViewById(R.id.bottomLine);
  bottomLine.setVisibility(isBottom ? VISIBLE : GONE);
  ImageView navArrow = (ImageView) findViewById(R.id.rightArrow);
  navArrow.setVisibility(canNav ? VISIBLE : GONE);
  LinearLayout contentPanel = (LinearLayout) findViewById(R.id.contentText);
  contentPanel.setVisibility(isSwitch ? GONE : VISIBLE);
  Switch switchPanel = (Switch) findViewById(R.id.btnSwitch);
  switchPanel.setVisibility(isSwitch?VISIBLE:GONE);
}

代码示例来源:origin: xia-weiyang/MainScreenShow

0);
sw.setVisibility(View.VISIBLE);
sw.setChecked(sp_setA.getBoolean("color", true));
sw.setOnCheckedChangeListener(new OnCheckedChangeListener() {

代码示例来源:origin: xia-weiyang/MainScreenShow

sw = (Switch) convertView
    .findViewById(R.id.sw_msseventset);
sw.setVisibility(View.VISIBLE);
sw.setChecked(sp_setA.getBoolean("shadow", true));
sw.setOnCheckedChangeListener(new OnCheckedChangeListener() {

代码示例来源:origin: xia-weiyang/MainScreenShow

.getAnimationInfo(BaseSet.this)[C.ANIMATION_STARSHINE],
    0);
sw.setVisibility(View.VISIBLE);
sw.setChecked(sp_setA.getBoolean("starmeteorswitch",
    true));

代码示例来源:origin: xia-weiyang/MainScreenShow

Switch sw = (Switch) convertView.findViewById(R.id.sw_msseventset);
title1.setText(title);
sw.setVisibility(View.VISIBLE);
if (sp_date.getString("state" + VALUE, "").equals(getString(R.string.action_started)))

代码示例来源:origin: xia-weiyang/MainScreenShow

Switch sw = (Switch) convertView
    .findViewById(R.id.sw_msseventset);
sw.setVisibility(View.VISIBLE);
sw.setChecked(sp_setA.getBoolean("onlyone", false));
sw.setOnCheckedChangeListener(new OnCheckedChangeListener() {

代码示例来源:origin: xia-weiyang/MainScreenShow

final Switch sw = (Switch) convertView.findViewById(R.id.sw_msseventset);
title1.setText(title);
sw.setVisibility(View.VISIBLE);
if(isStart){
  sw.setChecked(true);

代码示例来源:origin: oliexdev/openScale

measurementSwitch.setVisibility(View.INVISIBLE);

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

send_on_battery_change_switch.setVisibility(View.GONE);
send_on_alarm_change_switch.setVisibility(View.GONE);

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

showLocationSwitch.setVisibility(View.VISIBLE);
  showLocationSwitch.setChecked(showLocation);
  showLocationSwitch.setOnCheckedChangeListener(showLocationSwitchListener);
} else {
  showLocationSwitch.setVisibility(View.GONE);

代码示例来源:origin: wasdennnoch/AndroidN-ify

mQsDetailHeaderSwitch.setVisibility(View.INVISIBLE);
  mQsDetailHeader.setClickable(false);
} else {
  mQsDetailHeaderSwitch.setVisibility(View.VISIBLE);
  mQsDetailHeaderSwitch.setChecked(toggleState);
  mQsDetailHeader.setClickable(true);

代码示例来源:origin: wasdennnoch/AndroidN-ify

final Boolean toggleState = (Boolean) XposedHelpers.callMethod(adapter, "getToggleState");
if (toggleState == null) {
  mQsDetailHeaderSwitch.setVisibility(INVISIBLE);
  mQsDetailHeader.setClickable(false);
} else {
  mQsDetailHeaderSwitch.setVisibility(VISIBLE);
  handleToggleStateChanged(toggleState, true);
  mQsDetailHeader.setClickable(true);

代码示例来源:origin: linglongxin24/ARDevelopDemo

newSwitchView.setTextSize(mEntriesTextSize);
newSwitchView.setTag(command);
newSwitchView.setVisibility(View.VISIBLE);
newSwitchView.setPadding(mEntriesSidesPadding,
  mEntriesUpDownPadding, mEntriesSidesPadding,

相关文章