本文整理匯總了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);
}