本文整理汇总了Java中com.kyleduo.switchbutton.SwitchButton类的典型用法代码示例。如果您正苦于以下问题:Java SwitchButton类的具体用法?Java SwitchButton怎么用?Java SwitchButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SwitchButton类属于com.kyleduo.switchbutton包,在下文中一共展示了SwitchButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findView
import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
private void findView() {
mListenerSb = (SwitchButton) findViewById(R.id.sb_use_listener);
mLongSb = (SwitchButton) findViewById(R.id.sb_use_long);
mToggleSb = (SwitchButton) findViewById(R.id.sb_use_toggle);
mCheckedSb = (SwitchButton) findViewById(R.id.sb_use_checked);
mDelaySb = (SwitchButton) findViewById(R.id.sb_use_delay);
mPb = (ProgressBar) findViewById(R.id.pb);
mPb.setProgress(0);
mPb.setMax(1000);
mStartBt = (Button) findViewById(R.id.long_start);
mToggleAniBt = (Button) findViewById(R.id.toggle_ani);
mToggleNotAniBt = (Button) findViewById(R.id.toggle_not_ani);
mCheckedAniBt = (Button) findViewById(R.id.checked_ani);
mCheckNotAniBt = (Button) findViewById(R.id.checked_not_ani);
mListenerFinish = (TextView) findViewById(R.id.listener_finish);
mListenerFinish.setVisibility(mListenerSb.isChecked() ? View.VISIBLE : View.INVISIBLE);
}
示例2: onCreate
import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_style);
SwitchButton disableSb = (SwitchButton) findViewById(R.id.sb_disable_control);
mFlymeSb = (SwitchButton) findViewById(R.id.sb_custom_flyme);
mMiuiSb = (SwitchButton) findViewById(R.id.sb_custom_miui);
mCustomSb = (SwitchButton) findViewById(R.id.sb_custom);
mDefaultSb = (SwitchButton) findViewById(R.id.sb_default);
disableSb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mFlymeSb.setEnabled(isChecked);
mMiuiSb.setEnabled(isChecked);
mCustomSb.setEnabled(isChecked);
mDefaultSb.setEnabled(isChecked);
}
});
}
示例3: findView
import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
private void findView() {
SwitchButton sw_bt = (SwitchButton) findViewById(R.id.sw_bt);
sw_bt.setChecked(true);
sw_bt.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
isPublic = b;
}
});
//赏金
offer_money_et = (EditText) findViewById(R.id.offer_money_et);
valid_offer_money = (TextView) findViewById(R.id.valid_offer_money);
//详情
value_ly = (EditTextWithDelete) findViewById(R.id.value_ly);
value_ly.setHint(R.string.offer_release_value_hint);
}
示例4: findView
import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
private void findView() {
mListenerSb = (SwitchButton) findViewById(R.id.sb_use_listener);
mLongSb = (SwitchButton) findViewById(R.id.sb_use_long);
mToggleSb = (SwitchButton) findViewById(R.id.sb_use_toggle);
mCheckedSb = (SwitchButton) findViewById(R.id.sb_use_checked);
mPb = (ProgressBar) findViewById(R.id.pb);
mPb.setProgress(0);
mPb.setMax(100);
mStartBt = (Button) findViewById(R.id.long_start);
mToggleAniBt = (Button) findViewById(R.id.toggle_ani);
mToggleNotAniBt = (Button) findViewById(R.id.toggle_not_ani);
mCheckedAniBt = (Button) findViewById(R.id.checked_ani);
mCheckNotAniBt = (Button) findViewById(R.id.checked_not_ani);
mListenerFinish = (TextView) findViewById(R.id.listener_finish);
mListenerFinish.setVisibility(mListenerSb.isChecked() ? View.VISIBLE : View.INVISIBLE);
}
示例5: onCreate
import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
scrollViewLog = (ScrollView) findViewById(R.id.scrollViewLog);
textViewLog = (TextView) findViewById(R.id.textViewLog);
proxyIpAddEt = (EditText) findViewById(R.id.proxy_ip_add_et);
setttingLL = (LinearLayout) findViewById(R.id.setting_ll);
proxyIpPortEt = (EditText) findViewById(R.id.proxy_ip_port_et);
proxyAppEt = (EditText) findViewById(R.id.proxy_app_et);
ipChangeTips = (TextView) findViewById(R.id.ip_change_tips);
switchProxy = (SwitchButton) findViewById(R.id.proxy_switch);
mCalendar = Calendar.getInstance();
ipChangeTips.setText("");
textViewLog.setText(GL_HISTORY_LOGS);
scrollViewLog.fullScroll(ScrollView.FOCUS_DOWN);
LocalVpnService.addOnStatusChangedListener(this);
switchProxy.setChecked(LocalVpnService.IsRunning);
switchProxy.setOnClickListener(this);
switchProxy.setOnCheckedChangeListener(this);
if (!TextUtils.isEmpty(readConfigUrl())) {
proxyIpAddEt.setText(readConfigUrl());
}
System.out.println("oncreate vpn");
duelIntent(getIntent());
}
示例6: initView
import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
private void initView() {
View.inflate(getContext(), R.layout.view_setting_view,this);
title = (TextView) findViewById(R.id.tv_title_setting);
desc = (TextView) findViewById(R.id.tv_desc_setting);
sb = (SwitchButton) findViewById(R.id.switch_setting);
setTitleAndDesc(mTitle, mDesc);
sb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if(mListener!=null) mListener.onChanged(buttonView,isChecked);
}
});
}
示例7: onCreate
import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_style_in_code);
mChangeSb = (SwitchButton) findViewById(R.id.sb_code);
ListView optLv = (ListView) findViewById(R.id.opt_lv);
optLv.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, android.R.id.text1, opts));
optLv.setOnItemClickListener(this);
}
示例8: initView
import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
@Override
public View initView() {
View view=View.inflate(mActivity, R.layout.fragment_menu,null);
mChangeCity = (LinearLayout) view.findViewById(R.id.ll_change_city);
mCurrentCity = (TextView) view.findViewById(R.id.tv_current_city);
mCloseWether = (SwitchButton) view.findViewById(R.id.sb_close_wether);
mOpenVibrate = (SwitchButton) view.findViewById(R.id.sb_open_vibrate);
mVolume = (SeekBar) view.findViewById(R.id.seek_volume_adjust);
return view;
}
示例9: findView
import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
private void findView() {
endDate = Calendar.getInstance();
SwitchButton sw_bt = (SwitchButton) findViewById(R.id.public_sw_bt);
sw_bt.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
isPublic = b;
}
});
sw_bt.setChecked(true);
//产品名称
LinearLayout titleLy = (LinearLayout) findViewById(R.id.title_ly);
TextView release_title_tv = (TextView) titleLy.findViewById(R.id.release_title_tv);
release_value_et = (EditText) titleLy.findViewById(R.id.release_value_et);
release_title_tv.setText(R.string.act_release_product_title);
release_value_et.setHint(R.string.act_release_product_title_hint);
//时间
date_value_tv = (TextView) findViewById(R.id.date_value_tv);
date_value_tv.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
showDateDialog();
}
});
//详情
value_ly = (EditTextWithDelete) findViewById(R.id.value_ly);
value_ly.setHint(R.string.act_release_product_value_hint);
}
示例10: initView
import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
private void initView() {
inflate(getContext(), R.layout.view_setting,this);
mRoot = (RelativeLayout) findViewById(R.id.setting_root);
mTitle = (TextView) findViewById(R.id.setting_title);
mDesc = (TextView) findViewById(R.id.setting_desc);
mHint = (TextView) findViewById(R.id.setting_show);
mSwitch = (SwitchButton) findViewById(R.id.setting_switch);
initListener();
}
示例11: findView
import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
private void findView() {
btn_list = (SwitchButton) view.findViewById(R.id.SwitchButton_list);
btn_notification = (SwitchButton) view.findViewById(R.id.SwitchButton_notification);
btn_chat = (SwitchButton) view.findViewById(R.id.SwitchButton_chat);
btn_defense = (SwitchButton) view.findViewById(R.id.SwitchButton_defense);
ed_delay = (EditText) view.findViewById(R.id.ed_delay);
ed_field = (EditText) view.findViewById(R.id.ed_field);
ed_probability = (EditText) view.findViewById(R.id.ed_probability);
btn = (Button) view.findViewById(R.id.btn);
}
示例12: initView
import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
private void initView() {
setContentView(R.layout.aty_detail_mini);
cbState = (CheckBox) findViewById(R.id.cbState);
bar = (MyBar) findViewById(R.id.bar);
sbPowerProtect = (SwitchButton) findViewById(R.id.sbPowerProtect);
sbLight = (SwitchButton) findViewById(R.id.sbLight);
sbPowerProtect.setEnabled(false);
if (getIntent().getIntExtra(INTENT_DEVICE_TYPE, 0) != Unit.DEVICE_TYPE_2) {
sbLight.setEnabled(false);
}
}
示例13: initUI
import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
private void initUI() {
mRootLayout.findViewById(R.id.rl_onkey_lock).setOnClickListener(this);
mRootLayout.findViewById(R.id.rl_disable_system_lock).setOnClickListener(this);
mRootLayout.findViewById(R.id.rl_change_password).setOnClickListener(this);
SwitchButton sbEnable = (SwitchButton) mRootLayout.findViewById(R.id.sb_service_enable);
sbEnable.setChecked(mConfig.isServiceEnable());
sbEnable.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mConfig.setServiceEnable(isChecked);
}
});
}
示例14: getView
import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if(convertView == null) {
convertView = inflater.inflate(R.layout.list_item_notification_app, parent, false);
holder = new ViewHolder();
holder.iv_app_icon = (ImageView) convertView.findViewById(R.id.iv_app_icon);
holder.tv_app_name = (TextView) convertView.findViewById(R.id.tv_app_name);
holder.sb_notification_enable = (SwitchButton) convertView.findViewById(R.id.sb_notification_enable);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
final NotificationApp app = apps.get(position);
loader.display(holder.iv_app_icon, app.getPkgName());
holder.tv_app_name.setText(app.getLabel());
holder.sb_notification_enable.setChecked(app.isShowNotification());
convertView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
app.setShowNotification(!app.isShowNotification());
if(app.isShowNotification()) {
dao.add(app);
} else {
dao.delete(app.getPkgName());
}
notifyDataSetChanged();
}
});
return convertView;
}
示例15: getSbToTop
import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
@Override
public SwitchButton getSbToTop() {
return mSbToTop;
}