本文整理了Java中android.widget.Button.setFocusable()
方法的一些代码示例,展示了Button.setFocusable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setFocusable()
方法的具体详情如下:
包路径:android.widget.Button
类名称:Button
方法名:setFocusable
暂无
代码示例来源:origin: stackoverflow.com
Button button = (Button) view.findViewById(R.id.yourButton);
//where button is the button on listView, and view is the view of your item on list
button.setFocusable(false); /// THIS IS THE SOLUTION
button.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
//button functionalty ...
}
});
代码示例来源:origin: openMF/mobile-wallet
@OnClick(R.id.btn_vpa)
public void onVPASelected() {
mBtnVpa.setFocusable(true);
mBtnVpa.setFocusableInTouchMode(true);
mBtnVpa.setBackgroundResource(R.drawable.button_round_primary);
mBtnMobile.setBackgroundResource(R.drawable.button_round_stroke);
mBtnVpa.setTextColor(getResources().getColor(android.R.color.white));
mBtnMobile.setTextColor(getResources().getColor(android.R.color.black));
mRlMobile.setVisibility(View.GONE);
mTilVpa.setVisibility(View.VISIBLE);
}
代码示例来源:origin: NoEndToLF/ChinaMapView
private void initView() {
province_listview = (ListView) findViewById(R.id.province_listview);
mapview = (ChinaMapView) findViewById(R.id.view);
colorView = (ColorView) findViewById(R.id.colorView);
changeType = (Button) findViewById(R.id.changeType);
changeType.setFocusable(true);
changeType.setFocusableInTouchMode(true);
//changeType.setVisibility(View.GONE);
changeType.setText(ColorChangeUtil.nameStrings[0]);
}
/**
代码示例来源:origin: MasonLiuChn/GridViewPager
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
Holder holder = null;
if (null == convertView) {
holder = new Holder();
LayoutInflater mInflater = LayoutInflater.from(mContext);
convertView = mInflater.inflate(R.layout.gridview_item, null);
holder.btn_gv_item = (Button) convertView.findViewById(R.id.btn_gv_item);
holder.btn_gv_item.setFocusable(false);
convertView.setTag(holder);
} else {
holder = (Holder) convertView.getTag();
}
holder.btn_gv_item.setText(mLists.get(position));
return convertView;
}
代码示例来源:origin: openMF/mobile-wallet
@OnClick(R.id.btn_mobile)
public void onMobileSelected() {
mBtnMobile.setFocusable(true);
mBtnMobile.setFocusableInTouchMode(true);
mBtnMobile.setBackgroundResource(R.drawable.button_round_primary);
mBtnVpa.setBackgroundResource(R.drawable.button_round_stroke);
mBtnMobile.setTextColor(getResources().getColor(android.R.color.white));
mBtnVpa.setTextColor(getResources().getColor(android.R.color.black));
mTilVpa.setVisibility(View.GONE);
mRlMobile.setVisibility(View.VISIBLE);
}
代码示例来源:origin: GeoODK/collect
private void onException(String toastText) {
mHasExApp = false;
if ( !mPrompt.isReadOnly() ) {
mAnswer.setBackgroundDrawable(mTextBackground);
mAnswer.setFocusable(true);
mAnswer.setFocusableInTouchMode(true);
mAnswer.setClickable(true);
}
mLaunchIntentButton.setEnabled(false);
mLaunchIntentButton.setFocusable(false);
Collect.getInstance().getFormController().setIndexWaitingForData(null);
Toast.makeText(getContext(),
toastText, Toast.LENGTH_SHORT)
.show();
ExStringWidget.this.mAnswer.requestFocus();
}
});
代码示例来源:origin: wasdennnoch/AndroidN-ify
mAlarmStatusCollapsed.setTextSize(TypedValue.COMPLEX_UNIT_PX, dateTimeCollapsedSize);
mAlarmStatusCollapsed.setClickable(false);
mAlarmStatusCollapsed.setFocusable(false);
mAlarmStatusCollapsed.setVisibility(View.GONE);
mAlarmStatusCollapsed.setCompoundDrawablesWithIntrinsicBounds(alarmSmall, null, null, null);
内容来源于网络,如有侵权,请联系作者删除!