예제 #1
0
 private void disableAnswerButtons() {
   //
   buttonAnswer1.setEnabled(false);
   buttonAnswer2.setEnabled(false);
   buttonAnswer3.setEnabled(false);
   buttonAnswer4.setEnabled(false);
 }
예제 #2
0
 private void enableAnswerButtons() {
   //
   buttonAnswer1.setEnabled(true);
   buttonAnswer2.setEnabled(true);
   buttonAnswer3.setEnabled(true);
   buttonAnswer4.setEnabled(true);
 }
예제 #3
0
  private void initializeQuestionTextViews(Question currentQuestion) {
    //
    mCurrentQuestion = currentQuestion;

    if (mReverseNumbersInQuestions) {
      textViewQuestion.setText(
          mStringParser.reverseNumbersInStringHebrew(
              mCurrentGame.getCurrentQuestion().getQuestion()));

      textViewTimesPlayedTitle.setText(
          mStringParser.reverseNumbersInStringHebrew(
              getString(R.string.textViewTimesPlayedTitleText)
                  + mCurrentGame.getCurrentQuestion().getQuestionTimesPlayed()));
    } else {
      textViewQuestion.setText(mCurrentGame.getCurrentQuestion().getQuestion());
      textViewTimesPlayedTitle.setText(
          getString(R.string.textViewTimesPlayedTitleText)
              + " "
              + mCurrentGame.getCurrentQuestion().getQuestionTimesPlayed());
    }
    // setting question difficulty
    textViewQuestionLevel.setText(mCurrentGame.getCurrentLevelAsString());

    textViewHowManyTimesQuestionsBeenAsked.setText(
        mCurrentGame.getHowManyTimesQuestionsBeenAsked());

    // randomize answer places (indices)
    mCurrentQuestion.randomizeAnswerPlaces(m_Random);

    buttonAnswer1.setText(mCurrentQuestion.getAnswer1());
    buttonAnswer2.setText(mCurrentQuestion.getAnswer2());
    buttonAnswer3.setText(mCurrentQuestion.getAnswer3());
    buttonAnswer4.setText(mCurrentQuestion.getAnswer4());
  }
예제 #4
0
 private void resetAnswerButtonBackground(int blueButton) {
   //
   buttonAnswer1.setBackgroundResource(blueButton);
   buttonAnswer2.setBackgroundResource(blueButton);
   buttonAnswer3.setBackgroundResource(blueButton);
   buttonAnswer4.setBackgroundResource(blueButton);
 }
예제 #5
0
  @Override
  protected void onResume() {
    //
    super.onResume();

    loadSoundPool();

    // checking if to show the report question button
    if (m_SharedPreferences.getBoolean("checkBoxPreferenceShowReportQuestion", true)) {

      buttonReportMistakeInQuestion.setVisibility(View.VISIBLE);
    } else {
      buttonReportMistakeInQuestion.setVisibility(View.GONE);
    }

    if (mResumeFromHelp) {
      mResumeClock = false;
      mResumeFromHelp = false;
    }

    if (mResumeClock) {}
  }
예제 #6
0
  private void initializeButtons() {

    buttonAnswer1 = (Button) findViewById(R.id.buttonAnswer1);
    buttonAnswer2 = (Button) findViewById(R.id.buttonAnswer2);
    buttonAnswer3 = (Button) findViewById(R.id.buttonAnswer3);
    buttonAnswer4 = (Button) findViewById(R.id.buttonAnswer4);
    buttonPassQuestion = (Button) findViewById(R.id.buttonPassQuestion);

    buttonReportMistakeInQuestion = (Button) findViewById(R.id.buttonReportMistakeInQuestion);

    buttonAnswer1.setOnClickListener(this);
    buttonAnswer2.setOnClickListener(this);
    buttonAnswer3.setOnClickListener(this);
    buttonAnswer4.setOnClickListener(this);

    buttonReportMistakeInQuestion.setOnClickListener(this);
    buttonPassQuestion.setOnClickListener(this);
  }
예제 #7
0
 private void setButtonGreen(Button o_Button) {
   o_Button.setBackgroundResource(R.drawable.green_button);
 }
예제 #8
0
 private void setButtonRed(Button o_Button) {
   o_Button.setBackgroundResource(R.drawable.red_button);
 }