use of com.kickstarter.ui.adapters.ProfileAdapter 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);
}
Aggregations