当前位置: 首页>>代码示例>>Java>>正文


Java CompoundButton.getId方法代码示例

本文整理汇总了Java中android.widget.CompoundButton.getId方法的典型用法代码示例。如果您正苦于以下问题:Java CompoundButton.getId方法的具体用法?Java CompoundButton.getId怎么用?Java CompoundButton.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.CompoundButton的用法示例。


在下文中一共展示了CompoundButton.getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCheckedChanged

import android.widget.CompoundButton; //导入方法依赖的package包/类
public void onCheckedChanged(CompoundButton buttonView,
                             boolean isChecked) {
    // prevents from infinite recursion
    if (mProtectFromCheckedChange) {
        return;
    }

    mProtectFromCheckedChange = true;
    if (mCheckedId != -1) {
        setCheckedStateForView(mCheckedId, false);
    }
    mProtectFromCheckedChange = false;

    int id = buttonView.getId();
    setCheckedId(id);
}
 
开发者ID:ZouJianFeng-Marco,项目名称:Navigation-bar,代码行数:17,代码来源:FlowRadioGroup.java

示例2: onCheckedChanged

import android.widget.CompoundButton; //导入方法依赖的package包/类
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

    if (isChecked) {

        switch (buttonView.getId()) {
            case R.id.red_color_rb:
                mBinding.testQueuedProgressbar.setBallColor(Color.RED);
                break;
            case R.id.green_color_rb:
                mBinding.testQueuedProgressbar.setBallColor(Color.GREEN);
                break;
            case R.id.blue_color_rb:
                mBinding.testQueuedProgressbar.setBallColor(Color.BLUE);
                break;
            default:
                mBinding.testQueuedProgressbar.setBallColor(0);
                break;
        }
    }
}
 
开发者ID:trdevendran,项目名称:queued-progressbar,代码行数:22,代码来源:MainActivity.java

示例3: onCheckedChanged

import android.widget.CompoundButton; //导入方法依赖的package包/类
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
    switch (compoundButton.getId()) {
        case R.id.cb_setting_night:
            if (isNull) {   //防止夜间模式MainActivity执行reCreate后重复调用
                SharedPreferenceUtil.setNightModeState(b);
                NightModeEvent event = new NightModeEvent();
                event.setNightMode(b);
                RxBus.getDefault().post(event);
            }
            break;
        case R.id.cb_setting_image:
            SharedPreferenceUtil.setNoImageState(b);
            break;
        case R.id.cb_setting_cache:
            SharedPreferenceUtil.setAutoCacheState(b);
            break;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:SettingFragment.java

示例4: onCheckedChanged

import android.widget.CompoundButton; //导入方法依赖的package包/类
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
	if(buttonView.getId() == R.id.use_username) {
		if(isChecked) {
			usernameLayout.setVisibility(View.VISIBLE);
			passwordLayout.setVisibility(View.VISIBLE);
			phoneNumberEdit.setVisibility(EditText.GONE);
			phoneNumberLayout.setVisibility(LinearLayout.GONE);
			messagePhoneNumber.setText(getString(R.string.assistant_linphone_login_desc));
			recoverAccount = false;
		} else {
			usernameLayout.setVisibility(View.GONE);
			passwordLayout.setVisibility(View.GONE);
			phoneNumberEdit.setVisibility(EditText.VISIBLE);
			phoneNumberLayout.setVisibility(LinearLayout.VISIBLE);
			messagePhoneNumber.setText(getString(R.string.assistant_create_account_part_1));
			recoverAccount = true;
		}
	}
}
 
开发者ID:treasure-lau,项目名称:Linphone4Android,代码行数:21,代码来源:LinphoneLoginFragment.java

示例5: onCheckedChanged

import android.widget.CompoundButton; //导入方法依赖的package包/类
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
	switch (buttonView.getId()) {
	case R.id.fragment_update_tree_details_missing_tree:
		mTreeIsMissing = isChecked;
		EditText noteTxt = (EditText) getActivity().findViewById(R.id.fragment_update_tree_details_note);
		
		if (isChecked) {
			noteTxt.setHint(getActivity().getResources().getString(R.string.cause_of_death));
		} else {
			noteTxt.setHint(getActivity().getResources().getString(R.string.your_note));
		}
		break;

	default:
		break;
	}
	
}
 
开发者ID:Greenstand,项目名称:treetracker-android,代码行数:19,代码来源:UpdateTreeDetailsFragment.java

示例6: onCheckedChanged

import android.widget.CompoundButton; //导入方法依赖的package包/类
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
    Log.i("AlarmFrcheckListener", "buttonView=" + buttonView);
    if (isChecked) {
        confirmable = true;
        if (buttonView.getId() == map[0]) {
            checkedOnce(true);
        } else {
            checkedOnce(false);
        }
    } else {
        for (int id : map) {
            if (((AppCompatCheckBox) findViewById(id)).isChecked()) {
                confirmable = true;
                break;
            }
            confirmable = false;
        }
    }
    mTvConfirm.setTextColor(confirmable ? context.getResources().getColor(R.color.base_blue)
            : context.getResources().getColor(R.color.forbid_click_color));
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:23,代码来源:AlarmFrDialog.java

示例7: onCheckedChanged

import android.widget.CompoundButton; //导入方法依赖的package包/类
@OnCheckedChanged({R.id.cb_setting_cache, R.id.cb_setting_image, R.id.cb_setting_night})
public void onCheckedChanged(CompoundButton view, boolean isChecked) {
    if (!mIsInited)
        return;

    switch (view.getId()) {
        case R.id.cb_setting_cache:
            mPresenter.setArticleAutoCacheState(isChecked);
            break;
        case R.id.cb_setting_image:
            mPresenter.setArticleNoImageState(isChecked);
            break;
        case R.id.cb_setting_night:
            if (mIsBundleNull) {
                mPresenter.setNightModeState(isChecked);
                NightModeEvent event = new NightModeEvent();
                event.setNightMode(isChecked);
                EventBus.getDefault().post(event);
            }
            break;
    }
}
 
开发者ID:HanyeeWang,项目名称:GeekZone,代码行数:23,代码来源:SettingFragment.java

示例8: onCheckedChanged

import android.widget.CompoundButton; //导入方法依赖的package包/类
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
    switch(buttonView.getId()) {
        case toggle_midview :
            if(isChecked)
                recyclerViewMidterm.setVisibility(View.VISIBLE);
            else
                recyclerViewMidterm.setVisibility(View.GONE);
            break;
        case toggle_finview :
            if (isChecked)
                recyclerViewFinals.setVisibility(View.VISIBLE);
            else
                recyclerViewFinals.setVisibility(View.GONE);
            break;
    }
}
 
开发者ID:inteliedoit,项目名称:thesis-project,代码行数:18,代码来源:SubjectViewActivity.java

示例9: onCheckedChanged

import android.widget.CompoundButton; //导入方法依赖的package包/类
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
    setChecking();
    compoundButton.setChecked(true);

    switch (compoundButton.getId()){
        case R.id.radioButton1:
            builder.setType(TextCounter.BYTE);
            seekBar1.setEnabled(false);
            type = TextCounter.BYTE;
            break;
        case R.id.radioButton2:
            builder.setType(TextCounter.SHORT);
            seekBar1.setEnabled(false);
            type = TextCounter.SHORT;
            break;
        case R.id.radioButton3:
            builder.setType(TextCounter.INT);
            seekBar1.setEnabled(false);
            type = TextCounter.INT;
            break;
        case R.id.radioButton4:
            builder.setType(TextCounter.FLOAT);
            seekBar1.setEnabled(true);
            type = TextCounter.FLOAT;
            break;
        case R.id.radioButton5:
            builder.setType(TextCounter.LONG);
            seekBar1.setEnabled(false);
            type = TextCounter.LONG;
            break;
        case R.id.radioButton6:
            builder.setType(TextCounter.DOUBLE);
            seekBar1.setEnabled(true);
            type = TextCounter.DOUBLE;
            break;
        default:
            return;
    }
}
 
开发者ID:BullyBoo,项目名称:TextCounter,代码行数:41,代码来源:MainActivity.java

示例10: onCheckedChanged

import android.widget.CompoundButton; //导入方法依赖的package包/类
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
    switch (compoundButton.getId()) {
        case R.id.toggle_calculator: {
            setAppEnabled(PACKAGE_NAME_CALCULATOR, checked);
            mCalculatorEnabled = checked;
            break;
        }
        case R.id.toggle_chrome: {
            setAppEnabled(PACKAGE_NAME_CHROME, checked);
            mChromeEnabled = checked;
            break;
        }
    }
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:16,代码来源:BasicManagedProfileFragment.java

示例11: onCheckedChanged

import android.widget.CompoundButton; //导入方法依赖的package包/类
@Override
    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
//        FragmentTransaction fragmentTransaction = context.getFragmentManager().beginTransaction();
//        BaseFragment fragment = ((BaseFragment) buttonView.getTag());
//        if (isChecked) {
//            fragmentTransaction.show(fragment);
//        } else {
//            fragmentTransaction.hide(fragment);
//        }
//        fragmentTransaction.commit();
        switch (buttonView.getId()) {
            case R.id.cbMessage:
                handleFragment(fragments.get(0), isChecked);
                break;
            case R.id.cbReceive:
                handleFragment(fragments.get(1), isChecked);
                break;
            case R.id.cbDiliver:
                handleFragment(fragments.get(2), isChecked);
                break;
            case R.id.cbOffice:
                handleFragment(fragments.get(3), isChecked);
                break;
            case R.id.cbMe:
                handleFragment(fragments.get(4), isChecked);
                break;
        }
    }
 
开发者ID:NaOHAndroid,项目名称:Logistics-guard,代码行数:29,代码来源:TabView.java

示例12: onCheckedChanged

import android.widget.CompoundButton; //导入方法依赖的package包/类
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
    if (buttonView.getId() == cbVolume.getId()) {
        SettingManager.getInstance().saveVolumeFlipEnable(isChecked);
    } else if (buttonView.getId() == cbAutoBrightness.getId()) {
        if (isChecked) {
            startAutoLightness();
        } else {
            stopAutoLightness();
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:ReadActivity.java

示例13: onCheckedChanged

import android.widget.CompoundButton; //导入方法依赖的package包/类
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
    if (buttonView.getId() == R.id.switchMessage) {
        // 消息通知
        SettingsUtil.updateMessageNotification(isChecked);
        if (isChecked) {
            if (!BaseSettings.sNotifyEnable) {
                // 启用消息通知
                UnreadService.startService();
                enableNotifyInterval();
            }
        } else {
            if (!mSwitchPrivateLetter.isChecked() && BaseSettings.sNotifyEnable) {
                // 停止消息通知
                UnreadService.stopService();
                disableNotifyInterval();
            }
        }
    } else if (buttonView.getId() == R.id.switchPrivateLetter) {
        // 私信通知
        SettingsUtil.updatePrivateLetterNotification(isChecked);
        if (isChecked) {
            if (!BaseSettings.sNotifyEnable) {
                // 启用消息通知
                UnreadService.startService();
                enableNotifyInterval();
            }
        } else {
            if (!mSwitchMessage.isChecked() && BaseSettings.sNotifyEnable) {
                // 停止消息通知
                UnreadService.stopService();
                disableNotifyInterval();
            }
        }
    }
}
 
开发者ID:liying2008,项目名称:Simpler,代码行数:37,代码来源:NotificationSettingsActivity.java

示例14: onCheckedChanged

import android.widget.CompoundButton; //导入方法依赖的package包/类
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
    if (mProtectFromCheckedChange) {
        return;
    }
    mProtectFromCheckedChange = true;
    if (mCheckedId != -1) {
        setCheckedStateForView(mCheckedId, false);
    }
    mProtectFromCheckedChange = false;

    int id = buttonView.getId();
    setCheckedId(id);
}
 
开发者ID:JackWHLiu,项目名称:jackknife,代码行数:14,代码来源:MultiRadioGroup.java

示例15: onCheckedChanged

import android.widget.CompoundButton; //导入方法依赖的package包/类
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
    switch (compoundButton.getId()) {
        case R.id.toolbar_switch:
            isToolbarVisible = checked;
            break;
        case R.id.drawer_switch:
            isDrawerEnabled = checked;
            break;
        default:
            break;
    }

    getFlowr().syncScreenState();
}
 
开发者ID:Fueled,项目名称:flowr,代码行数:16,代码来源:ViewFragment.java


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