当前位置: 首页>>代码示例>>Java>>正文


Java QuickContactBadge.setVisibility方法代码示例

本文整理汇总了Java中android.widget.QuickContactBadge.setVisibility方法的典型用法代码示例。如果您正苦于以下问题:Java QuickContactBadge.setVisibility方法的具体用法?Java QuickContactBadge.setVisibility怎么用?Java QuickContactBadge.setVisibility使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.QuickContactBadge的用法示例。


在下文中一共展示了QuickContactBadge.setVisibility方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addQuickContactActionBar

import android.widget.QuickContactBadge; //导入方法依赖的package包/类
private void addQuickContactActionBar(ActionBar actionBar) {

		Drawable avatarDrawable;
		sDefaultContactImage = ComposeMessageActivity.this.getResources()
				.getDrawable(R.drawable.ic_contact_picture);

		ViewGroup v = (ViewGroup) LayoutInflater.from(this).inflate(
				R.layout.test_actionbar, null);
		actionBar.setDisplayShowCustomEnabled(true);
		actionBar.setCustomView(v);

		mAvatar = (QuickContactBadge) v.findViewById(R.id.test_avatar);

		Contact contact = mConversation.getRecipients().get(0);
		avatarDrawable = contact.getAvatar(ComposeMessageActivity.this,
				sDefaultContactImage);

		if (contact.existsInDatabase()) {// 010
			mAvatar.assignContactUri(contact.getUri());
		} else {
			mAvatar.assignContactFromPhone(contact.getNumber(), true);
		}
		mAvatar.setImageDrawable(avatarDrawable);
		mAvatar.setVisibility(View.VISIBLE);
		// mAvatar.assignContactUri(contactUri)

		actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM
				| ActionBar.DISPLAY_SHOW_TITLE);

	}
 
开发者ID:CommonQ,项目名称:sms_DualCard,代码行数:31,代码来源:ComposeMessageActivity.java

示例2: onFinishInflate

import android.widget.QuickContactBadge; //导入方法依赖的package包/类
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mAvatarView = (QuickContactBadge) findViewById(R.id.avatar);

    if (isInEditMode()) {
        mAvatarView.setImageDrawable(sDefaultContactImage);
        mAvatarView.setVisibility(VISIBLE);
    }
}
 
开发者ID:ShadiNachat,项目名称:Chatting-App-,代码行数:11,代码来源:AvatarListItem.java

示例3: newView

import android.widget.QuickContactBadge; //导入方法依赖的package包/类
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
    View view = mInflater.inflate(R.layout.message_list_item, parent, false);

    MessageViewHolder holder = new MessageViewHolder();
    holder.date = (TextView) view.findViewById(R.id.date);
    holder.chip = view.findViewById(R.id.chip);


    if (mPreviewLines == 0 && mContactsPictureLoader == null) {
        view.findViewById(R.id.preview).setVisibility(View.GONE);
        holder.preview = (TextView) view.findViewById(R.id.sender_compact);
        holder.flagged = (CheckBox) view.findViewById(R.id.flagged_center_right);
        view.findViewById(R.id.flagged_bottom_right).setVisibility(View.GONE);



    } else {
        view.findViewById(R.id.sender_compact).setVisibility(View.GONE);
        holder.preview = (TextView) view.findViewById(R.id.preview);
        holder.flagged = (CheckBox) view.findViewById(R.id.flagged_bottom_right);
        view.findViewById(R.id.flagged_center_right).setVisibility(View.GONE);

    }

    QuickContactBadge contactBadge =
            (QuickContactBadge) view.findViewById(R.id.contact_badge);
    if (mContactsPictureLoader != null) {
        holder.contactBadge = contactBadge;
    } else {
        contactBadge.setVisibility(View.GONE);
    }

    if (mSenderAboveSubject) {
        holder.from = (TextView) view.findViewById(R.id.subject);
        mFontSizes.setViewTextSize(holder.from, mFontSizes.getMessageListSender());

    } else {
        holder.subject = (TextView) view.findViewById(R.id.subject);
        mFontSizes.setViewTextSize(holder.subject, mFontSizes.getMessageListSubject());

    }

    mFontSizes.setViewTextSize(holder.date, mFontSizes.getMessageListDate());


    // 1 preview line is needed even if it is set to 0, because subject is part of the same text view
    holder.preview.setLines(Math.max(mPreviewLines,1));
    mFontSizes.setViewTextSize(holder.preview, mFontSizes.getMessageListPreview());
    holder.threadCount = (TextView) view.findViewById(R.id.thread_count);
    mFontSizes.setViewTextSize(holder.threadCount, mFontSizes.getMessageListSubject()); // thread count is next to subject
    view.findViewById(R.id.selected_checkbox_wrapper).setVisibility((mCheckboxes) ? View.VISIBLE : View.GONE);

    holder.flagged.setVisibility(mStars ? View.VISIBLE : View.GONE);
    holder.flagged.setOnClickListener(holder);


    holder.selected = (CheckBox) view.findViewById(R.id.selected_checkbox);
    holder.selected.setOnClickListener(holder);


    view.setTag(holder);

    return view;
}
 
开发者ID:scoute-dich,项目名称:K9-MailClient,代码行数:66,代码来源:MessageListFragment.java

示例4: newView

import android.widget.QuickContactBadge; //导入方法依赖的package包/类
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
    View view = mInflater.inflate(R.layout.message_list_item, parent, false);
    view.setId(R.layout.message_list_item);

    MessageViewHolder holder = new MessageViewHolder();
    holder.date = (TextView) view.findViewById(R.id.date);
    holder.chip = view.findViewById(R.id.chip);


    if (mPreviewLines == 0 && mContactsPictureLoader == null) {
        view.findViewById(R.id.preview).setVisibility(View.GONE);
        holder.preview = (TextView) view.findViewById(R.id.sender_compact);
        holder.flagged = (CheckBox) view.findViewById(R.id.flagged_center_right);
        view.findViewById(R.id.flagged_bottom_right).setVisibility(View.GONE);



    } else {
        view.findViewById(R.id.sender_compact).setVisibility(View.GONE);
        holder.preview = (TextView) view.findViewById(R.id.preview);
        holder.flagged = (CheckBox) view.findViewById(R.id.flagged_bottom_right);
        view.findViewById(R.id.flagged_center_right).setVisibility(View.GONE);

    }

    QuickContactBadge contactBadge =
            (QuickContactBadge) view.findViewById(R.id.contact_badge);
    if (mContactsPictureLoader != null) {
        holder.contactBadge = contactBadge;
    } else {
        contactBadge.setVisibility(View.GONE);
    }

    if (mSenderAboveSubject) {
        holder.from = (TextView) view.findViewById(R.id.subject);
        mFontSizes.setViewTextSize(holder.from, mFontSizes.getMessageListSender());

    } else {
        holder.subject = (TextView) view.findViewById(R.id.subject);
        mFontSizes.setViewTextSize(holder.subject, mFontSizes.getMessageListSubject());

    }

    mFontSizes.setViewTextSize(holder.date, mFontSizes.getMessageListDate());


    // 1 preview line is needed even if it is set to 0, because subject is part of the same text view
    holder.preview.setLines(Math.max(mPreviewLines,1));
    mFontSizes.setViewTextSize(holder.preview, mFontSizes.getMessageListPreview());
    holder.threadCount = (TextView) view.findViewById(R.id.thread_count);
    mFontSizes.setViewTextSize(holder.threadCount, mFontSizes.getMessageListSubject()); // thread count is next to subject
    view.findViewById(R.id.selected_checkbox_wrapper).setVisibility((mCheckboxes) ? View.VISIBLE : View.GONE);

    holder.flagged.setVisibility(mStars ? View.VISIBLE : View.GONE);
    holder.flagged.setOnClickListener(holder);


    holder.selected = (CheckBox) view.findViewById(R.id.selected_checkbox);
    holder.selected.setOnClickListener(holder);


    view.setTag(holder);

    return view;
}
 
开发者ID:daxslab,项目名称:daxSmail,代码行数:67,代码来源:MessageListFragment.java


注:本文中的android.widget.QuickContactBadge.setVisibility方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。