private void SetQuestionAndAnswersTexts(QuestionPresenter questionPresenter) { _gameView.QuestionBox.QuestionText = questionPresenter.QuestionText; _gameView.Button(AnswerCode.A) .SetState(AnswerButtonState.Normal) .AnswerText = String.Format("A: {0}", questionPresenter.AnswerA); _gameView.Button(AnswerCode.B) .SetState(AnswerButtonState.Normal) .AnswerText = String.Format("B: {0}", questionPresenter.AnswerB); _gameView.Button(AnswerCode.C) .SetState(AnswerButtonState.Normal) .AnswerText = String.Format("C: {0}", questionPresenter.AnswerC); _gameView.Button(AnswerCode.D) .SetState(AnswerButtonState.Normal) .AnswerText = String.Format("D: {0}", questionPresenter.AnswerD); }
protected override void InitView() { srlBlog = rootView.FindViewById <SwipeRefreshLayout>(Resource.Id.srl_blog); recyclerview_blog = rootView.FindViewById <RecyclerView>(Resource.Id.recyclerview_blog); srlBlog.SetColorSchemeResources(Resource.Color.colorPrimary); recyclerview_blog.SetLayoutManager(new LinearLayoutManager(this.Activity)); questionPresenter = new QuestionPresenter(this); adapter = new QuestionAdapter(); loadMoreWrapper = new LoadMoreWrapper(adapter); recyclerview_blog.SetAdapter(loadMoreWrapper); emptyView = this.Activity.LayoutInflater.Inflate(Resource.Layout.empty, (ViewGroup)recyclerview_blog.Parent, false); failView = this.Activity.LayoutInflater.Inflate(Resource.Layout.fail, (ViewGroup)recyclerview_blog.Parent, false); srlBlog.SetOnRefreshListener(this); failView.SetOnClickListener(this); emptyView.SetOnClickListener(this); loadMoreWrapper.SetOnLoadMoreListener(this); recyclerview_blog.Post(async() => { await questionPresenter.GetLocalQuestionListAsync(pageSize, GetQuestionType()); }); }
public QuestionPresenter GetNewQuestion(GameLevel level) { CurrentQuestion = new QuestionPresenter(_repository.GetNextQuestion(level)); return(CurrentQuestion); }