• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SwitchButton类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.kyleduo.switchbutton.SwitchButton的典型用法代码示例。如果您正苦于以下问题:Java SwitchButton类的具体用法?Java SwitchButton怎么用?Java SwitchButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SwitchButton类属于com.kyleduo.switchbutton包,在下文中一共展示了SwitchButton类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
 
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:21,代码来源:UseActivity.java


示例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);
		}
	});
}
 
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:22,代码来源:StyleActivity.java


示例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);

}
 
开发者ID:tengbinlive,项目名称:info_demo,代码行数:21,代码来源:OfferReleaseActivity.java


示例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);
}
 
开发者ID:justingboy,项目名称:CouldBooks,代码行数:20,代码来源:UseActivity.java


示例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());
}
 
开发者ID:w22ee,项目名称:onekey-proxy-android,代码行数:33,代码来源:MainActivity.java


示例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);
        }
    });
}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:14,代码来源:SettingView.java


示例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);
}
 
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:12,代码来源:StyleInCodeActivity.java


示例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;
}
 
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:11,代码来源:FragSlideMenu.java


示例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);

}
 
开发者ID:tengbinlive,项目名称:info_demo,代码行数:33,代码来源:ActReleaseProductActivity.java


示例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();
}
 
开发者ID:JoeSteven,项目名称:Zatuji,代码行数:10,代码来源:SettingView.java


示例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);
}
 
开发者ID:tttony3,项目名称:WeChatHongBao,代码行数:11,代码来源:WeChatFragment.java


示例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);
    }
}
 
开发者ID:liangchenhe55,项目名称:konkeWatch,代码行数:13,代码来源:AtyDetailMini.java


示例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);
		}
	});
}
 
开发者ID:androidertc,项目名称:iLocker,代码行数:14,代码来源:SettingsFragment.java


示例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;
}
 
开发者ID:androidertc,项目名称:iLocker,代码行数:32,代码来源:NotificationAppAdapter.java


示例15: getSbToTop

import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
@Override
public SwitchButton getSbToTop() {
    return mSbToTop;
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:5,代码来源:SessionInfoActivity.java


示例16: getView

import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    final ViewHolder holder;
    //如果集合中没有数据
    if(mAlarmInfoList==null) return null;
    final AlarmInfo alarmInfo=mAlarmInfoList.get(position);
    if(convertView==null){
        holder=new ViewHolder();
        convertView=View.inflate(mActivity,R.layout.item_alarm,null);
        holder.Time= (TextView) convertView.findViewById(R.id.tv_title_item);
        holder.Desc= (TextView) convertView.findViewById(R.id.tv_desc_item);
        holder.Turn= (SwitchButton) convertView.findViewById(R.id.bt_turn_item);
        convertView.setTag(holder);
    }else{
        holder=(ViewHolder)convertView.getTag();
    }
    String hour=alarmInfo.getHour()+"";
    String minute=alarmInfo.getMinute()+"";
    if(alarmInfo.getHour()<10) hour="0"+alarmInfo.getHour();
    if(alarmInfo.getMinute()<10) minute = "0" + alarmInfo.getMinute();
    holder.Time.setText( hour+ ":" + minute);
    Boolean isAlarmOn=PrefUtils.getBoolean(mActivity, alarmInfo.getId(), true);
    //跳转开关
    toggleAlarm(holder, isAlarmOn, alarmInfo);

    holder.Turn.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked) {
                PrefUtils.putBoolean(mActivity, alarmInfo.getId(), true);
                toggleAlarm(holder, PrefUtils.getBoolean(mActivity, alarmInfo.getId(), true), alarmInfo);
                mAlarmClock.turnAlarm(alarmInfo,null,true);
               // runAlarmClock(alarmInfo);
            } else {
                PrefUtils.putBoolean(mActivity, alarmInfo.getId(), false);
                toggleAlarm(holder, PrefUtils.getBoolean(mActivity, alarmInfo.getId(), true), alarmInfo);
                mAlarmClock.turnAlarm(alarmInfo,null,false);
            }
        }
    });
    Log.d("alarm",alarmInfo.toString()+"id:"+alarmInfo.getId());
    return convertView;
}
 
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:44,代码来源:FragAlarm.java


示例17: onFinishInflate

import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    LayoutInflater.from(getContext()).inflate(R.layout.menu_right, this, true);

    /** Init Seekbar **/

    sbAlarmVolume = (SeekBar) findViewById(R.id.sb_alarm_volume);
    sbAlarmVibration = (SwitchButton) findViewById(R.id.sb_alarm_vibration);

    initVolumeSeekBar();

    /** Init Vibration **/

    sbAlarmVibration.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked) {
                sbAlarmVibration.performHapticFeedback(
                        HapticFeedbackConstants.LONG_PRESS,
                        HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
            } else {
                // The toggle is disabled
            }
        }
    });

    /** Init Ringtone **/

    mAlarmRingtonePlayer = new AlarmRingtonePlayer(XAlarmApp.getAppContext());

    lvRingtoneList = (ListView) findViewById(R.id.lv_ringtone_list);

    mAdapter = new RingtoneAdapter(mContext, R.layout.ringtone_list_item);
    lvRingtoneList.setAdapter(mAdapter);
    lvRingtoneList.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {

            Uri uri = Uri.parse(XAlarmApp.getResourcePath() + "/raw/ringtone_" + i);

            if (mAdapter.getSelectedPosition() != i) {
                mAlarmRingtonePlayer.stop();
                mAlarmRingtonePlayer.play(uri);

                mAdapter.setSelectedPosition(i);
                mAdapter.notifyDataSetChanged();
            } else {
                if(mAlarmRingtonePlayer.isPlaying()) {
                    mAlarmRingtonePlayer.stop();
                } else {
                    mAlarmRingtonePlayer.play(uri);
                }
            }
        }
    });

}
 
开发者ID:Loop-X,项目名称:X-Alarm,代码行数:59,代码来源:AlarmPreferenceSettingsMenuLayout.java


示例18: getSbToTop

import com.kyleduo.switchbutton.SwitchButton; //导入依赖的package包/类
SwitchButton getSbToTop(); 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:2,代码来源:ISessionInfoAtView.java



注:本文中的com.kyleduo.switchbutton.SwitchButton类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Job类代码示例发布时间:2022-05-21
下一篇:
Java TransientFailureException类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap