Java Code Examples for com.facebook.drawee.view.SimpleDraweeView#setLayoutParams()

The following examples show how to use com.facebook.drawee.view.SimpleDraweeView#setLayoutParams() . 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: FastAttachAdapter.java    From actor-platform with GNU Affero General Public License v3.0 6 votes vote down vote up
public FastShareVH(View itemView) {
    super(itemView);
    itemView.setBackgroundColor(ActorSDK.sharedActor().style.getMainBackgroundColor());
    v = (SimpleDraweeView) itemView.findViewById(R.id.image);
    chb = (CheckBox) itemView.findViewById(R.id.check);
    int size = Screen.dp(80);
    v.setLayoutParams(new FrameLayout.LayoutParams(size, size));
    chb.setOnCheckedChangeListener((buttonView, isChecked) -> {
        if (isChecked && data != null) {
            selected.add(data);
            notifyVm();
        } else {
            selected.remove(data);
            notifyVm();

        }
    });
}
 
Example 2
Source File: MuliSizeImageAdapter.java    From imsdk-android with MIT License 5 votes vote down vote up
ImageViewHolder( View convertView) {
    image_item = (SimpleDraweeView)convertView.findViewById(R.id.image_item);
    cb_check = (CheckBox)convertView.findViewById(R.id.cb_check);
    video_duaration = (TextView) convertView.findViewById(R.id.video_duaration);
    videoView = convertView.findViewById(R.id.videoView);
    image_item.setLayoutParams(new FrameLayout.LayoutParams(w, w));
}
 
Example 3
Source File: ShareLocationActivity.java    From imsdk-android with MIT License 5 votes vote down vote up
private SimpleDraweeView createDraweeView() {
    SimpleDraweeView view = new SimpleDraweeView(this);
    RoundingParams params = RoundingParams.asCircle();
    view.setLayoutParams(new ViewGroup.LayoutParams(Utils.dpToPx(this, 48), Utils.dpToPx(this, 48)));
    GenericDraweeHierarchy hierarchy = GenericDraweeHierarchyBuilder.newInstance(getResources())
            .setPlaceholderImage(getResources().getDrawable(R.drawable.atom_ui_default_gravatar), ScalingUtils.ScaleType.CENTER_CROP)
            .setRoundingParams(params)
            .build();
    view.setHierarchy(hierarchy);
    return view;
}
 
Example 4
Source File: ContentsAdapter.java    From PicKing with Apache License 2.0 5 votes vote down vote up
private void setFresco(SimpleDraweeView simpleDraweeView, AlbumInfo albumInfo, int width, boolean isGif) {
    if (albumInfo.getWidth() != null && albumInfo.getHeight() != null) {
        if (isGif)
            simpleDraweeView.setImageURI(albumInfo.getPicUrl());
        else
            simpleDraweeView.setImageURI(albumInfo.getGifThumbUrl());
        ViewGroup.LayoutParams l = simpleDraweeView.getLayoutParams();
        l.width = albumInfo.getWidth();
        l.height = albumInfo.getHeight();
        simpleDraweeView.setLayoutParams(l);
    } else
        FrescoUtil.setControllerListener(simpleDraweeView, albumInfo, width, isGif);

}
 
Example 5
Source File: DateDetailActivity.java    From Fishing with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void setData(Date data) {
    getExpansion().dismissProgressPage();
    avatar.setImageURI(Uri.parse(data.getAuthorAvatar()));
    name.setText(data.getAuthorName());
    title.setText(data.getTitle());
    strTitle = data.getTitle();
    time.setText(new JTimeTransform(data.getTime()).toString(new JTimeTransform.RecentDateFormat()));
    dateTime.setText(new SimpleDateFormat("yyyy年MM月dd日").format(new java.util.Date(data.getAcTime())));
    content.setText(data.getContent());
    int uid = AccountModel.getInstance().getAccount().getUID();
    for (PersonBrief personBrief : data.getEnrollMember()) {
        if (personBrief.getUID() == uid) {
            joined = true;
            join.setText("进入");
        }
        SimpleDraweeView draweeView = new SimpleDraweeView(DateDetailActivity.this);
        draweeView.setLayoutParams(new ViewGroup.LayoutParams(JUtils.dip2px(40), JUtils.dip2px(40)));
        draweeView.setImageURI(Uri.parse(personBrief.getAvatar()));
        draweeView.getHierarchy().setRoundingParams(RoundingParams.asCircle());
        draweeView.setOnClickListener(v -> {
            Intent i = new Intent(DateDetailActivity.this, UserDetailActivity.class);
            i.putExtra("id", personBrief.getUID());
            startActivity(i);
        });
        joinMember.addView(draweeView);
    }
}
 
Example 6
Source File: PlaceDetailActivity.java    From Fishing with GNU General Public License v3.0 5 votes vote down vote up
@Override
public View getView(ViewGroup container, int position) {
    SimpleDraweeView simpleDraweeView = new SimpleDraweeView(container.getContext());
    simpleDraweeView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    simpleDraweeView.setImageURI(ImageModel.getInstance().getSizeImage(path.get(position), 640));
    return simpleDraweeView;
}
 
Example 7
Source File: NetImageAdapter.java    From Fishing with GNU General Public License v3.0 5 votes vote down vote up
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    SimpleDraweeView draweeView = new SimpleDraweeView(getContext());
    draweeView.getHierarchy().setPlaceholderImage(new ColorDrawable(Color.rgb(252,242,230)));
    draweeView.getHierarchy().setFadeDuration(300);
    draweeView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    draweeView.setImageURI(ImageModel.getInstance().getSmallImage(getItem(position)));
    draweeView.setTag(position);
    draweeView.setOnClickListener(this);
    return draweeView;
}