use of com.kickstarter.libs.transformations.CircleTransformation in project android-oss by kickstarter.
the class ActivitySampleFriendFollowViewHolder method onBind.
public void onBind() {
final Context context = context();
final User user = activity.user();
if (user != null) {
Picasso.with(context).load(user.avatar().small()).transform(new CircleTransformation()).into(activityImageView);
activityTitleTextView.setText(ksString.format(categoryFollowingString, "user_name", user.name()));
activitySubtitleTextView.setText(categoryFollowBackString);
// temp until followable :
activitySubtitleTextView.setVisibility(View.GONE);
}
}
use of com.kickstarter.libs.transformations.CircleTransformation in project android-oss by kickstarter.
the class ProfileActivity method onCreate.
@Override
protected void onCreate(@Nullable final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.profile_layout);
ButterKnife.bind(this);
adapter = new ProfileAdapter(viewModel);
final int spanCount = ViewUtils.isLandscape(this) ? 3 : 2;
recyclerView.setLayoutManager(new GridLayoutManager(this, spanCount));
recyclerView.setAdapter(adapter);
paginator = new RecyclerViewPaginator(recyclerView, viewModel.inputs::nextPage);
viewModel.outputs.avatarImageViewUrl().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(url -> Picasso.with(this).load(url).transform(new CircleTransformation()).into(avatarImageView));
viewModel.outputs.backedCountTextViewHidden().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(ViewUtils.setGone(this.backedCountTextView));
viewModel.outputs.backedCountTextViewText().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(this.backedCountTextView::setText);
viewModel.outputs.backedTextViewHidden().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(ViewUtils.setGone(this.backedTextView));
viewModel.outputs.createdCountTextViewHidden().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(ViewUtils.setGone(this.createdCountTextView));
viewModel.outputs.createdCountTextViewText().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(this.createdCountTextView::setText);
viewModel.outputs.createdTextViewHidden().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(ViewUtils.setGone(this.createdTextView));
viewModel.outputs.dividerViewHidden().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(ViewUtils.setGone(this.dividerView));
viewModel.outputs.projects().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::loadProjects);
viewModel.outputs.resumeDiscoveryActivity().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(__ -> resumeDiscoveryActivity());
viewModel.outputs.startProjectActivity().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::startProjectActivity);
viewModel.outputs.userNameTextViewText().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(this.userNameTextView::setText);
}
use of com.kickstarter.libs.transformations.CircleTransformation in project android-oss by kickstarter.
the class FriendFollowViewHolder method onBind.
@Override
public void onBind() {
final Context context = context();
final User friend = activity().user();
if (friend == null) {
return;
}
Picasso.with(context).load(friend.avatar().small()).transform(new CircleTransformation()).into(avatarImageView);
// TODO: bold username
titleTextView.setText(new StringBuilder(friend.name()).append(" ").append(isFollowingYouString));
}
Aggregations