Search in sources :

Example 1 with PhaseResult

use of se.oort.diplicity.apigen.PhaseResult in project android-diplicity by zond.

the class GameActivity method showPhaseResults.

public void showPhaseResults() {
    setVisibility(View.GONE, R.id.nmr_members, R.id.nmr_members_label, R.id.active_members, R.id.active_members_label, R.id.ready_members, R.id.ready_members_label);
    hideAllExcept(R.id.phase_results_view);
    final ScrollView phaseResultsView = (ScrollView) findViewById(R.id.phase_results_view);
    phaseResultsView.setOnTouchListener(new View.OnTouchListener() {

        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            flickFrameLayout.onTouchEvent(motionEvent);
            phaseResultsView.onTouchEvent(motionEvent);
            return true;
        }
    });
    if (phaseMeta.Resolved) {
        handleReq(phaseResultService.PhaseResultLoad(game.ID, phaseMeta.PhaseOrdinal.toString()), new Sendable<SingleContainer<PhaseResult>>() {

            @Override
            public void send(SingleContainer<PhaseResult> phaseResultSingleContainer) {
                MemberListPopulater populater = new MemberListPopulater();
                if (phaseResultSingleContainer.Properties.NMRUsers != null) {
                    populater.populate(R.id.nmr_members, phaseResultSingleContainer.Properties.NMRUsers);
                    setVisibility(View.VISIBLE, R.id.nmr_members, R.id.nmr_members_label);
                }
                if (phaseResultSingleContainer.Properties.ActiveUsers != null) {
                    populater.populate(R.id.active_members, phaseResultSingleContainer.Properties.ActiveUsers);
                    setVisibility(View.VISIBLE, R.id.active_members, R.id.active_members_label);
                }
                if (phaseResultSingleContainer.Properties.ReadyUsers != null) {
                    populater.populate(R.id.ready_members, phaseResultSingleContainer.Properties.ReadyUsers);
                    setVisibility(View.VISIBLE, R.id.ready_members, R.id.ready_members_label);
                }
            }
        }, new ErrorHandler(404, new Sendable<HttpException>() {

            @Override
            public void send(HttpException e) {
            }
        }), getResources().getString(R.string.loading_phase_result));
    }
}
Also used : NavigationView(android.support.design.widget.NavigationView) UserView(se.oort.diplicity.UserView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView) ScrollView(android.widget.ScrollView) MotionEvent(android.view.MotionEvent) SingleContainer(se.oort.diplicity.apigen.SingleContainer) PhaseResult(se.oort.diplicity.apigen.PhaseResult) ScrollView(android.widget.ScrollView) Sendable(se.oort.diplicity.Sendable) HttpException(retrofit2.adapter.rxjava.HttpException)

Aggregations

NavigationView (android.support.design.widget.NavigationView)1 MotionEvent (android.view.MotionEvent)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 ListView (android.widget.ListView)1 ScrollView (android.widget.ScrollView)1 TextView (android.widget.TextView)1 HttpException (retrofit2.adapter.rxjava.HttpException)1 Sendable (se.oort.diplicity.Sendable)1 UserView (se.oort.diplicity.UserView)1 PhaseResult (se.oort.diplicity.apigen.PhaseResult)1 SingleContainer (se.oort.diplicity.apigen.SingleContainer)1