Search in sources :

Example 1 with ProjectAdapter

use of com.kickstarter.ui.adapters.ProjectAdapter in project android-oss by kickstarter.

the class ProjectActivity method onCreate.

@Override
protected void onCreate(@Nullable final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.project_layout);
    ButterKnife.bind(this);
    ((KSApplication) getApplication()).component().inject(this);
    final int bottomButtonVisibility = ViewUtils.isLandscape(this) ? View.GONE : View.VISIBLE;
    projectActionButtonsViewGroup.setVisibility(bottomButtonVisibility);
    adapter = new ProjectAdapter(viewModel);
    projectRecyclerView.setAdapter(adapter);
    projectRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    this.viewModel.outputs.projectAndUserCountry().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(pc -> this.renderProject(pc.first, pc.second));
    this.viewModel.outputs.startCampaignWebViewActivity().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::startCampaignWebViewActivity);
    this.viewModel.outputs.startCommentsActivity().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::startCommentsActivity);
    this.viewModel.outputs.startCreatorBioWebViewActivity().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::startCreatorBioWebViewActivity);
    this.viewModel.outputs.showShareSheet().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::startShareIntent);
    this.viewModel.outputs.startProjectUpdatesActivity().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::startProjectUpdatesActivity);
    this.viewModel.outputs.startVideoActivity().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::startVideoActivity);
    this.viewModel.outputs.startCheckoutActivity().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::startCheckoutActivity);
    this.viewModel.outputs.startManagePledgeActivity().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::startManagePledge);
    this.viewModel.outputs.startViewPledgeActivity().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::startViewPledgeActivity);
    this.viewModel.outputs.showStarredPrompt().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(__ -> this.showStarToast());
    this.viewModel.outputs.startLoginToutActivity().compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(__ -> this.startLoginToutActivity());
}
Also used : ProjectAdapter(com.kickstarter.ui.adapters.ProjectAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 ProjectAdapter (com.kickstarter.ui.adapters.ProjectAdapter)1