Commit 8e9cf566 authored by Mathilde BALLOUHEY's avatar Mathilde BALLOUHEY
Browse files

Ajout des plus d'informations sur DisplayResult

parent 6ece9927
Pipeline #23350 failed with stages
in 2 minutes and 37 seconds
......@@ -26,9 +26,11 @@ public class DisplayResultActivity extends AppCompatActivity {
public static final int GIF_RESULT_CODE = 42;
private int m_index;
private DnDSheet m_sheet;
private TextView lbl_displayResult_class, lbl_displayResult_description, lbl_displayResult_skills,
lbl_displayResult_str, lbl_displayResult_dex, lbl_displayResult_int, lbl_displayResult_con,
lbl_displayResult_wis, lbl_displayResult_cha, lbl_displayResult_equipements;
private TextView lbl_displayResult_class, lbl_displayResult_description, lbl_displayResult_system,
lbl_displayResult_personality, lbl_displayResult_skills, lbl_displayResult_spells,
lbl_displayResult_saves, lbl_displayResult_str, lbl_displayResult_dex,
lbl_displayResult_int, lbl_displayResult_con, lbl_displayResult_wis,
lbl_displayResult_cha, lbl_displayResult_equipements;
private ImageView img_displayResult_gif;
private FloatingActionButton btn_displayResult_favourite;
......@@ -39,7 +41,11 @@ public class DisplayResultActivity extends AppCompatActivity {
lbl_displayResult_class = findViewById(R.id.lbl_displayResult_class);
lbl_displayResult_description = findViewById(R.id.lbl_displayResult_description);
lbl_displayResult_system = findViewById(R.id.lbl_displayResult_system);
lbl_displayResult_personality = findViewById(R.id.lbl_displayResult_personality);
lbl_displayResult_skills = findViewById(R.id.lbl_displayResult_skills);
lbl_displayResult_spells = findViewById(R.id.lbl_displayResult_spells);
lbl_displayResult_saves = findViewById(R.id.lbl_displayResult_saves);
lbl_displayResult_str = findViewById(R.id.lbl_displayResult_str);
lbl_displayResult_dex = findViewById(R.id.lbl_displayResult_dex);
lbl_displayResult_int = findViewById(R.id.lbl_displayResult_int);
......@@ -54,17 +60,42 @@ public class DisplayResultActivity extends AppCompatActivity {
Intent v_getIntent = getIntent();
m_sheet = (DnDSheet) v_getIntent.getSerializableExtra(ResearchResultsActivity.SHEET);
m_index = v_getIntent.getIntExtra(ListResultsAdapter.INDEX, -1);
String v_spells;
if(!m_sheet.spells.isEmpty()) {
v_spells = m_sheet.spells.get(0);
for (int v_compt = 1; v_compt < m_sheet.spells.size(); v_compt++) {
v_spells += String.format("\n%s", m_sheet.spells.get(v_compt));
}
}
else {
v_spells = "There is no such a thing as a spell in this sheet.";
}
String v_equipement;
if(!m_sheet.equipment.isEmpty()) {
v_equipement = m_sheet.equipment.get(0);
for(int v_compt = 1; v_compt < m_sheet.equipment.size(); v_compt++) {
v_equipement += String.format("\n%s", m_sheet.equipment.get(v_compt));
}
}
else {
v_equipement = "There is no such a thing as equipments in this sheet.";
}
lbl_displayResult_class.setText(m_sheet.caracterClass.toString());
lbl_displayResult_description.setText(m_sheet.appearance);
lbl_displayResult_system.setText(m_sheet.system.longName);
lbl_displayResult_personality.setText(m_sheet.personality);
lbl_displayResult_skills.setText(m_sheet.skills.toString());
lbl_displayResult_spells.setText(v_spells);
lbl_displayResult_str.setText(m_sheet.attr.get("str").toString());
lbl_displayResult_dex.setText(m_sheet.attr.get("dex").toString());
lbl_displayResult_int.setText(m_sheet.attr.get("int").toString());
lbl_displayResult_con.setText(m_sheet.attr.get("con").toString());
lbl_displayResult_wis.setText(m_sheet.attr.get("wis").toString());
lbl_displayResult_cha.setText(m_sheet.attr.get("cha").toString());
lbl_displayResult_equipements.setText(m_sheet.saves.toString());
lbl_displayResult_saves.setText(m_sheet.saves.toString());
lbl_displayResult_equipements.setText(v_equipement);
setFavouriteBtn();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment