Android Open Source - DemiGod Battle Log






From Project

Back to project page DemiGod.

License

The source code is released under:

GNU General Public License

If you think the Android project DemiGod 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 high.caliber.productions.demigod.activity;
/*ww w . ja va  2s  . c om*/
import high.caliber.productions.demigod.R;
import high.caliber.productions.demigod.utils.SharedPrefsManager;
import high.caliber.productions.demigod.utils.SharedPrefsManager.BattleLogPrefs;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class BattleLog extends Activity implements OnClickListener {

  SharedPrefsManager prefManager;
  BattleLogPrefs battlePrefs;

  TextView tvDamageDealt, tvLifeTimeDamageDealt, tvDamageRecieved,
      tvLifeTimeDamageRecieved;

  Button bContinue;

  int damageDealt, lifeTimeDamageDealt, damageRecieved,
      lifeTimeDamageRecieved;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.battle_log);

    prefManager = new SharedPrefsManager(this);
    battlePrefs = prefManager.new BattleLogPrefs();

    damageDealt = battlePrefs.getDamageDealt();
    lifeTimeDamageDealt = battlePrefs.getLifetimeDamageDealt();
    damageRecieved = battlePrefs.getDamageRecieved();
    lifeTimeDamageRecieved = battlePrefs.getLifetimeDamageRecieved();

    tvDamageDealt = (TextView) findViewById(R.id.tvBattleLog_DamageDealt);
    tvDamageDealt.setText(String.valueOf(damageDealt));

    tvLifeTimeDamageDealt = (TextView) findViewById(R.id.tvBattleLog_LifeTimeDamageDealt);
    tvLifeTimeDamageDealt.setText(String.valueOf(lifeTimeDamageDealt));

    tvDamageRecieved = (TextView) findViewById(R.id.tvBattleLog_DamageRecieved);
    tvDamageRecieved.setText(String.valueOf(damageRecieved));

    tvLifeTimeDamageRecieved = (TextView) findViewById(R.id.tvBattleLog_LifeTimeDamageRecieved);
    tvLifeTimeDamageRecieved
        .setText(String.valueOf(lifeTimeDamageRecieved));

    bContinue = (Button) findViewById(R.id.bBattleLog_Continue);
    bContinue.setOnClickListener(this);
  }

  @Override
  public void onClick(View v) {

    if (v.getId() == R.id.bBattleLog_Continue) {
      finish();
    }

  }

  @Override
  protected void onDestroy() {
    super.onDestroy();

    battlePrefs.addDamageDealt(0);
    battlePrefs.addDamageRecieved(0);
  }

}




Java Source Code List

high.caliber.productions.demigod.Enemy.java
high.caliber.productions.demigod.Hero.java
high.caliber.productions.demigod.Item.java
high.caliber.productions.demigod.Map.java
high.caliber.productions.demigod.Tile.java
high.caliber.productions.demigod.XmlActivityTest.java
high.caliber.productions.demigod.activity.BattleLog.java
high.caliber.productions.demigod.activity.Battle_Activity.java
high.caliber.productions.demigod.activity.CreateHero.java
high.caliber.productions.demigod.activity.HomeTown.java
high.caliber.productions.demigod.activity.Home.java
high.caliber.productions.demigod.activity.Inventory.java
high.caliber.productions.demigod.activity.Status.java
high.caliber.productions.demigod.activity.TitleScreen.java
high.caliber.productions.demigod.database.EnemyDB.java
high.caliber.productions.demigod.database.HeroDB.java
high.caliber.productions.demigod.database.ItemDB.java
high.caliber.productions.demigod.settings.DpadPosition.java
high.caliber.productions.demigod.settings.DpadSizePref.java
high.caliber.productions.demigod.settings.SettingsMain.java
high.caliber.productions.demigod.utils.AnimationUtils.java
high.caliber.productions.demigod.utils.InventoryAdapter.java
high.caliber.productions.demigod.utils.LevelUpWorker.java
high.caliber.productions.demigod.utils.PixelUnitConverter.java
high.caliber.productions.demigod.utils.SharedPrefsManager.java
high.caliber.productions.demigod.utils.XmlMapAdapter.java