Search in sources :

Example 1 with IssueTimelineFragment

use of com.fastaccess.ui.modules.repos.issues.issue.details.timeline.IssueTimelineFragment in project FastHub by k0shk0sh.

the class IssuePagerActivity method onSetupIssue.

@Override
public void onSetupIssue(boolean isUpdate) {
    hideProgress();
    if (getPresenter().getIssue() == null) {
        return;
    }
    onUpdateMenu();
    Issue issueModel = getPresenter().getIssue();
    setTaskName(issueModel.getRepoId() + " - " + issueModel.getTitle());
    setTitle(String.format("#%s", issueModel.getNumber()));
    if (getSupportActionBar() != null) {
        getSupportActionBar().setSubtitle(issueModel.getRepoId());
    }
    updateViews(issueModel);
    if (isUpdate) {
        IssueTimelineFragment issueDetailsView = getIssueTimelineFragment();
        if (issueDetailsView != null && getPresenter().getIssue() != null) {
            issueDetailsView.onUpdateHeader();
        }
    } else {
        if (pager.getAdapter() == null) {
            Logger.e(getPresenter().commentId);
            pager.setAdapter(new FragmentsPagerAdapter(getSupportFragmentManager(), FragmentPagerAdapterModel.buildForIssues(this, getPresenter().commentId)));
        } else {
            onUpdateTimeline();
        }
    }
    if (!getPresenter().isLocked() || getPresenter().isOwner()) {
        pager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {

            @Override
            public void onPageSelected(int position) {
                super.onPageSelected(position);
                hideShowFab();
            }
        });
    }
    hideShowFab();
}
Also used : Issue(com.fastaccess.data.dao.model.Issue) FragmentsPagerAdapter(com.fastaccess.ui.adapter.FragmentsPagerAdapter) IssueTimelineFragment(com.fastaccess.ui.modules.repos.issues.issue.details.timeline.IssueTimelineFragment) ViewPager(android.support.v4.view.ViewPager)

Aggregations

ViewPager (android.support.v4.view.ViewPager)1 Issue (com.fastaccess.data.dao.model.Issue)1 FragmentsPagerAdapter (com.fastaccess.ui.adapter.FragmentsPagerAdapter)1 IssueTimelineFragment (com.fastaccess.ui.modules.repos.issues.issue.details.timeline.IssueTimelineFragment)1