本文整理了Java中android.widget.Switch.setOnClickListener()
方法的一些代码示例,展示了Switch.setOnClickListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Switch.setOnClickListener()
方法的具体详情如下:
包路径:android.widget.Switch
类名称:Switch
方法名:setOnClickListener
暂无
代码示例来源:origin: willowtreeapps/Hyperion-Android
private MutableBooleanAttributeViewHolder(View itemView) {
super(itemView);
keyText = itemView.findViewById(R.id.key_text);
booleanSwitch = itemView.findViewById(R.id.boolean_switch);
booleanSwitch.setOnClickListener(this);
}
代码示例来源:origin: googlesamples/android-BluetoothAdvertisements
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_advertiser, container, false);
mSwitch = (Switch) view.findViewById(R.id.advertise_switch);
mSwitch.setOnClickListener(this);
return view;
}
代码示例来源:origin: ymback/NGA-CLIENT-VER-OPEN-SOURCE
@Override
public UserViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View convertView = LayoutInflater.from(mContext).inflate(R.layout.list_user_manager_item, parent, false);
UserViewHolder holder = new UserViewHolder(convertView);
holder.itemView.setOnClickListener(mOnClickListener);
holder.checkView.setOnClickListener(mOnClickListener);
return holder;
}
代码示例来源:origin: niugao/RecyclerListTreeView
public ContactViewHolder(View itemView) {
super(itemView);
imageViewHead = itemView.findViewById(R.id.imageViewHead);
textViewTitle = itemView.findViewById(R.id.textViewTitle);
textViewDetail = itemView.findViewById(R.id.textViewDetail);
aSwitch = itemView.findViewById(R.id.switchChecked);
//应响应点击事件而不是CheckedChange事件,因为那样会引起事件的递归触发
aSwitch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
int nodePlaneIndex = getAdapterPosition();
ListTree.TreeNode node = tree.getNodeByPlaneIndex(nodePlaneIndex);
node.setChecked(!node.isChecked());
//改变所有的子孙们的状态
int count =tree.setDescendantChecked(nodePlaneIndex,node.isChecked());
notifyItemRangeChanged(nodePlaneIndex,count+1);
}
});
}
}
代码示例来源:origin: niugao/RecyclerListTreeView
aSwitch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
代码示例来源:origin: offensive-security/nethunter-app
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.nethunter, container, false);
TextView ip = (TextView) rootView.findViewById(R.id.editText2);
ip.setFocusable(false);
addClickListener(new View.OnClickListener() {
public void onClick(View v) {
getExternalIp();
}
}, rootView);
getInterfaces(rootView);
// HID Switch for newer kernels to turn on HID
HIDSwitch = (Switch) rootView.findViewById(R.id.hidSWITCH);
HIDSwitch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(HIDSwitch.isChecked())
{
setHIDON();
}
else {
setHIDOff();
}
}
});
return rootView;
}
代码示例来源: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: Simon-Leeeeeeeee/SLWidget
@Override
public void onCreate(Bundle savedInstanceState) {
if (savedInstanceState != null) {
mRandomColor = savedInstanceState.getInt("randomColor", 0);
}
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_swipeback);
mIndex = getIntent().getIntExtra("index", 1);
Toolbar toolbar = getToolbar();
if (toolbar != null) {
toolbar.setTitle(getText(R.string.swipeback) + "-" + mIndex);
toolbar.setNavigationOnClickListener(this);
}
mSwitch_SupportLandscape = findViewById(R.id.swipeback_swicth_support_landscape);
boolean supportLandscape = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("landscape_support", false);
mSwitch_SupportLandscape.setChecked(supportLandscape);
mSwitch_SupportLandscape.setOnClickListener(this);
findViewById(R.id.swipeback_rootlayout).setBackgroundColor(mRandomColor);
findViewById(R.id.swipeback_btn_next).setOnClickListener(this);
}
代码示例来源:origin: iternull/secure-if
SwitchConnection = (Switch) findViewById(R.id.switch_usbdata);
SwitchCharge.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SwitchConnection.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
代码示例来源:origin: andresth/Kandroid
toggle.setOnClickListener(toggleClick);
check.setOnClickListener(new View.OnClickListener() {
@Override
代码示例来源:origin: EthACKdotOrg/orWall
orwallStatus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
代码示例来源:origin: xuhongv/SmartHome
mSwLight.setOnClickListener(this);
代码示例来源:origin: suraj0208/WhatsappExtensions
switchBlackWhite.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
代码示例来源:origin: stackoverflow.com
switchView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
代码示例来源:origin: EthACKdotOrg/orWall
browserStatus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
sipStatus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
内容来源于网络,如有侵权,请联系作者删除!