de.hdodenhof.circleimageview.CircleImageView Java Examples

The following examples show how to use de.hdodenhof.circleimageview.CircleImageView. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UserNewsActivity.java    From Social with Apache License 2.0 6 votes vote down vote up
private void initData(){
    listView = (NestedScrollView)this.findViewById(R.id.id_user_news_listview);
    list_newsItem = new ArrayList<>();
    listView.setOnItemClickListener(this);
    iv_head = (CircleImageView)this.findViewById(R.id.id_user_news_iv_head);


    Glide.with(this)
            .load(WebUtil.HTTP_ADDRESS +user_head_path)
            .into(iv_head);
    if(user_id.equals(SharedPreferenceUtil.getUserId())){
        listView.setOnItemLongClickListener(this);
    }

    iv_bg = (ImageView)this.findViewById(R.id.id_user_news_iv_bg);
    Glide.with(this).load(WebUtil.HTTP_ADDRESS + user_head_path)
            .transform(new BlurTransformation(this, 100))
            .crossFade()
            .into(iv_bg);
}
 
Example #2
Source File: ContactSelectionFragment.java    From Applozic-Android-SDK with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
    final View itemLayout =
            mInflater.inflate(R.layout.contact_select_list_item, parent, false);

    final ContactViewHolder holder = new ContactViewHolder();

    holder.textView1 = (TextView) itemLayout.findViewById(R.id.applozic_group_member_info);
    holder.textView2 = (TextView) itemLayout.findViewById(R.id.displayName);
    holder.contactNumberTextView = (TextView) itemLayout.findViewById(R.id.contactNumberTextView);
    holder.checkBox = (AppCompatCheckBox) itemLayout.findViewById(R.id.checkbox);
    holder.checkBox.setVisibility(View.VISIBLE);
    holder.alphabeticImage = (TextView) itemLayout.findViewById(R.id.alphabeticImage);
    holder.circleImageView = (CircleImageView) itemLayout.findViewById(R.id.contactImage);
    itemLayout.setTag(holder);
    return itemLayout;
}
 
Example #3
Source File: MyGroupItemArrayAdapter.java    From Social with Apache License 2.0 6 votes vote down vote up
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    MyGroupItem myGroupItem = list_MygroupItem.get(position);
    View view;
    ViewHolder viewHolder;
    if (convertView == null){
        view = LayoutInflater.from(getContext()).inflate(resid, parent, false);
        viewHolder = new ViewHolder();
        viewHolder.iv_group_img = (CircleImageView)view.findViewById(R.id.id_my_group_item_iv_group_img);
        viewHolder.tv_groupname = (TextView)view.findViewById(R.id.id_my_group_item_tv_groupname);
        viewHolder.tv_description = (TextView)view.findViewById(R.id.id_my_group_item_tv_description);
        viewHolder.tv_checked = (TextView)view.findViewById(R.id.id_my_group_item_tv_checked);
        view.setTag(viewHolder);
    }else{
        view = convertView;
        viewHolder = (ViewHolder)view.getTag();
    }

    Glide.with(context)
            .load(WebUtil.HTTP_ADDRESS + myGroupItem.getGroup_img())
            .into(viewHolder.iv_group_img);
    viewHolder.tv_groupname.setText(myGroupItem.getGroupname());
    viewHolder.tv_description.setText(myGroupItem.getDescription());
    if ((myGroupItem.getIs_my_group()==1)&& (myGroupItem.getState()==0)) viewHolder.tv_checked.setVisibility(View.VISIBLE);
    return view;
}
 
Example #4
Source File: SingleMakeupActivity.java    From FaceT with Mozilla Public License 2.0 6 votes vote down vote up
public MultipleColorHolder(View itemView) {
    super(itemView);
    mView = itemView;
    makeup_product_color_card = (CardView) itemView.findViewById(R.id.makeup_product_color_card);
    makeup_product_color_card.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
    select_color_layout = (LinearLayout) itemView.findViewById(R.id.select_color_layout);

    makeup_product_color_image[0] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image1);
    makeup_product_color_image[1] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image2);
    makeup_product_color_image[2] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image3);
    makeup_product_color_image[3] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image4);
    makeup_product_color_image[4] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image5);
    makeup_product_color_image[5] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image6);
    makeup_product_color_image[6] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image7);
    makeup_product_color_image[7] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image8);
}
 
Example #5
Source File: ChooseFriendItemBaseAdapter.java    From Social with Apache License 2.0 6 votes vote down vote up
@Override
public View getView(final int position, final View convertView, ViewGroup parent) {
    ChooseFriendItem chooseFriendItem = list_chooseFriendItem.get(position);
    View view;
    ViewHolder viewHolder;
    if (convertView==null){
        view = inflater.inflate(R.layout.choose_friend_item,parent,false);
        viewHolder = new ViewHolder();
        viewHolder.iv_head = (CircleImageView)view.findViewById(R.id.id_choose_friend_item_iv_head);
        viewHolder.tv_nickname = (TextView)view.findViewById(R.id.id_choose_friend_item_tv_nickname);
        view.setTag(viewHolder);
    }else{
        view = convertView;
        viewHolder = (ViewHolder)view.getTag();
    }

    //设置资源
    Glide.with(context).load(WebUtil.HTTP_ADDRESS + chooseFriendItem.getUser_head_path()).into(viewHolder.iv_head);
    viewHolder.tv_nickname.setText(chooseFriendItem.getNickname());


    return view;
}
 
Example #6
Source File: ContactFragment.java    From AvI with MIT License 6 votes vote down vote up
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    if(savedInstanceState != null){
        contact = new Gson().fromJson(savedInstanceState.getString("contact"), Contact.class);
    }
    setTitle(contact.getName());
    prepareFloatingActionButton();

    profileImage = (CircleImageView) view.findViewById(R.id.profile_image);
    profileName = (TextView) view.findViewById(R.id.profile_name);
    employment = (TextView) view.findViewById(R.id.txtEmployment);
    education = (TextView) view.findViewById(R.id.txtEducation);
    interests = (TextView) view.findViewById(R.id.txtInterests);
    knowledgeable = (TextView) view.findViewById(R.id.txtKnowledgeable);
    currentGoals = (TextView) view.findViewById(R.id.txtCurrentGoals);
    distance = (TextView) view.findViewById(R.id.txtDistance);

    prepareUI(contact);
}
 
Example #7
Source File: RowProfileView.java    From HeaderView with MIT License 6 votes vote down vote up
@SuppressLint("RtlHardcoded")
private void addViews() {
    LayoutParams avatarLayoutParams = new LayoutParams(hvAvatarRowDimen, hvAvatarRowDimen);
    LayoutParams checkLayoutParams = new LayoutParams(hvRowCheckDimen, hvRowCheckDimen);
    avatar = new CircleImageView(getContext());
    avatar.setBorderColor(accent);
    avatar.setBorderWidth(hvRowAvatarBorderDimen);
    check = new ImageView(getContext());
    check.setImageResource(R.drawable.hv_profile_check);
    check.setColorFilter(accent);
    username = new TextView(getContext());
    username.setTextColor(Utils.getTextColorPrimary(getContext()));
    username.setGravity(Gravity.CENTER_VERTICAL | (hvIsRTL ? Gravity.RIGHT : Gravity.LEFT));
    username.setMaxLines(1);
    username.setEllipsize(TextUtils.TruncateAt.END);
    email = new TextView(getContext());
    email.setTextColor(Utils.getTextColorSecondary(getContext()));
    email.setGravity(Gravity.CENTER_VERTICAL | (hvIsRTL ? Gravity.RIGHT : Gravity.LEFT));
    email.setMaxLines(1);
    email.setEllipsize(TextUtils.TruncateAt.END);
    addView(avatar, avatarLayoutParams);
    addView(check, checkLayoutParams);
    addView(username);
    addView(email);
}
 
Example #8
Source File: AccountNavAdapter.java    From evercam-android with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    View view = convertView;

    final AppUser appUser = mAppUsers.get(position);

    if (view == null) {
        LayoutInflater layoutInflater = (LayoutInflater) mContext.getSystemService(Context
                .LAYOUT_INFLATER_SERVICE);
        view = layoutInflater.inflate(mLayoutId, null);
    }

    if (appUser != null) {
        TextView emailTextView = (TextView) view.findViewById(R.id.drawer_account_user_textView);
        CircleImageView profileImageView = (CircleImageView) view.findViewById(R.id.drawer_account_user_image_view);
        final String email = appUser.getEmail();
        String gravatarUrl = Commons.getGravatarUrl(email);
        emailTextView.setText(email);
        Picasso.get().load(gravatarUrl).noFade().placeholder(R.drawable.ic_profile_grey).into(profileImageView);
    }

    return view;
}
 
Example #9
Source File: BlogAdapter.java    From Cotable with Apache License 2.0 6 votes vote down vote up
private void setAuthorAvatar(String blogapp, final CircleImageView imageView) {
//        BlogApi.getAuthorAvatar(blogapp, new JsonHttpResponseHandler() {
//            @Override
//            public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
//                try {
//                    JSONObject info = (JSONObject) response.get("data");
//                    String avatar = info.getString("avatar");
//                    if (avatar != null && !avatar.equals(""))
//                        ImageLoader.getInstance().displayImage(avatar, imageView);
//
//                } catch (JSONException e) {
//                    e.printStackTrace();
//                }
//            }
//
//            @Override
//            public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {
//                super.onFailure(statusCode, headers, throwable, errorResponse);
//            }
//        });
//

    }
 
Example #10
Source File: HomeAdapter.java    From CrazyDaily with Apache License 2.0 6 votes vote down vote up
private void renderGaoxiao(BaseViewHolder holder, GaoxiaoItemEntity item) {
    CircleImageView avatar = holder.getView(R.id.item_neihan_avatar);
    ImageLoader.load(mContext, item.getAvatar(), R.mipmap.ic_huaji, avatar);
    holder.setText(R.id.item_neihan_name, item.getName());
    holder.setText(R.id.item_neihan_title, item.getTitle());
    ViewGroup wrapView = (ViewGroup) holder.itemView;
    NiceVideoPlayer videoPlayer = (NiceVideoPlayer) wrapView.getChildAt(wrapView.getChildCount() - 1);
    NeihanVideoPlayerController controller = new NeihanVideoPlayerController(mContext);
    controller.setDownloadCallback(url -> {
        if (mDownloadCallback != null) {
            mDownloadCallback.onDownload(url);
        }
    });
    controller.setTitle("");
    controller.setLenght(item.getDuration());
    videoPlayer.setUp(item.getVideoUrl(), null);
    videoPlayer.setController(controller);
    ImageLoader.load(mContext, item.getThumbnail(), R.drawable.img_default, controller.imageView());
}
 
Example #11
Source File: NewsListAdapter.java    From ForPDA with GNU General Public License v3.0 6 votes vote down vote up
CompatHolder(View itemView) {
    super(itemView);
    clickContainer = (LinearLayout) itemView.findViewById(R.id.news_list_item_click_container);
    title = (TextView) itemView.findViewById(R.id.news_list_item_title);
    description = (TextView) itemView.findViewById(R.id.news_list_item_description);
    cover = (ImageView) itemView.findViewById(R.id.news_list_item_cover);
    avatar = (CircleImageView) itemView.findViewById(R.id.news_list_item_user_avatar);
    username = (TextView) itemView.findViewById(R.id.news_list_item_username);
    date = (TextView) itemView.findViewById(R.id.news_list_item_date);
    save = (ImageButton) itemView.findViewById(R.id.news_list_item_save);
    share = (ImageButton) itemView.findViewById(R.id.news_list_item_share);
    clickContainer.setOnClickListener(v -> {
        ViewCompat.setTransitionName(cover, String.valueOf(getLayoutPosition()) + "_image");
        mItemClickListener.onItemClick(cover, getItem(getLayoutPosition()), getLayoutPosition());
    });
}
 
Example #12
Source File: MainActivity.java    From FlowGeek with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    ButterKnife.bind(this);

    View mNavHeaderView = mDrawerNavView.getHeaderView(0);
    ivPortrait = (CircleImageView) mNavHeaderView.findViewById(R.id.iv_portrait);
    tvNick = (TextView) mNavHeaderView.findViewById(R.id.tv_nick);
    tvScore = (TextView) mNavHeaderView.findViewById(R.id.tv_score);
    ivExit = (ImageView) mNavHeaderView.findViewById(R.id.iv_exit);

    initView();
    initLogin();
    initSubscribers();
}
 
Example #13
Source File: LoadCircleImageActivity.java    From AndroidAnimationExercise with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mContext = this;
    setContentView(R.layout.activity_load_circle_image);
    final CircleImageView userAvatar = (CircleImageView) findViewById(R.id.userAvatar);
    final ImageView userAvatar1 = (ImageView) findViewById(R.id.userAvatar1);
    final ImageView gif = findViewById(R.id.gif);
    final ImageView gif_gen = findViewById(R.id.gif_gen);


    findViewById(R.id.load).setOnClickListener(v -> {
        Glide.with(LoadCircleImageActivity.this).load(PIC_URL).into(userAvatar1);
        Glide.with(LoadCircleImageActivity.this).load(PIC_URL).into(userAvatar);


        simpleDarkWorld();
        hackDarkWorld();
    });


}
 
Example #14
Source File: MessageFragment.java    From foodie-app with Apache License 2.0 6 votes vote down vote up
public ViewHolder(View view, int viewType, MyItemClickListener listener) {
    super(view);
    mView = view;
    mViewType=viewType;
    if(viewType==IS_HEADER){
        userAvatorView = (RoundedImageView) view.findViewById(R.id.user_image);
        userNameView = (TextView) view.findViewById(R.id.user_name_text);
        return;
    }
    mAvator= (CircleImageView) view.findViewById(R.id.avatar);
    mNicknameView= (TextView) view.findViewById(R.id.tv_nickname);
    mPostTimeView= (TextView) view.findViewById(R.id.tv_post_time);
    mWorksImageView= (ImageView) view.findViewById(R.id.iv_works_image);
    mIntroductionView= (TextView) view.findViewById(R.id.tv_introduction);
    mFollowView = (TextView) view.findViewById(R.id.follow_tv);
    mFollowView.setOnClickListener(this);
    mOnClickListener = listener;
    //init();
}
 
Example #15
Source File: QuickConversationAdapter.java    From Applozic-Android-SDK with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public Myholder(View itemView) {
    super(itemView);
    smReceivers = (TextView) itemView.findViewById(R.id.smReceivers);
    createdAtTime = (TextView) itemView.findViewById(R.id.createdAtTime);
    messageTextView = (TextView) itemView.findViewById(R.id.message);
    //ImageView contactImage = (ImageView) customView.findViewById(R.id.contactImage);
    contactImage = (CircleImageView) itemView.findViewById(R.id.contactImage);
    alphabeticTextView = (TextView) itemView.findViewById(R.id.alphabeticImage);
    onlineTextView = (TextView) itemView.findViewById(R.id.onlineTextView);
    sentOrReceived = (ImageView) itemView.findViewById(R.id.sentOrReceivedIcon);
    attachedFile = (TextView) itemView.findViewById(R.id.attached_file);
    attachmentIcon = (ImageView) itemView.findViewById(R.id.attachmentIcon);
    unReadCountTextView = (TextView) itemView.findViewById(R.id.unreadSmsCount);
    smTime = (TextView) itemView.findViewById(R.id.smTime);
    itemView.setOnClickListener(this);
    itemView.setOnCreateContextMenuListener(this);
}
 
Example #16
Source File: MultipleColorHolder.java    From FaceT with Mozilla Public License 2.0 6 votes vote down vote up
public MultipleColorHolder(View itemView) {
    super(itemView);

    product_color_image[0] = (CircleImageView) itemView.findViewById(R.id.product_color_image1);
    product_color_image[1] = (CircleImageView) itemView.findViewById(R.id.product_color_image2);
    product_color_image[2] = (CircleImageView) itemView.findViewById(R.id.product_color_image3);
    product_color_image[3] = (CircleImageView) itemView.findViewById(R.id.product_color_image4);
    product_color_image[4] = (CircleImageView) itemView.findViewById(R.id.product_color_image5);
    product_color_image[5] = (CircleImageView) itemView.findViewById(R.id.product_color_image6);
    product_color_image[6] = (CircleImageView) itemView.findViewById(R.id.product_color_image7);
    product_color_image[7] = (CircleImageView) itemView.findViewById(R.id.product_color_image8);

    itemView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            int position = getAdapterPosition();

            Snackbar.make(v, "Click detected on item " + position,
                    Snackbar.LENGTH_LONG)
                    .setAction("Action", null).show();
        }
    });
}
 
Example #17
Source File: AppContactFragment.java    From Applozic-Android-SDK with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
    final View itemLayout =
            mInflater.inflate(R.layout.contact_list_item, parent, false);

    final ViewHolder holder = new ViewHolder();
    holder.text1 = (TextView) itemLayout.findViewById(R.id.text1);
    holder.text2 = (TextView) itemLayout.findViewById(R.id.text2);
    holder.contactNumberTextView = (TextView) itemLayout.findViewById(R.id.contactNumberTextView);
    holder.icon = (CircleImageView) itemLayout.findViewById(R.id.contactImage);
    holder.contactIcon = (TextView) itemLayout.findViewById(R.id.contactIcon);
    holder.invite = itemLayout.findViewById(R.id.invite);
    holder.unBlock = itemLayout.findViewById(R.id.unblock);
    itemLayout.setTag(holder);
    return itemLayout;
}
 
Example #18
Source File: MakeupProductFragment.java    From FaceT with Mozilla Public License 2.0 6 votes vote down vote up
public void setProduct_color_image(ArrayList<String> colorList) {
    product_color_image[0] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image1);
    product_color_image[1] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image2);
    product_color_image[2] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image3);
    product_color_image[3] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image4);
    product_color_image[4] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image5);
    product_color_image[5] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image6);
    product_color_image[6] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image7);
    product_color_image[7] = (CircleImageView) itemView.findViewById(R.id.makeup_product_color_image8);

    Log.d(TAG + " data ", colorList.toString());
    for (int i = 0; i < colorList.size(); i++) {
        if (colorList.get(i) != null) {
            Log.d(TAG + " onBindViewHolder", colorList.get(i).toString());
            product_color_image[i].setColorFilter(Color.parseColor(colorList.get(i)));
            product_color_image[i].setVisibility(View.VISIBLE);
        }
    }
}
 
Example #19
Source File: SearchAdapter.java    From ForPDA with GNU General Public License v3.0 5 votes vote down vote up
FullHolder(View itemView) {
    super(itemView);
    username = (TextView) itemView.findViewById(R.id.news_full_item_username);
    category = (TextView) itemView.findViewById(R.id.news_full_item_category);
    title = (TextView) itemView.findViewById(R.id.news_full_item_title);
    description = (TextView) itemView.findViewById(R.id.news_full_item_description);
    commentsCount = (TextView) itemView.findViewById(R.id.news_full_item_comments_count);
    date = (TextView) itemView.findViewById(R.id.news_full_item_date);
    nTitle = (TextView) itemView.findViewById(R.id.news_full_item_news_title);
    nContainer = (LinearLayout) itemView.findViewById(R.id.news_full_item_new_container);
    cover = (CircleImageView) itemView.findViewById(R.id.news_full_item_cover);
    root = (CardView) itemView.findViewById(R.id.news_full_item_root);
    itemView.setOnClickListener(this);
    itemView.setOnLongClickListener(this);
}
 
Example #20
Source File: SelectColorRecyclerAdapter.java    From FaceT with Mozilla Public License 2.0 5 votes vote down vote up
public SelectColorViewHolder(View itemView) {
    super(itemView);
    colorImage = (CircleImageView) itemView.findViewById(R.id.order_product_color_card);

    itemView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            int position = getAdapterPosition();

            Snackbar.make(v, "Click detected on item " + position,
                    Snackbar.LENGTH_LONG)
                    .setAction("Action", null).show();
        }
    });
}
 
Example #21
Source File: ChatPresenterImpl.java    From Saude-no-Mapa with MIT License 5 votes vote down vote up
public MessageViewHolder(View v) {
    super(v);
    messageTextView = (TextView) itemView.findViewById(R.id.messageTextView);
    ounMessageTextView = (TextView) itemView.findViewById(R.id.ounMessageTextView);
    messengerTextView = (TextView) itemView.findViewById(R.id.messengerTextView);
    timeTextView = (TextView) itemView.findViewById(R.id.timeTextView);
    ounTimeTextView = (TextView) itemView.findViewById(R.id.ounTimeTextView);
    messengerImageView = (CircleImageView) itemView.findViewById(R.id.messengerImageView);
    messageLayout = (LinearLayout) itemView.findViewById(R.id.message_layout);
    ounMessageLayout = (RelativeLayout) itemView.findViewById(R.id.oun_message_layout);
}
 
Example #22
Source File: WorksListAdapter.java    From foodie-app with Apache License 2.0 5 votes vote down vote up
ViewHolder(View view) {
    avatorView = (CircleImageView) view.findViewById(R.id.avatar);
    nicknameView= (TextView) view.findViewById(R.id.tv_nickname);
    postTimeView= (TextView) view.findViewById(R.id.tv_post_time);
    introductionView= (TextView) view.findViewById(R.id.tv_introduction);
    worksImageView= (ImageView) view.findViewById(R.id.iv_works_image);
}
 
Example #23
Source File: AlMessageProperties.java    From Applozic-Android-SDK with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * This method loads the channel's image into the ImageView
 *
 * @param imageView CircularImageView in which the image is to be loaded
 * @param textView  Although we do not display alphabeticImage for a group, but this is needed to handle the visibility for recycler view.
 * @param channel   Channel object whose image is to be loaded
 */
public void loadChannelImage(CircleImageView imageView, TextView textView, Channel channel) {
    textView.setVisibility(View.GONE);
    imageView.setVisibility(View.VISIBLE);

    if (channel.getImageUrl() != null) {
        loadImage(imageView, textView, channel.getImageUrl(), R.drawable.applozic_group_icon);
    } else {
        imageView.setImageResource(R.drawable.applozic_group_icon);
    }
}
 
Example #24
Source File: HeaderView.java    From HeaderView with MIT License 5 votes vote down vote up
private void addAvatar3() {
    LayoutParams layoutParams = new LayoutParams(hvAvatarMiniDimen, hvAvatarMiniDimen);
    avatar3 = new CircleImageView(getContext());
    avatar3.setVisibility(INVISIBLE);
    avatar3.setBackgroundResource(Utils.selectableItemBackgroundBorderless(getContext()));
    addView(avatar3, 8, layoutParams);
}
 
Example #25
Source File: MySettingView.java    From Mobike with Apache License 2.0 5 votes vote down vote up
private void initView() {
    View view = mInflater.inflate(R.layout.setting_view, this, true);
    mLeftTextView = (TextView) view.findViewById(R.id.tv_left);
    mRinghtTextView = (TextView) view.findViewById(R.id.tv_ringht);
    mRinghtImagView = (CircleImageView) findViewById(iv_ringht);
    mIndicatorImagView = (ImageView) findViewById(R.id.indicate);
    mDotImagView = (ImageView) findViewById(R.id.iv_dot);
}
 
Example #26
Source File: AvatarImageBehavior.java    From Android-skin-support with MIT License 5 votes vote down vote up
@Override
public boolean onDependentViewChanged(CoordinatorLayout parent, CircleImageView child, View dependency) {

    // 初始化属性
    shouldInitProperties(child, dependency);

    // 最大滑动距离: 起始位置-状态栏高度
    final int maxScrollDistance = (int) (mStartToolbarPosition - getStatusBarHeight());

    // 滑动的百分比
    float expandedPercentageFactor = dependency.getY() / maxScrollDistance;

    // Y轴距离
    float distanceYToSubtract = ((mStartYPosition - mFinalYPosition)
            * (1f - expandedPercentageFactor)) + (child.getHeight() / 2);

    // X轴距离
    float distanceXToSubtract = ((mStartXPosition - mFinalXPosition)
            * (1f - expandedPercentageFactor)) + (child.getWidth() / 2);

    // 高度减小
    float heightToSubtract = ((mStartHeight - mFinalHeight) * (1f - expandedPercentageFactor));

    // 图片位置
    child.setY(mStartYPosition - distanceYToSubtract);
    child.setX(mStartXPosition - distanceXToSubtract);

    // 图片大小
    CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) child.getLayoutParams();
    lp.width = (int) (mStartHeight - heightToSubtract);
    lp.height = (int) (mStartHeight - heightToSubtract);
    child.setLayoutParams(lp);

    return true;
}
 
Example #27
Source File: MessageInfoFragment.java    From Applozic-Android-SDK with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public MyViewHolder(View view) {
    super(view);
    displayName = (TextView) view.findViewById(R.id.displayName);
    alphabeticImage = (TextView) view.findViewById(R.id.alphabeticImage);
    circleImageView = (CircleImageView) view.findViewById(R.id.contactImage);
    adminTextView = (TextView) view.findViewById(R.id.adminTextView);
    lastSeenAtTextView = (TextView) view.findViewById(R.id.lastSeenAtTextView);
}
 
Example #28
Source File: SkinCompatCircleImageView.java    From Android-skin-support with MIT License 5 votes vote down vote up
public SkinCompatCircleImageView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    mImageHelper = new SkinCompatImageHelper(this);
    mImageHelper.loadFromAttributes(attrs, defStyle);

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView, defStyle, 0);
    mBorderColorResId = a.getResourceId(R.styleable.CircleImageView_civ_border_color, INVALID_ID);
    mFillColorResId = a.getResourceId(R.styleable.CircleImageView_civ_fill_color, INVALID_ID);
    a.recycle();
    applyBorderColorResource();
    applyFillColorResource();
}
 
Example #29
Source File: AvatarImageBehavior.java    From Android-skin-support with MIT License 5 votes vote down vote up
@Override
public boolean onDependentViewChanged(CoordinatorLayout parent, CircleImageView child, View dependency) {

    // 初始化属性
    shouldInitProperties(child, dependency);

    // 最大滑动距离: 起始位置-状态栏高度
    final int maxScrollDistance = (int) (mStartToolbarPosition - getStatusBarHeight());

    // 滑动的百分比
    float expandedPercentageFactor = dependency.getY() / maxScrollDistance;

    // Y轴距离
    float distanceYToSubtract = ((mStartYPosition - mFinalYPosition)
            * (1f - expandedPercentageFactor)) + (child.getHeight() / 2);

    // X轴距离
    float distanceXToSubtract = ((mStartXPosition - mFinalXPosition)
            * (1f - expandedPercentageFactor)) + (child.getWidth() / 2);

    // 高度减小
    float heightToSubtract = ((mStartHeight - mFinalHeight) * (1f - expandedPercentageFactor));

    // 图片位置
    child.setY(mStartYPosition - distanceYToSubtract);
    child.setX(mStartXPosition - distanceXToSubtract);

    // 图片大小
    CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) child.getLayoutParams();
    lp.width = (int) (mStartHeight - heightToSubtract);
    lp.height = (int) (mStartHeight - heightToSubtract);
    child.setLayoutParams(lp);

    return true;
}
 
Example #30
Source File: AvatarImageBehavior.java    From Android-skin-support with MIT License 5 votes vote down vote up
/**
 * 初始化动画值
 *
 * @param child      图片控件
 * @param dependency ToolBar
 */
private void shouldInitProperties(CircleImageView child, View dependency) {

    // 图片控件中心
    if (mStartYPosition == 0)
        mStartYPosition = (int) (child.getY() + (child.getHeight() / 2));

    // Toolbar中心
    if (mFinalYPosition == 0)
        mFinalYPosition = (dependency.getHeight() / 2);

    // 图片高度
    if (mStartHeight == 0)
        mStartHeight = child.getHeight();

    // Toolbar缩略图高度
    if (mFinalHeight == 0)
        mFinalHeight = mContext.getResources().getDimensionPixelOffset(R.dimen.image_final_width);

    // 图片控件水平中心
    if (mStartXPosition == 0)
        mStartXPosition = (int) (child.getX() + (child.getWidth() / 2));

    // 边缘+缩略图宽度的一半
    if (mFinalXPosition == 0)
        mFinalXPosition = mContext.getResources().getDimensionPixelOffset(R.dimen.abc_action_bar_content_inset_material) + (mFinalHeight / 2);

    // Toolbar的起始位置
    if (mStartToolbarPosition == 0)
        mStartToolbarPosition = dependency.getY() + (dependency.getHeight() / 2);
}