Android Open Source - mtgtools Card Detail Activity






From Project

Back to project page mtgtools.

License

The source code is released under:

GNU General Public License

If you think the Android project mtgtools 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 pe.apiconz.apps.mtgtools;
/* w w  w  .j  a  va2 s  .  com*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

public class CardDetailActivity extends Activity {

  TextView txtDetailName, txtDetailMana, txtDetailType, txtDetailText,
      txtDetailExpansion, txtDetailNumber, txtDetailRarity,
      txtDetailArtist;
  
  ImageView imgCardImage;

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

    Intent intent = getIntent();
    String cardNumber = intent.getStringExtra("cardNumber");

    BDHelper bdHelper = new BDHelper(this);
    bdHelper.openDatabase();
    Card card = bdHelper.getDetailsOfCard(cardNumber);
    bdHelper.close();

    txtDetailName = (TextView) findViewById(R.id.txtDetailName);
    txtDetailMana = (TextView) findViewById(R.id.txtDetailMana);
    txtDetailType = (TextView) findViewById(R.id.txtDetailType);
    txtDetailText = (TextView) findViewById(R.id.txtDetailText);
    txtDetailExpansion = (TextView) findViewById(R.id.txtDetailExpansion);
    txtDetailNumber = (TextView) findViewById(R.id.txtDetailNumber);
    txtDetailRarity = (TextView) findViewById(R.id.txtDetailRarity);
    txtDetailArtist = (TextView) findViewById(R.id.txtDetailArtist);
    imgCardImage = (ImageView) findViewById(R.id.imgCard);

    txtDetailName.setText(card.cardName);
    txtDetailMana.setText(card.cardMana);
    txtDetailType.setText(card.cardType);
    txtDetailText.setText(card.cardText);
    txtDetailExpansion.setText(card.cardEdition);
    txtDetailNumber.setText(cardNumber);
    txtDetailRarity.setText(card.cardRarity);
    txtDetailArtist.setText(card.cardArtist);
    imgCardImage.setTag(card.cardUrl);
    new DownloadImageTask(imgCardImage).execute(card.cardUrl);

    getActionBar().setDisplayHomeAsUpEnabled(true);

  }

}




Java Source Code List

pe.apiconz.apps.mtgtools.AboutMeActivity.java
pe.apiconz.apps.mtgtools.BDHelper.java
pe.apiconz.apps.mtgtools.CardDetailActivity.java
pe.apiconz.apps.mtgtools.CardListActivity.java
pe.apiconz.apps.mtgtools.Card.java
pe.apiconz.apps.mtgtools.CounterActivity.java
pe.apiconz.apps.mtgtools.DownloadImageTask.java
pe.apiconz.apps.mtgtools.ListCardAdapter.java
pe.apiconz.apps.mtgtools.MenuActivity.java
pe.apiconz.apps.mtgtools.SplashScreen.java