Search in sources :

Example 1 with PullRequestTimelineFragment

use of com.fastaccess.ui.modules.repos.pull_requests.pull_request.details.timeline.timeline.PullRequestTimelineFragment in project FastHub by k0shk0sh.

the class PullRequestPagerActivity method onUpdateTimeline.

@Override
public void onUpdateTimeline() {
    supportInvalidateOptionsMenu();
    PullRequestTimelineFragment pullRequestDetailsView = getPullRequestTimelineFragment();
    if (pullRequestDetailsView != null && getPresenter().getPullRequest() != null) {
        pullRequestDetailsView.onRefresh();
    }
}
Also used : PullRequestTimelineFragment(com.fastaccess.ui.modules.repos.pull_requests.pull_request.details.timeline.timeline.PullRequestTimelineFragment)

Example 2 with PullRequestTimelineFragment

use of com.fastaccess.ui.modules.repos.pull_requests.pull_request.details.timeline.timeline.PullRequestTimelineFragment in project FastHub by k0shk0sh.

the class PullRequestPagerActivity method onSetupIssue.

@Override
public void onSetupIssue(boolean update) {
    hideProgress();
    if (getPresenter().getPullRequest() == null) {
        return;
    }
    invalidateOptionsMenu();
    PullRequest pullRequest = getPresenter().getPullRequest();
    setTaskName(pullRequest.getRepoId() + " - " + pullRequest.getTitle());
    updateViews(pullRequest);
    if (update) {
        PullRequestTimelineFragment issueDetailsView = getPullRequestTimelineFragment();
        if (issueDetailsView != null && getPresenter().getPullRequest() != null) {
            issueDetailsView.onUpdateHeader();
        }
    } else {
        if (pager.getAdapter() == null) {
            pager.setAdapter(new FragmentsPagerAdapter(getSupportFragmentManager(), FragmentPagerAdapterModel.buildForPullRequest(this, pullRequest)));
            tabs.setupWithViewPager(pager);
            tabs.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(pager) {

                @Override
                public void onTabReselected(TabLayout.Tab tab) {
                    super.onTabReselected(tab);
                    onScrollTop(tab.getPosition());
                }
            });
        } else {
            onUpdateTimeline();
        }
    }
    pager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {

        @Override
        public void onPageSelected(int position) {
            hideShowFab();
            super.onPageSelected(position);
        }
    });
    initTabs(pullRequest);
    hideShowFab();
    AnimHelper.mimicFabVisibility(getPresenter().hasReviewComments(), prReviewHolder, null);
    reviewsCount.setText(String.format("%s", getPresenter().getCommitComment().size()));
}
Also used : FragmentsPagerAdapter(com.fastaccess.ui.adapter.FragmentsPagerAdapter) TabLayout(android.support.design.widget.TabLayout) PullRequest(com.fastaccess.data.dao.model.PullRequest) PullRequestTimelineFragment(com.fastaccess.ui.modules.repos.pull_requests.pull_request.details.timeline.timeline.PullRequestTimelineFragment) ViewPager(android.support.v4.view.ViewPager)

Aggregations

PullRequestTimelineFragment (com.fastaccess.ui.modules.repos.pull_requests.pull_request.details.timeline.timeline.PullRequestTimelineFragment)2 TabLayout (android.support.design.widget.TabLayout)1 ViewPager (android.support.v4.view.ViewPager)1 PullRequest (com.fastaccess.data.dao.model.PullRequest)1 FragmentsPagerAdapter (com.fastaccess.ui.adapter.FragmentsPagerAdapter)1