本文整理汇总了Java中android.support.v7.widget.AppCompatTextView.setOnClickListener方法的典型用法代码示例。如果您正苦于以下问题:Java AppCompatTextView.setOnClickListener方法的具体用法?Java AppCompatTextView.setOnClickListener怎么用?Java AppCompatTextView.setOnClickListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.AppCompatTextView
的用法示例。
在下文中一共展示了AppCompatTextView.setOnClickListener方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HeaderViewHolder
import android.support.v7.widget.AppCompatTextView; //导入方法依赖的package包/类
public HeaderViewHolder(View itemView) {
super(itemView);
textViewCompany = (AppCompatTextView) itemView.findViewById(R.id.textViewCompany);
textViewNumber = (AppCompatTextView) itemView.findViewById(R.id.textViewPackageNumber);
textViewName = (AppCompatTextView) itemView.findViewById(R.id.textViewName);
textViewCompany.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (aPackage.getCompany() != null) {
Intent intent = new Intent(context, CompanyDetailActivity.class);
intent.putExtra(CompanyDetailActivity.COMPANY_ID, aPackage.getCompany());
context.startActivity(intent, ActivityOptions.makeSceneTransitionAnimation((PackageDetailsActivity)context).toBundle());
}
}
});
}
示例2: checkItemCount
import android.support.v7.widget.AppCompatTextView; //导入方法依赖的package包/类
private void checkItemCount() {
final int count = mAdapter.getItemCount();
if (count == 0) {
final View stubView = mStubNoItem.inflate();
final AppCompatTextView tvToBuy =
(AppCompatTextView) stubView.findViewById(R.id.tv_stub_to_buy);
tvToBuy.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getContext(), "你该购物啦!", Toast.LENGTH_SHORT).show();
}
});
mRecyclerView.setVisibility(View.GONE);
} else {
mRecyclerView.setVisibility(View.VISIBLE);
}
}
示例3: convert
import android.support.v7.widget.AppCompatTextView; //导入方法依赖的package包/类
@Override
protected void convert(final MultipleViewHolder holder, MultipleItemEntity entity) {
super.convert(holder, entity);
switch (holder.getItemViewType()) {
case AddressItemType.ITEM_ADDRESS:
final String name = entity.getField(MultipleFields.NAME);
final String phone = entity.getField(AddressItemFields.PHONE);
final String address = entity.getField(AddressItemFields.ADDRESS);
final boolean isDefault = entity.getField(MultipleFields.TAG);
final int id = entity.getField(MultipleFields.ID);
final AppCompatTextView nameText = holder.getView(R.id.tv_address_name);
final AppCompatTextView phoneText = holder.getView(R.id.tv_address_phone);
final AppCompatTextView addressText = holder.getView(R.id.tv_address_address);
final AppCompatTextView deleteTextView = holder.getView(R.id.tv_address_delete);
deleteTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//请求接口删除
// RestClient.builder()
// .url("address.php")
// .params("id", id)
// .success(new ISuccess() {
// @Override
// public void onSuccess(String response) {
remove(holder.getLayoutPosition());
// }
// })
// .build()
// .post();
}
});
nameText.setText(name);
phoneText.setText(phone);
addressText.setText(address);
break;
default:
break;
}
}
示例4: ViewHolder
import android.support.v7.widget.AppCompatTextView; //导入方法依赖的package包/类
public ViewHolder(View view) {
super(view);
emoticon = (AppCompatTextView) view.findViewById(R.id.emoticon_holder);
emoticon.setOnClickListener(this);
}