Android Open Source - Game-of-thrones-trivia About Activity






From Project

Back to project page Game-of-thrones-trivia.

License

The source code is released under:

MIT License

If you think the Android project Game-of-thrones-trivia listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.GameOfThrones.Trivia.ui;
//ww w  . j av  a 2  s. co m
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

import com.GameOfThrones.Trivia.R;

/**
 * Activity that displays information about the application
 * 
 * @author andre
 * 
 */
public class AboutActivity extends DynamicBackgroundActivity implements
    OnItemClickListener {
  /**
   * Buttons used to start dialog messages
   */
  Button eula, sources, disclaimer;
  /**
   * Displays buttons in a list
   */
  ListView list;

  /*
   * (non-Javadoc)
   * 
   * @see
   * com.GameOfThrones.Trivia.SuperActivities.DynamicBackgroundActivity#onCreate
   * (android.os.Bundle)
   */
  /**
   * Initialize instance variables
   */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.about);

    String[] str = new String[3];
    str[0] = "FOSS";
    str[1] = "sources";
    str[2] = "disclaimer";

    final ListView listview = (ListView) findViewById(R.id.listview);

    ArrayAdapter<String> adapter = new ArrayAdapter<String>(
        getBaseContext(), R.layout.clickable_row, str);
    // Bind to our new adapter.
    listview.setAdapter(adapter);

    listview.setOnItemClickListener(this);
  }

  /*
   * (non-Javadoc)
   * 
   * @see com.GameOfThrones.Trivia.SuperActivities.DynamicBackgroundActivity#
   * getBackgroundLayout()
   */
  @Override
  protected int getBackgroundLayout() {
    return R.id.aboutActivity;
  }

  /*
   * (non-Javadoc)
   * 
   * @see
   * android.widget.AdapterView.OnItemClickListener#onItemClick(android.widget
   * .AdapterView, android.view.View, int, long)
   */
  /**
   * Displays a dialog with different message depending on the button clicked
   * by user
   */
  public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
    switch (arg2) {
    case 0:
      showPopUpMessage(new int[] { R.string.updates,
          R.string.license }, true);
      break;
    case 1:
      showPopUpMessage(new int[] { R.string.sources }, true);
      break;
    case 2:
      showPopUpMessage(new int[] { R.string.disclaimer_ }, true);
      break;
    }
  }
}




Java Source Code List

com.GameOfThrones.Trivia.core.CharacterToQuestionsMap.java
com.GameOfThrones.Trivia.core.GameCharacter.java
com.GameOfThrones.Trivia.core.HighScore.java
com.GameOfThrones.Trivia.core.OutOfQuestionsException.java
com.GameOfThrones.Trivia.core.QuestionCollection.java
com.GameOfThrones.Trivia.core.Question.java
com.GameOfThrones.Trivia.core.Session.java
com.GameOfThrones.Trivia.core.SimpleIterator.java
com.GameOfThrones.Trivia.core.TriviaGame.java
com.GameOfThrones.Trivia.data.HighScorePrefs.java
com.GameOfThrones.Trivia.data.RequestWebService.java
com.GameOfThrones.Trivia.data.StringsXMLFileData.java
com.GameOfThrones.Trivia.ui.AboutActivity.java
com.GameOfThrones.Trivia.ui.DynamicBackgroundActivity.java
com.GameOfThrones.Trivia.ui.GameActivity.java
com.GameOfThrones.Trivia.ui.HighScoreActivity.java
com.GameOfThrones.Trivia.ui.MainMenuActivity.java
com.GameOfThrones.Trivia.ui.ResultsActivity.java
com.GameOfThrones.Trivia.ui.TriviaSelectionActivity.java
com.GameOfThrones.Trivia.ui.music.MusicService.java
com.GameOfThrones.Trivia.util.GeneralAlgorithms.java
com.Spartacus.TriviaTest.TriviaMenuActivityTest.java
com.Spartacus.Trivia.utilTest.GeneralAlgorithmsTest.java