Android Open Source - AndroidSettlers Stats






From Project

Back to project page AndroidSettlers.

License

The source code is released under:

GNU General Public License

If you think the Android project AndroidSettlers 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.settlers.hd;
// www  .ja  v  a  2  s  .  c  om
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

public class Stats extends Activity {

  @Override
  public void onCreate(Bundle state) {
    super.onCreate(state);

    int padding = (int) (10 * getResources().getDisplayMetrics().density);

    ListView view = new ListView(this);
    view.setPadding(padding, padding, padding, padding);

    String[] items;
    String[] games = Settlers.getInstance().getSettingsInstance().getStatList(getResources());

    if (games == null || games.length == 0) {
      items = new String[1];
      items[0] = getString(R.string.stats_none);
    } else {
      items = new String[games.length + 1];
      items[0] = getString(R.string.stats_clear);
      for (int i = 0; i < games.length; i++)
        items[i + 1] = games[i];

      view.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
          if (position == 0) {
            Settlers.getInstance().getSettingsInstance().resetScores();
            finish();
          }
        }
      });
    }

    view.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items));

    setContentView(view);
    setTitle(getString(R.string.stats));
  }
}




Java Source Code List

com.settlers.hd.AcceptTrade.java
com.settlers.hd.AutomatedPlayer.java
com.settlers.hd.BalancedAI.java
com.settlers.hd.Board.java
com.settlers.hd.CounterOffer.java
com.settlers.hd.Discard.java
com.settlers.hd.Edge.java
com.settlers.hd.GameActivity.java
com.settlers.hd.GameRenderer.java
com.settlers.hd.GameView.java
com.settlers.hd.Geometry.java
com.settlers.hd.Hexagon.java
com.settlers.hd.LocalGame.java
com.settlers.hd.Main.java
com.settlers.hd.PlayerTrade.java
com.settlers.hd.Player.java
com.settlers.hd.Reference.java
com.settlers.hd.ResourceView.java
com.settlers.hd.Rules.java
com.settlers.hd.Settings.java
com.settlers.hd.Settlers.java
com.settlers.hd.Square.java
com.settlers.hd.Stats.java
com.settlers.hd.Status.java
com.settlers.hd.TextureManager.java
com.settlers.hd.Trader.java
com.settlers.hd.UIButton.java
com.settlers.hd.Vertex.java