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

Java Switch类代码示例

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

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



Switch类属于org.jraf.android.backport.switchwidget包,在下文中一共展示了Switch类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onBindView

import org.jraf.android.backport.switchwidget.Switch; //导入依赖的package包/类
@Override
protected void onBindView(View view) {
    super.onBindView(view);

    Switch checkableView = (Switch) view.findViewById(R.id.switchWidget);

    if (checkableView != null) {
        checkableView.setFocusableInTouchMode(false);
        checkableView.setFocusable(false);
        checkableView.setClickable(false);
    }
}
 
开发者ID:chdir,项目名称:aria2-android,代码行数:13,代码来源:SaneSwitch.java


示例2: onCreateView

import org.jraf.android.backport.switchwidget.Switch; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {
	fragmentRootView = inflater.inflate(R.layout.fragment_information, container, false);

	JourneyProperties prop = JourneyProperties.getInstance(getActivity());
	String journeyDateString = DateFormat.getDateFormat(getActivity()).format(prop.getJourneyDate())
			+ " " + DateFormat.getTimeFormat(getActivity()).format(prop.getJourneyDate());

	((TextView) fragmentRootView.findViewById(R.id.info_journeyName_value)).setText(prop.getJourneyName());
	((TextView) fragmentRootView.findViewById(R.id.info_journeyDate_value)).setText(journeyDateString);
	((TextView) fragmentRootView.findViewById(R.id.info_journeyLocation_value))
			.setText(prop.getJourneyStartLocation());
	((TextView) fragmentRootView.findViewById(R.id.info_journeyFurtherInformation_value))
			.setText(prop.getJourneyFurtherInformation());

	locationServiceButton = (Switch) fragmentRootView.findViewById(R.id.locationServiceButton);
	info_mapFollowingUserButton = (Switch) fragmentRootView.findViewById(R.id.info_mapFollowingUserButton);

	locationServiceButton.setOnClickListener(this);
	info_mapFollowingUserButton.setOnClickListener(this);
	((Button) fragmentRootView.findViewById(R.id.info_resetJourneyButton)).setOnClickListener(this);
	((TextView) fragmentRootView.findViewById(R.id.info_flattr)).setOnClickListener(this);
	((TextView) fragmentRootView.findViewById(R.id.info_acknowledgement)).setOnClickListener(this);
	((TextView) fragmentRootView.findViewById(R.id.info_license)).setOnClickListener(this);

	return fragmentRootView;
}
 
开发者ID:t-animal,项目名称:JourneyApp,代码行数:29,代码来源:InformationFragment.java


示例3: onCreateOptionsMenu

import org.jraf.android.backport.switchwidget.Switch; //导入依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.main, menu);

    mMasterSwitch =
            (Switch) MenuItemCompat.getActionView(menu.findItem(R.id.action_master_switch));
    mMasterSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked) {
                if (mActionBar.getSelectedNavigationIndex() == 0) {
                    PolicyFragment fragment = (PolicyFragment) mPagerAdapter.getCurrentItem();
                    mSupervisor.changePolicy(fragment.getSelectedPolicy());
                }
                mSupervisor.activateOppNet();
            } else {
                mSupervisor.deactivateOppNet();
            }
        }
    });
    if (mSupervisor != null) {
        mMasterSwitch.setChecked(mSupervisor.isActivated());
    }

    return true;
}
 
开发者ID:saschat,项目名称:WLAN-Opp,代码行数:29,代码来源:MainActivity.java


示例4: onResume

import org.jraf.android.backport.switchwidget.Switch; //导入依赖的package包/类
@Override
protected void onResume() {
	super.onResume();
	if (CallerFlashlight.LOG) Log.d(TAG, "onResumed");
	callFlashButton = (Switch) findViewById(R.id.callFlashToggle);
	callFlashButton.setChecked(callerFlashlight.isCallFlash());
	callFlashTestButton = (ToggleButton) findViewById(R.id.callFlashTestToggle);
	callFlashTestButton.setChecked(callerFlashlight.isCallFlashTest());
	msgFlashButton = (Switch) findViewById(R.id.msgFlashToggle);
	msgFlashButton.setChecked(callerFlashlight.isMsgFlash());
	msgFlashTestButton = (ToggleButton) findViewById(R.id.msgFlashTestToggle);
	msgFlashTestButton.setChecked(callerFlashlight.isMsgFlashTest());
}
 
开发者ID:spirosbond,项目名称:CallerFlashlight,代码行数:14,代码来源:MainPanel.java


示例5: callFlashCreate

import org.jraf.android.backport.switchwidget.Switch; //导入依赖的package包/类
private void callFlashCreate() {
	callFlashButton = (Switch) findViewById(R.id.callFlashToggle);
	callFlashButton.setChecked(callerFlashlight.isCallFlash());
	//		callFlashButton.setOnClickListener(this);
	callFlashButton.setOnCheckedChangeListener(this);
	callFlashButton.setTextOn(getResources().getString(R.string.ON));
	callFlashButton.setTextOff(getResources().getString(R.string.OFF));
	callFlashButton.setText(getResources().getString(R.string.Callseperator));


	callFlashTestButton = (ToggleButton) findViewById(R.id.callFlashTestToggle);
	callFlashTestButton.setChecked(callerFlashlight.isCallFlashTest());
	callFlashTestButton.setOnClickListener(this);

	callFlashOnBar = (SeekBar) findViewById(R.id.flashOnDurationBar);
	callFlashOnBar.setProgress(callerFlashlight.getCallFlashOnDuration());
	callFlashOnBar.setMax(1000);

	callFlashOffBar = (SeekBar) findViewById(R.id.flashOffDurationBar);
	callFlashOffBar.setProgress(callerFlashlight.getCallFlashOffDuration());
	callFlashOffBar.setMax(1000);

	callFlashOnBarValue = (EditText) findViewById(R.id.flashOnDurationValue);
	callFlashOnBarValue.setText(String.valueOf(callFlashOnBar.getProgress()));
	callFlashOnBarValue.addTextChangedListener(this);
	callFlashOnBarValue.setOnFocusChangeListener(this);

	callFlashOffBarValue = (EditText) findViewById(R.id.flashOffDurationValue);
	callFlashOffBarValue.setText(String.valueOf(callFlashOffBar.getProgress()));
	callFlashOffBarValue.addTextChangedListener(this);
	callFlashOffBarValue.setOnFocusChangeListener(this);

	callFlashOnBar.setOnSeekBarChangeListener(seekBarChange);

	callFlashOffBar.setOnSeekBarChangeListener(seekBarChange);
}
 
开发者ID:spirosbond,项目名称:CallerFlashlight,代码行数:37,代码来源:MainPanel.java


示例6: onToggleMapFollowingUser

import org.jraf.android.backport.switchwidget.Switch; //导入依赖的package包/类
private void onToggleMapFollowingUser(View view) {
	JourneyPreferences.mapFollowsUser(this, ((Switch) view).isChecked());
}
 
开发者ID:t-animal,项目名称:JourneyApp,代码行数:4,代码来源:InformationFragment.java


示例7: onCreateView

import org.jraf.android.backport.switchwidget.Switch; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    View view = inflater.inflate(R.layout.setting_fragment, container,
            false);

    initActionBar(inflater, view);

    mCoverImage = (ImageView) view
            .findViewById(R.id.iv_setting_cover_image);
    mUserName = (P1TextView) view.findViewById(R.id.tv_setting_username);
    mThumbImage = (ImageView) view
            .findViewById(R.id.iv_setting_thumb_image);
    mEmailTextView = (P1TextView) view.findViewById(R.id.tv_setting_email);
    mToggleSwitch = (Switch) view.findViewById(R.id.switchWidget);
    mToggleSwitch.setTextOff(getResources().getString(
            R.string.setting_switch_off));
    mToggleSwitch.setTextOn(getResources().getString(
            R.string.setting_switch_on));
    mToggleSwitch.setOnClickListener(this);
    mToggleSwitch.setOnCheckedChangeListener(this);

    mChangeProfilePictureRelativeLayout = (RelativeLayout) view
            .findViewById(R.id.rl_setting_change_profile_picture);
    mChangeProfilePictureRelativeLayout.setOnClickListener(this);
    mChangeCoverPictureRelativeLayout = (RelativeLayout) view
            .findViewById(R.id.rl_setting_change_cover_picture);
    mChangeCoverPictureRelativeLayout.setOnClickListener(this);
    mEditPersonalInformationRelativeLayout = (RelativeLayout) view
            .findViewById(R.id.rl_setting_edit_personal_information);
    mEditPersonalInformationRelativeLayout.setOnClickListener(this);
    mEmailRelativeLayout = (RelativeLayout) view
            .findViewById(R.id.rl_setting_email);
    mEmailRelativeLayout.setOnClickListener(this);
    mChangePasswordRelativeLayout = (RelativeLayout) view
            .findViewById(R.id.rl_setting_change_passwd);
    mChangePasswordRelativeLayout.setOnClickListener(this);

    mSignOutButton = (Button) view.findViewById(R.id.btn_setting_sign_out);
    mSignOutButton.setOnClickListener(this);

    return view;
}
 
开发者ID:cuipengpeng,项目名称:p1-android,代码行数:45,代码来源:SettingFragment.java


示例8: msgFlashCreate

import org.jraf.android.backport.switchwidget.Switch; //导入依赖的package包/类
private void msgFlashCreate() {
	msgFlashButton = (Switch) findViewById(R.id.msgFlashToggle);
	msgFlashButton.setChecked(callerFlashlight.isMsgFlash());
	//		msgFlashButton.setOnClickListener(this);
	msgFlashButton.setOnCheckedChangeListener(this);
	msgFlashButton.setTextOn(getResources().getString(R.string.ON));
	msgFlashButton.setTextOff(getResources().getString(R.string.OFF));
	msgFlashButton.setText(getResources().getString(R.string.Msgseperator));

	msgFlashTestButton = (ToggleButton) findViewById(R.id.msgFlashTestToggle);
	msgFlashTestButton.setChecked(callerFlashlight.isMsgFlashTest());
	msgFlashTestButton.setOnClickListener(this);

	msgFlashOnBar = (SeekBar) findViewById(R.id.flashOnDurationBarMsg);
	msgFlashOnBar.setProgress(callerFlashlight.getMsgFlashOnDuration());
	msgFlashOnBar.setMax(1000);

	msgFlashOffBar = (SeekBar) findViewById(R.id.flashOffDurationBarMsg);
	msgFlashOffBar.setProgress(callerFlashlight.getMsgFlashOffDuration());
	msgFlashOffBar.setMax(1000);

	//		msgFlashDurBar = (SeekBar) findViewById(R.id.flashDurationBarMsg);
	//		msgFlashDurBar.setProgress(callerFlashlight.getMsgFlashDuration());
	//		msgFlashDurBar.setMax(10);

	msgFlashOnBarValue = (EditText) findViewById(R.id.flashOnDurationValueMsg);
	msgFlashOnBarValue.setText(String.valueOf(msgFlashOnBar.getProgress()));
	msgFlashOnBarValue.addTextChangedListener(this);
	msgFlashOnBarValue.setOnFocusChangeListener(this);

	msgFlashOffBarValue = (EditText) findViewById(R.id.flashOffDurationValueMsg);
	msgFlashOffBarValue.setText(String.valueOf(msgFlashOffBar.getProgress()));
	msgFlashOffBarValue.addTextChangedListener(this);
	msgFlashOffBarValue.setOnFocusChangeListener(this);


	//		msgFlashDurBarValue = (EditText) findViewById(R.id.flashDurationValueMsg);
	//		msgFlashDurBarValue.setText(String.valueOf(msgFlashDurBar.getProgress()));
	//		msgFlashDurBarValue.addTextChangedListener(this);

	msgFlashOnBar.setOnSeekBarChangeListener(seekBarChange);

	msgFlashOffBar.setOnSeekBarChangeListener(seekBarChange);

	//		msgFlashDurBar.setOnSeekBarChangeListener(seekBarChange);
}
 
开发者ID:spirosbond,项目名称:CallerFlashlight,代码行数:47,代码来源:MainPanel.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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