本文整理了Java中android.widget.ImageButton.isSelected()
方法的一些代码示例,展示了ImageButton.isSelected()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageButton.isSelected()
方法的具体详情如下:
包路径:android.widget.ImageButton
类名称:ImageButton
方法名:isSelected
暂无
代码示例来源:origin: 123ufo/DWImageSelector
@Override
public void onCheckedChanged(View parent, ImageButton imageButton, int position, boolean check) {
Log.d(TAG, "onCheckedChanged:--> 之前: " + imageButton.isSelected());
addOrSub(parent, imageButton, position);
Log.d(TAG, "onCheckedChanged:--> 之后: " + imageButton.isSelected());
}
}
代码示例来源:origin: 123ufo/DWImageSelector
@Override
public void onClick(View v) {
mOnImageCheckboxCheckListener.onCheckedChanged(itemView,(ImageButton) v,
ViewHolder.this.getLayoutPosition(), ibSelect.isSelected());
}
});
代码示例来源:origin: adafruit/Bluefruit_LE_Connect_Android
public void onClickNotifyCharacteristic(View view) {
ElementPath elementPath = (ElementPath) view.getTag();
if (elementPath != null) {
// Check if is a characteristic
if (elementPath.characteristicUUID != null && elementPath.descriptorUUID == null) {
BluetoothGattService service = mBleManager.getGattService(elementPath.serviceUUID, elementPath.serviceInstance);
if (mBleManager.isCharacteristicNotifiable(service, elementPath.characteristicUUID)) {
Log.d(TAG, "Notify char");
ImageButton imageButton = (ImageButton) view;
final boolean selected = !imageButton.isSelected();
imageButton.setSelected(selected);
mBleManager.enableNotification(service, elementPath.characteristicUUID, selected);
// Button color effect when pressed
imageButton.setImageResource(selected ? R.drawable.ic_sync_white_24dp : R.drawable.ic_sync_black_24dp);
}
}
}
}
代码示例来源:origin: mkulesh/microMathematics
for (Map.Entry<ListChangeIf.Position, ImageButton> e : positionButtons.entrySet())
if (e.getValue().isSelected())
for (Map.Entry<ListChangeIf.FormulaType, ImageButton> e : objectButtons.entrySet())
if (e.getValue().isSelected())
代码示例来源:origin: mkulesh/microMathematics
protected void setButtonSelected(ImageButton b, boolean isSelected)
{
b.setSelected(isSelected);
if (b.isSelected())
{
b.setBackgroundResource(R.drawable.formula_term_border);
CompatUtils.setDrawableColorAttr(getContext(), b.getBackground(), R.attr.colorAccent);
}
else
{
b.setBackgroundResource(android.R.color.transparent);
}
ViewUtils.setImageButtonColorAttr(getContext(), b,
b.isSelected() ? R.attr.colorAccent : R.attr.colorDialogContent);
}
代码示例来源:origin: guofudong/EShop
@OnClick(R.id.button_favorite) void collectGoods() {
// 收藏商品
if (btnFavorite.isSelected()) {
ToastWrapper.show(R.string.collect_msg_already_collected);
return;
}
if (!UserManager.getInstance().hasUser()) {
Intent intent = new Intent(getContext(), SignInActivity.class);
startActivity(intent);
return;
}
mProgressWrapper.showProgress(this);
ApiCollectCreate apiCollectCreate = new ApiCollectCreate(mGoodsInfo.getId());
enqueue(apiCollectCreate);
}
}
代码示例来源:origin: mkulesh/microMathematics
if (e.getValue().isSelected())
代码示例来源:origin: anyRTC/anyRTC-RTMPC-Android
if (btnAudio.isSelected()) {
btnAudio.setSelected(false);
mGuestKit.setLocalAudioEnable(true);
代码示例来源:origin: anyRTC/anyRTC-RTMPC-Android
switch (view.getId()) {
case R.id.btn_jingxiang:
if (btnJingxiang.isSelected()) {
btnJingxiang.setSelected(false);
RTMPCHybrid.Inst().setFrontCameraMirrorEnable(false);
if (btnAudio.isSelected()) {
btnAudio.setSelected(false);
mGuestKit.setLocalAudioEnable(false);
if (btnVideo.isSelected()) {
btnVideo.setSelected(false);
mGuestKit.setLocalVideoEnable(true);
代码示例来源:origin: anyRTC/anyRTC-RTMPC-Android
switch (view.getId()) {
case R.id.btn_audio:
if (btnAudio.isSelected()) {
btnAudio.setSelected(false);
mHosterKit.setLocalAudioEnable(true);
代码示例来源:origin: anyRTC/anyRTC-RTMPC-Android
if (btnCamare.isSelected()) {
btnCamare.setSelected(false);
} else {
return;
if (btnAudio.isSelected()) {
btnAudio.setSelected(false);
mHosterKit.setLocalAudioEnable(true);
return;
if (btnVideo.isSelected()) {
btnVideo.setSelected(false);
mHosterKit.setLocalVideoEnable(true);
if (btnJingxiang.isSelected()) {
btnJingxiang.setSelected(false);
RTMPCHybrid.Inst().setFrontCameraMirrorEnable(false);
if (tvMode2.isSelected()) {
tvMode2.setSelected(false);
tvMode1.setSelected(true);
if (tvMode1.isSelected()) {
tvMode2.setSelected(true);
tvMode1.setSelected(false);
内容来源于网络,如有侵权,请联系作者删除!