本文整理汇总了Java中android.widget.RelativeLayout.setOnClickListener方法的典型用法代码示例。如果您正苦于以下问题:Java RelativeLayout.setOnClickListener方法的具体用法?Java RelativeLayout.setOnClickListener怎么用?Java RelativeLayout.setOnClickListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.RelativeLayout
的用法示例。
在下文中一共展示了RelativeLayout.setOnClickListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ViewHolder
import android.widget.RelativeLayout; //导入方法依赖的package包/类
public ViewHolder(final View itemView) {
super(itemView);
tv_invoice_code = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_invoice_code);
tv_type = (AppCompatTextView) itemView.findViewById(R.id.tv_type);
tv_invoice_amount = (AppCompatTextView) itemView.findViewById(R.id.tv_invoice_amount);
tv_createDate = (AppCompatTextView) itemView.findViewById(R.id.tv_createDate);
tv_confirmDate = (AppCompatTextView) itemView.findViewById(R.id.tv_confirmDate);
tv_saleOrder = (AppCompatTextView) itemView.findViewById(R.id.tv_saleOrder);
tv_orderCode = (AppCompatTextView) itemView.findViewById(R.id.tv_orderCode);
tv_invoice_status = (AppCompatTextView) itemView.findViewById(R.id.tv_invoice_status);
tv_accountName = (AppCompatTextView) itemView.findViewById(R.id.tv_accountName);
tv_draweerName = (AppCompatTextView) itemView.findViewById(R.id.tv_draweerName);
rl_content = (RelativeLayout) itemView.findViewById(R.id.rl_content);
rl_content.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
T_InvoiceInformationEntity.RowsEntity rowsEntity = list.get(getLayoutPosition());
T_InvoiceInformationProductsActivity_.intent(getActivity()).extra("rowsEntity", rowsEntity).start();
}
});
}
示例2: ViewHolder
import android.widget.RelativeLayout; //导入方法依赖的package包/类
public ViewHolder(View itemView, Context c) {
super(itemView);
rlContactRow = (RelativeLayout) itemView.findViewById(R.id.rlContactRow);
ivContactImage = (ImageView) itemView.findViewById(R.id.ivContactImage);
tvContactName = (TextView) itemView.findViewById(R.id.tvContactName);
tvAffiliation = (TextView) itemView.findViewById(R.id.tvAffiliation);
rlContactRow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(!StringUtils.isNullOrEmpty(member.getAffiliation().val()) && StringUtils.safeEquals(member.getAffiliation().val(), ChatRoom.Affiliation.ADMIN.val()) ||
StringUtils.safeEquals(member.getAffiliation().val(), ChatRoom.Affiliation.OWNER.val())){
ChatRoom.ChatRoomMember m = memberList.get(getAdapterPosition());
if(!StringUtils.safeEquals(member.getUserJID().getBareJID(), m.getUserJID().getBareJID())){
showRemoveParticipantAlert(member.getUserJID(), getAdapterPosition());
}
}
}
});
}
示例3: ViewHolder
import android.widget.RelativeLayout; //导入方法依赖的package包/类
public ViewHolder(final View itemView) {
super(itemView);
tv_warning_export_invoice_number = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_warning_export_invoice_number);
tv_warning_foreign_businessman = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_warning_foreign_businessman);
tv_warning_invoice_unit = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_invoice_unit);
tv_warning_amount = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_amount);
tv_warning_invoice_date = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_invoice_date);
tv_warning_declare_date = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_declare_date);
tv_warning_approve_expiration_date = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_approve_expiration_date);
tv_warning_order_serial_number = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_order_serial_number);
tv_warning_po_number = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_po_number);
tv_warning_create_date = (AppCompatTextView) itemView.findViewById(R.id.tv_warning_create_date);
rl_content = (RelativeLayout) itemView.findViewById(R.id.rl_content);
rl_content.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
}
示例4: initBirthView
import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void initBirthView() {
RelativeLayout birthLayout = (RelativeLayout) findViewById(R.id.rl_edit_user_info_detail_birth);
birth = (TextView) findViewById(R.id.tv_edit_user_info_detail_birth);
birthLayout.setOnClickListener(this);
if (content != null) {
birth.setText(content);
Date date = TimeUtil.getDateFormalFromString(content);
if (date != null) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
currentDay = calendar.get(Calendar.DATE);
currentMonth = calendar.get(Calendar.MONTH);
currentYear = calendar.get(Calendar.YEAR);
}
}
}
示例5: ViewHolder
import android.widget.RelativeLayout; //导入方法依赖的package包/类
public ViewHolder(final View itemView) {
super(itemView);
tv_relatedCompanyName = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_relatedCompanyName);
tv_fundName = (AppCompatTextView) itemView.findViewById(R.id.tv_fundName);
tv_amountRmb = (AppCompatTextView) itemView.findViewById(R.id.tv_amountRmb);
tv_createDate = (AppCompatTextView) itemView.findViewById(R.id.tv_createDate);
rl_content = (RelativeLayout) itemView.findViewById(R.id.rl_content);
rl_content.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
T_AccountFundDetailsEntity.RowsEntity rowsEntity = list.get(getLayoutPosition());
T_AccountFundDetailsActivity_.intent(getActivity()).extra("rowsEntity", rowsEntity).start();
}
});
}
示例6: init
import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void init() {
rlr_locate = (RelativeLayout) findViewById(R.id.rlr_locate);
rlr_locate.setOnClickListener(this);
rlt_sign = (RelativeLayout) findViewById(R.id.rlt_sign);
rlt_sign.setOnClickListener(this);
rlt_use = (RelativeLayout) findViewById(R.id.rlt_use);
rlt_use.setOnClickListener(this);
ins = this;
}
示例7: initView
import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
public void initView() {
headerLayout = (RelativeLayout) findViewById(R.id.rl_group_info_header);
groupAvatar = (RoundAngleImageView) findViewById(R.id.riv_group_info_avatar);
groupName = (TextView) findViewById(R.id.tv_group_info_name);
createTime = (TextView) findViewById(R.id.tv_group_info_create_time);
numberName = (LinearLayout) findViewById(R.id.ll_group_info_number_name);
numberCount = (LinearLayout) findViewById(R.id.ll_group_info_number_count);
numberAvatar = (RecyclerView) findViewById(R.id.rcv_group_info_number_avatar);
groupNameLayout = (LinearLayout) findViewById(R.id.ll_group_info_group_name);
groupDescription = (LinearLayout) findViewById(R.id.ll_group_info_group_description);
groupNotification = (LinearLayout) findViewById(R.id.ll_group_info_group_notification);
groupRemind = (LinearLayout) findViewById(R.id.ll_group_info_remind);
exit = (Button) findViewById(R.id.btn_group_info_exit_group);
((TextView) numberName.findViewById(R.id.tv_group_info_item_layout_title)).setText("群名片");
numberNick = (TextView) numberName.findViewById(R.id.tv_group_info_item_layout_value);
((TextView) numberCount.findViewById(R.id.tv_group_info_item_layout_title)).setText("群总人数");
((TextView) groupNameLayout.findViewById(R.id.tv_group_info_item_layout_title)).setText("群名");
((TextView) groupDescription.findViewById(R.id.tv_group_info_item_layout_title)).setText("群介绍");
((TextView) groupNotification.findViewById(R.id.tv_group_info_item_layout_title)).setText("群通知");
((TextView) groupRemind.findViewById(R.id.tv_group_info_item_layout_title)).setText("群消息提醒");
groupNumberCount = (TextView) numberCount.findViewById(R.id.tv_group_info_item_layout_value);
notification = (TextView) groupNotification.findViewById(R.id.tv_group_info_item_layout_value);
description = (TextView) groupDescription.findViewById(R.id.tv_group_info_item_layout_value);
remind = (TextView) groupRemind.findViewById(R.id.tv_group_info_item_layout_value);
groupName1 = (TextView) groupNameLayout.findViewById(R.id.tv_group_info_item_layout_value);
headerLayout.setOnClickListener(this);
numberName.setOnClickListener(this);
numberCount.setOnClickListener(this);
// numberAvatar.setOnItemClickListener(this);
groupNameLayout.setOnClickListener(this);
groupNotification.setOnClickListener(this);
groupDescription.setOnClickListener(this);
groupRemind.setOnClickListener(this);
exit.setOnClickListener(this);
}
示例8: addColorButton
import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void addColorButton(){
for(int i=0;i<12;i++){
FloatingActionButton floatingActionButton = new FloatingActionButton(CanvasActivity.this);
floatingActionButton.setBackgroundTintList(ColorStateList.valueOf(Color.parseColor(colorArr[i])));
floatingActionButton.setCompatElevation(0);
floatingActionButton.setTag("button");
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(108,108);
params.setMargins(32,0,32,0);
final RelativeLayout relativeLayout = new RelativeLayout(CanvasActivity.this);
relativeLayout.addView(floatingActionButton, params);
relativeLayout.setOnClickListener(this);
if(i == 11){
relativeLayout.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
setDialog((FloatingActionButton) view.findViewWithTag("button"));
relativeLayout.callOnClick();
return true;
}
});
}
if(i > 5){
colorSelectLayout2.addView(relativeLayout, new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT));
}else{
colorSelectLayout1.addView(relativeLayout, new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT));
}
}
}
示例9: bindView
import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
public void bindView(View v) {
mShareCircleLayout = (RelativeLayout) v.findViewById(R.id.shareCircleLayout);
mShareFriendLayout = (RelativeLayout) v.findViewById(R.id.shareFriendLayout);
mCopyBoardLayout = (RelativeLayout) v.findViewById(R.id.copyLayout);
mShareCircleLayout.setOnClickListener(this);
mShareFriendLayout.setOnClickListener(this);
mCopyBoardLayout.setOnClickListener(this);
}
示例10: initViews
import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void initViews() {
messageTop = (SwitchButton) findViewById(R.id.sw_group_top);
messageNotification = (SwitchButton) findViewById(R.id.sw_group_notfaction);
messageTop.setOnCheckedChangeListener(this);
messageNotification.setOnCheckedChangeListener(this);
LinearLayout groupClean = (LinearLayout) findViewById(R.id.group_clean);
mGridView = (DemoGridView) findViewById(R.id.gridview);
mTextViewMemberSize = (TextView) findViewById(R.id.group_member_size);
mGroupHeader = (SelectableRoundedImageView) findViewById(R.id.group_header);
LinearLayout mGroupDisplayName = (LinearLayout) findViewById(R.id.group_displayname);
mGroupDisplayNameText = (TextView) findViewById(R.id.group_displayname_text);
mGroupName = (TextView) findViewById(R.id.group_name);
mQuitBtn = (Button) findViewById(R.id.group_quit);
mDismissBtn = (Button) findViewById(R.id.group_dismiss);
RelativeLayout totalGroupMember = (RelativeLayout) findViewById(R.id.group_member_size_item);
LinearLayout mGroupPortL = (LinearLayout) findViewById(R.id.ll_group_port);
LinearLayout mGroupNameL = (LinearLayout) findViewById(R.id.ll_group_name);
mGroupAnnouncementDividerLinearLayout = (LinearLayout) findViewById(R.id.ac_ll_group_announcement_divider);
mGroupNotice = (LinearLayout) findViewById(R.id.group_announcement);
mSearchMessagesLinearLayout = (LinearLayout) findViewById(R.id.ac_ll_search_chatting_records);
mGroupPortL.setOnClickListener(this);
mGroupNameL.setOnClickListener(this);
totalGroupMember.setOnClickListener(this);
mGroupDisplayName.setOnClickListener(this);
mQuitBtn.setOnClickListener(this);
mDismissBtn.setOnClickListener(this);
groupClean.setOnClickListener(this);
mGroupNotice.setOnClickListener(this);
mSearchMessagesLinearLayout.setOnClickListener(this);
}
示例11: onCreate
import android.widget.RelativeLayout; //导入方法依赖的package包/类
/**
*
* @param savedInstanceState
*
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.popup);
usernameText = (TextView) findViewById(R.id.username_text_popup);
moodText = (TextView) findViewById(R.id.mood_text_popup);
dateText = (TextView) findViewById(R.id.date_text_popup);
timeText = (TextView) findViewById(R.id.time_text_popup);
reasonText = (TextView) findViewById(R.id.description_text_popup);
popupBox = findViewById(R.id.popup_box);
popupIcon = (ImageView) findViewById(R.id.popup_icon);
popupMargin = (RelativeLayout) findViewById(R.id.popup);
photo = (ImageView) findViewById(R.id.user_image_popup);
social = (TextView) findViewById(R.id.socialDescription);
//OnClick for outside the popup to close that activity
popupMargin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
MoodPopupActivity.this.finish();
}
});
}
示例12: initView
import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void initView() {
TextView mPhone = (TextView) findViewById(R.id.tv_my_phone);
RelativeLayout portraitItem = (RelativeLayout) findViewById(R.id.rl_my_portrait);
RelativeLayout nameItem = (RelativeLayout) findViewById(R.id.rl_my_username);
mImageView = (SelectableRoundedImageView) findViewById(R.id.img_my_portrait);
mName = (TextView) findViewById(R.id.tv_my_username);
portraitItem.setOnClickListener(this);
nameItem.setOnClickListener(this);
String cacheName = sp.getString(SealConst.SEALTALK_LOGIN_NAME, "");
String cachePortrait = sp.getString(SealConst.SEALTALK_LOGING_PORTRAIT, "");
String cachePhone = sp.getString(SealConst.SEALTALK_LOGING_PHONE, "");
if (!TextUtils.isEmpty(cachePhone)) {
mPhone.setText("+86 " + cachePhone);
}
if (!TextUtils.isEmpty(cacheName)) {
mName.setText(cacheName);
String cacheId = sp.getString(SealConst.SEALTALK_LOGIN_ID, "a");
String portraitUri = SealUserInfoManager.getInstance().getPortraitUri(new UserInfo(
cacheId, cacheName, Uri.parse(cachePortrait)));
ImageLoader.getInstance().displayImage(portraitUri, mImageView, App.getOptions());
}
setPortraitChangeListener();
BroadcastManager.getInstance(mContext).addAction(SealConst.CHANGEINFO, new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
mName.setText(sp.getString(SealConst.SEALTALK_LOGIN_NAME, ""));
}
});
}
示例13: onCreate
import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tv_time = (TextView) findViewById(R.id.tv_time);
tv_date = (TextView) findViewById(R.id.tv_date);
tv_day = (TextView) findViewById(R.id.tv_day);
Typeface typeFace = Typeface.createFromAsset(getAssets(), "fonts/ds_digi.ttf");
tv_time.setTypeface(typeFace);
tv_date.setTypeface(typeFace);
tv_weather = (TextView) findViewById(R.id.tv_weather);
tv_descript = (TextView) findViewById(R.id.tv_descript);
handler = new Handler(this);
tv_setting = (TextView) findViewById(R.id.tv_setting);
tv_setting.setOnClickListener(this);
tv_time.setOnClickListener(this);
RelativeLayout rel_main = (RelativeLayout) findViewById(R.id.rel_main);
rel_main.setOnClickListener(this);
init();
PowerManager powerManager = (PowerManager) this.getSystemService(POWER_SERVICE);
wakeLock = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, "Clock");
localWakeLock = powerManager.newWakeLock(32, "MyPower");
ClockApplication.getInstance().setMainActivity(this);
ClockApplication.getInstance().getBusinessService().getWeather(model.getCity());
timer = new Timer();
TimerTask timerTask = new TimerTask() {
@Override
public void run() {
handler.sendEmptyMessage(UPDATE_TIME);
}
};
timer.schedule(timerTask, 1000, 1000);
ClockApplication.getInstance().getBusinessService().checkUpdate();
}
示例14: onCreateView
import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_employees, container, false);
RelativeLayout titleLayout = (RelativeLayout) view.findViewById(R.id.layoutFragmentTitle);
titleLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ActionSelectDialogBuilder builder = new ActionSelectDialogBuilder(getActivity());
builder.addNavigationEntry("Browse open applications", MainActivity.FRAGMENT_PROJECTS);
builder.addNavigationEntry("Browse employees", -1);
builder.getDialog().show();
}
});
mRecyclerView = (RecyclerView) view.findViewById(R.id.recyclerViewEmployees);
// Show all employee types here (both that company already has and the ones that it doesn't).
mRecyclerViewAdapter = new EmployeeRecyclerViewAdapter(EmployeeType.getAllTypes());
mRecyclerView.setHasFixedSize(true); // performance boost when content does not change the size of RecyclerView
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
mRecyclerView.setAdapter(mRecyclerViewAdapter);
return view;
}
示例15: initView
import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void initView(Context context) {
mContext = context;
LayoutInflater.from(context).inflate(R.layout.card_monitor_setting, this);
onlyTextRL = (RelativeLayout) findViewById(R.id.text_only_rl);
onlyTextSwitch = (SwitchCompat) findViewById(R.id.text_only_switch);
whiteList = (TextView) findViewById(R.id.white_list);
doubleClickIntervalRl = (RelativeLayout) findViewById(R.id.double_click_interval_rl);
mDoubleClick = (TextView) findViewById(R.id.double_click_setting);
doubleClickEditText = (EditText) findViewById(R.id.double_click_interval_edit);
doubleClickInputLayout = (TextInputLayout) findViewById(R.id.double_click_interval);
doubleClickConfirm = (Button) findViewById(R.id.double_click_confirm);
onlyTextSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton aSwitch, boolean isChecked) {
//这里由于文案从“只监控文本”改成了“增强型监控”,所以意思完全相反了,为了防止改动太多,就在这里做一个反置
onlyText = !isChecked;
UrlCountUtil.onEvent(UrlCountUtil.STATUS_ONLY_TEXT_MONITOR, !isChecked);
SPHelper.save(ConstantUtil.TEXT_ONLY, onlyText);
mContext.sendBroadcast(new Intent(BROADCAST_BIGBANG_MONITOR_SERVICE_MODIFIED));
}
});
onlyTextRL.setOnClickListener(myOnClickListerner);
whiteList.setOnClickListener(myOnClickListerner);
mDoubleClick.setOnClickListener(myOnClickListerner);
doubleClickConfirm.setOnClickListener(myOnClickListerner);
refresh();
}