本文整理汇总了Java中android.widget.TextView.setClickable方法的典型用法代码示例。如果您正苦于以下问题:Java TextView.setClickable方法的具体用法?Java TextView.setClickable怎么用?Java TextView.setClickable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.TextView
的用法示例。
在下文中一共展示了TextView.setClickable方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findViews
import android.widget.TextView; //导入方法依赖的package包/类
private void findViews(View view) {
tvShopcartEdit = (TextView) view.findViewById(R.id.tv_shopcart_edit);
recyclerview = (RecyclerView) view.findViewById(R.id.recyclerview);
llCheckAll = (LinearLayout) view.findViewById(R.id.ll_check_all);
checkboxAll = (CheckBox) view.findViewById(R.id.checkbox_all);
tvShopcartTotal = (TextView) view.findViewById(R.id.tv_shopcart_total);
btnCheckOut = (Button) view.findViewById(R.id.btn_check_out);
llDelete = (LinearLayout) view.findViewById(R.id.ll_delete);
cbAll = (CheckBox) view.findViewById(R.id.cb_all);
btnDelete = (Button) view.findViewById(R.id.btn_delete);
btnCollection = (Button) view.findViewById(R.id.btn_collection);
ivEmpty = (ImageView) view.findViewById(R.id.iv_empty);
tvEmptyCartTobuy = (TextView) view.findViewById(R.id.tv_empty_cart_tobuy);
ll_empty_shopcart = (LinearLayout) view.findViewById(R.id.ll_empty_shopcart);
tvEmptyCartTobuy.setClickable(true);
}
示例2: findViews
import android.widget.TextView; //导入方法依赖的package包/类
/**
* Find the Views in the layout<br />
* <br />
* Auto-created on 2016-10-11 21:08:02 by Android Layout Finder
* (http://www.buzzingandroid.com/tools/android-layout-finder)
*/
private void findViews() {
ibShopcartBack = (ImageButton) findViewById(R.id.ib_shopcart_back);
tvShopcartEdit = (TextView) findViewById(R.id.tv_shopcart_edit);
recyclerview = (RecyclerView) findViewById(R.id.recyclerview);
checkboxAll = (CheckBox) findViewById(R.id.checkbox_all);
tvShopcartTotal = (TextView) findViewById(R.id.tv_shopcart_total);
btnCheckOut = (Button) findViewById(R.id.btn_check_out);
ll_check_all = (LinearLayout) findViewById(R.id.ll_check_all);
ll_delete = (LinearLayout) findViewById(R.id.ll_delete);
cb_all = (CheckBox) findViewById(R.id.cb_all);
btn_delete = (Button) findViewById(R.id.btn_delete);
btn_collection = (Button) findViewById(R.id.btn_collection);
ll_empty_shopcart = (LinearLayout) findViewById(R.id.ll_empty_shopcart);
tv_empty_cart_tobuy = (TextView) findViewById(R.id.tv_empty_cart_tobuy);
ibShopcartBack.setOnClickListener(this);
btnCheckOut.setOnClickListener(this);
tvShopcartEdit.setOnClickListener(this);
btn_delete.setOnClickListener(this);
tv_empty_cart_tobuy.setClickable(true);
tv_empty_cart_tobuy.setOnClickListener(this);
}
示例3: addChildWithWord
import android.widget.TextView; //导入方法依赖的package包/类
private void addChildWithWord(String word) {
TextView textView = new TextView(getContext());
LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
textView.setLayoutParams(lp);
textView.setPadding(25, 15, 25, 15);
textView.setTextSize(15);
textView.setTextColor(Color.WHITE);
textView.setText(word);
textView.setBackgroundColor(getRandomColor());
textView.setClickable(true);
textView.setOnClickListener(this);
addView(textView);
requestLayout();
}
示例4: onBindView
import android.widget.TextView; //导入方法依赖的package包/类
@Override
protected void onBindView(View view) {
super.onBindView(view);
TextView titleView = (TextView) view.findViewById(android.R.id.title);
titleView.setSingleLine(false);
if (mImitateWebLink) {
setSelectable(false);
titleView.setClickable(true);
titleView.setTextColor(titleView.getPaint().linkColor);
titleView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
HyperlinkPreference.this.onClick();
}
});
}
}
示例5: initData
import android.widget.TextView; //导入方法依赖的package包/类
private void initData(String[] mVals) {
for (int i = 0; i < mVals.length; i++) {
tv = (TextView) mInflater.inflate(
R.layout.search_label_tv, mFlowLayout, false);
tv.setTextColor(getResources().getColor(R.color.cardview_dark_background));
tv.setText(mVals[i]);
tv.setClickable(true);
tv.setFocusable(true);
mFlowLayout.addView(tv);
final String str = tv.getText().toString().trim();
tv.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
String string = etSearch.getText().toString().trim();
etSearch.setText(string + " " + str);
}
});
}
}
示例6: setView
import android.widget.TextView; //导入方法依赖的package包/类
private boolean setView(int id, String packageName) {
TextView donate = (TextView) findViewById(id);
PackageManager pm = getPackageManager();
try {
ApplicationInfo info = pm.getApplicationInfo(packageName, 0);
if (!info.enabled) {
return false;
}
CharSequence label = getLabel(pm, info);
donate.setContentDescription(label);
donate.setCompoundDrawablesWithIntrinsicBounds(null, cropDrawable(pm.getApplicationIcon(info)), null, null);
donate.setText(label);
donate.setClickable(true);
donate.setOnClickListener(this);
donate.setVisibility(View.VISIBLE);
return true;
} catch (PackageManager.NameNotFoundException e) {
UILog.d("cannot find package " + packageName, e);
return false;
}
}
示例7: getTextView
import android.widget.TextView; //导入方法依赖的package包/类
private TextView getTextView(String textToBeDisplayed, View.OnClickListener clickListener) {
TextView textView = new TextView(FormatChoiceActivity.this);
textView.setText(textToBeDisplayed);
textView.setTextColor(getResources().getColor(R.color.colorBlack));
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
lp.setMargins(0, 50, 0, 50);
textView.setLayoutParams(lp);
textView.setTextSize(18);
textView.setClickable(true);
textView.setGravity(Gravity.CENTER);
textView.setOnClickListener(clickListener);
return textView;
}
示例8: initListView
import android.widget.TextView; //导入方法依赖的package包/类
protected void initListView(){
Context context = contextWeak.get();
if(context == null) return;
ListView alertButtonListView = (ListView) contentContainer.findViewById(R.id.alertButtonListView);
if(cancel != null && style == Style.Alert){
View itemView = LayoutInflater.from(context).inflate(R.layout.item_actionsheetbutton, null);
TextView tvAlert = (TextView) itemView.findViewById(R.id.tvAlert);
tvAlert.setText(cancel);
tvAlert.setClickable(true);
tvAlert.setTypeface(Typeface.DEFAULT_BOLD);
tvAlert.setTextColor(context.getResources().getColor(R.color.textColor_alert_button_cancel));
tvAlert.setBackgroundResource(R.drawable.bg_alertbutton_bottom);
tvAlert.setOnClickListener(new OnTextClickListener(CANCELPOSITION));
alertButtonListView.addFooterView(itemView);
}
AlertViewAdapter adapter = new AlertViewAdapter(mDatas,mDestructive);
alertButtonListView.setAdapter(adapter);
alertButtonListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
if(onItemClickListener != null)onItemClickListener.onItemClick(AlertView.this,position);
dismiss();
}
});
}
示例9: init
import android.widget.TextView; //导入方法依赖的package包/类
private void init(Context context) {
tvEmpty = new TextView(context);
int tvEmptySize = getResources().getDimensionPixelSize(ResHelper.getResId(context, "dimen", "bbs_empty_view_txt_size"));
tvEmpty.setTextSize(TypedValue.COMPLEX_UNIT_PX, tvEmptySize);
int padding = ResHelper.dipToPx(context, 10);
tvEmpty.setPadding(padding, padding, padding, padding);
int tvEmptyColor = getResources().getColor(ResHelper.getColorRes(context, "bbs_empty_view_txt_color"));
tvEmpty.setTextColor(tvEmptyColor);
tvEmpty.setId(ResHelper.getIdRes(context, "tvEmpty"));
ivEmpty = new ImageView(context);
ivEmpty.setScaleType(ImageView.ScaleType.CENTER);
LayoutParams rlp = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
rlp.addRule(CENTER_IN_PARENT, TRUE);
addView(tvEmpty, rlp);
rlp = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
rlp.addRule(CENTER_HORIZONTAL, TRUE);
rlp.addRule(ABOVE, tvEmpty.getId());
addView(ivEmpty, rlp);
OnClickListener ocl = new OnClickListener() {
public void onClick(View view) {
tvEmpty.setClickable(false);
ivEmpty.setClickable(false);
if (onRefreshClickListener != null) {
onRefreshClickListener.onClick(view);
}
}
};
tvEmpty.setClickable(false);
ivEmpty.setClickable(false);
tvEmpty.setOnClickListener(ocl);
ivEmpty.setOnClickListener(ocl);
}
示例10: selectPayType
import android.widget.TextView; //导入方法依赖的package包/类
private void selectPayType(View view) {
mTvWeixin.setBackgroundResource(R.color.bg_color);
mTvAlipay.setBackgroundResource(R.color.bg_color);
mTvWeixin.setTextColor(getResources().getColor(R.color.black));
mTvAlipay.setTextColor(getResources().getColor(R.color.black));
mTvWeixin.setClickable(true);
mTvAlipay.setClickable(true);
TextView tv = (TextView) view;
tv.setBackgroundResource(R.color.red);
tv.setClickable(false);
tv.setTextColor(getResources().getColor(R.color.white));
currentpaytype = Integer.valueOf((String) tv.getTag());
}
示例11: initListView
import android.widget.TextView; //导入方法依赖的package包/类
protected void initListView(){
Context context = contextWeak.get();
if(context == null) return;
ListView alertButtonListView = (ListView) contentContainer.findViewById(R.id.alertButtonListView);
//把cancel作为footerView
if(cancel != null && style == Style.Alert){
View itemView = LayoutInflater.from(context).inflate(R.layout.item_alertbutton, null);
TextView tvAlert = (TextView) itemView.findViewById(R.id.tvAlert);
tvAlert.setText(cancel);
tvAlert.setClickable(true);
tvAlert.setTypeface(Typeface.DEFAULT_BOLD);
tvAlert.setTextColor(context.getResources().getColor(R.color.textColor_alert_button_cancel));
tvAlert.setBackgroundResource(R.drawable.bg_alertbutton_bottom);
tvAlert.setOnClickListener(new OnTextClickListener(CANCELPOSITION));
alertButtonListView.addFooterView(itemView);
}
AlertViewAdapter adapter = new AlertViewAdapter(mDatas,mDestructive);
alertButtonListView.setAdapter(adapter);
alertButtonListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
if(onItemClickListener != null)onItemClickListener.onItemClick(AlertView.this,position);
dismiss();
}
});
}
示例12: onFinishInflate
import android.widget.TextView; //导入方法依赖的package包/类
@Override
protected void onFinishInflate() {
final int childCount = getChildCount();
if (childCount > 2) {
throw new IllegalStateException("PtrFrameLayout can only contains 2 children");
} else if (childCount == 2) {
if (mHeaderId != 0 && mHeaderView == null) {
mHeaderView = findViewById(mHeaderId);
}
if (mContainerId != 0 && mContent == null) {
mContent = findViewById(mContainerId);
}
// not specify header or content
if (mContent == null || mHeaderView == null) {
View child1 = getChildAt(0);
View child2 = getChildAt(1);
if (child1 instanceof PtrUIHandler) {
mHeaderView = child1;
mContent = child2;
} else if (child2 instanceof PtrUIHandler) {
mHeaderView = child2;
mContent = child1;
} else {
// both are not specified
if (mContent == null && mHeaderView == null) {
mHeaderView = child1;
mContent = child2;
}
// only one is specified
else {
if (mHeaderView == null) {
mHeaderView = mContent == child1 ? child2 : child1;
} else {
mContent = mHeaderView == child1 ? child2 : child1;
}
}
}
}
} else if (childCount == 1) {
mContent = getChildAt(0);
} else {
TextView errorView = new TextView(getContext());
errorView.setClickable(true);
errorView.setTextColor(0xffff6600);
errorView.setGravity(Gravity.CENTER);
errorView.setTextSize(20);
errorView.setText("The content view in PtrFrameLayout is empty. Do you forget to specify its id in xml layout file?");
mContent = errorView;
addView(mContent);
}
if (mHeaderView != null) {
mHeaderView.bringToFront();
}
super.onFinishInflate();
}
示例13: addNought
import android.widget.TextView; //导入方法依赖的package包/类
@Override
public void addNought(BoardCoordinate xy) {
TextView textView = imageButtons[xy.getX()][xy.getY()];
textView.setText("O");
textView.setClickable(false);
}
示例14: addCross
import android.widget.TextView; //导入方法依赖的package包/类
@Override
public void addCross(BoardCoordinate xy) {
TextView textView = imageButtons[xy.getX()][xy.getY()];
textView.setText("x");
textView.setClickable(false);
}