mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-02-23 15:38:29 +01:00
Basic UI styling for game statistics
This commit is contained in:
4
AndorsTrail/res/drawable/ui_headerbackground.xml
Normal file
4
AndorsTrail/res/drawable/ui_headerbackground.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="#FF555555" />
|
||||
</shape>
|
||||
@@ -58,8 +58,14 @@
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/section_margin"
|
||||
android:text="@string/actorinfo_currenttraits" />
|
||||
android:text="@string/actorinfo_currenttraits"
|
||||
style="@style/actorinfo_sectionheader"
|
||||
/>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@drawable/ui_headerbackground"
|
||||
/>
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -92,8 +98,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/actorinfo_currentconditions"
|
||||
android:id="@+id/actorinfo_currentconditions_title"
|
||||
android:layout_marginTop="@dimen/section_margin"
|
||||
/>
|
||||
style="@style/actorinfo_sectionheader"
|
||||
/>
|
||||
<com.gpl.rpg.AndorsTrail.view.ActorConditionList
|
||||
android:id="@+id/actorinfo_currentconditions"
|
||||
android:layout_width="match_parent"
|
||||
@@ -103,9 +109,14 @@
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/section_margin"
|
||||
android:text="@string/actorinfo_basetraits"
|
||||
/>
|
||||
style="@style/actorinfo_sectionheader"
|
||||
/>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@drawable/ui_headerbackground"
|
||||
/>
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -134,56 +145,17 @@
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/section_margin"
|
||||
android:text="@string/heroinfo_gamestats"
|
||||
style="@style/actorinfo_sectionheader"
|
||||
/>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/actorinfo_currentconditions_title2"
|
||||
android:background="@drawable/ui_headerbackground"
|
||||
/>
|
||||
<include layout="@layout/heroinfo_stats_gamestats" />
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/heroinfo_gamestats_table"
|
||||
>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_quests_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_quests" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_quests" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_visited_maps_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_visited_maps" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_visited_maps" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_deaths_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_deaths" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_deaths" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_spent_gold_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_spent_gold" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_spent_gold" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_bonemeals_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_bonemeals" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_bonemeals" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_num_used_items_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_num_used_items" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_num_used_items" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_fav_item_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_fav_item" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_fav_item" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_num_killed_monsters_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_num_killed_monsters" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_num_killed_monsters" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_top_boss_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_top_boss" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_top_boss" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_fav_monsters_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_fav_monsters" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_fav_monsters" />
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
53
AndorsTrail/res/layout/heroinfo_stats_gamestats.xml
Normal file
53
AndorsTrail/res/layout/heroinfo_stats_gamestats.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/heroinfo_gamestats_table"
|
||||
>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_quests_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_quests" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_quests" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_visited_maps_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_visited_maps" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_visited_maps" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_deaths_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_deaths" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_deaths" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_spent_gold_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_spent_gold" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_spent_gold" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_bonemeals_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_bonemeals" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_bonemeals" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_num_used_items_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_num_used_items" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_num_used_items" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_num_killed_monsters_row">
|
||||
<TextView style="@style/traitsinfo_label" android:text="@string/heroinfo_gamestats_num_killed_monsters" />
|
||||
<TextView android:id="@+id/heroinfo_gamestats_num_killed_monsters" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_fav_item_row1">
|
||||
<TextView style="@style/traitsinfo_2linelabel" android:text="@string/heroinfo_gamestats_fav_item" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_fav_item_row2">
|
||||
<TextView style="@style/traitsinfo_2linevalue" android:id="@+id/heroinfo_gamestats_fav_item" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_top_boss_row1">
|
||||
<TextView style="@style/traitsinfo_2linelabel" android:text="@string/heroinfo_gamestats_top_boss" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_top_boss_row2">
|
||||
<TextView style="@style/traitsinfo_2linevalue" android:id="@+id/heroinfo_gamestats_top_boss" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_fav_monsters_row1">
|
||||
<TextView style="@style/traitsinfo_2linelabel" android:text="@string/heroinfo_gamestats_fav_monsters" />
|
||||
</TableRow>
|
||||
<TableRow android:id="@+id/heroinfo_gamestats_fav_monsters_row2">
|
||||
<TextView style="@style/traitsinfo_2linevalue" android:id="@+id/heroinfo_gamestats_fav_monsters" />
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
@@ -652,14 +652,14 @@ Every skill level increases the attack chance of weapons with %1$d %% of their o
|
||||
<string name="startscreen_incompatible_savegames">This is a development version of Andor\'s Trail. Savegames produced by this version are incompatible with the release version.</string>
|
||||
<string name="startscreen_non_release_version">This is a prerelease version of Andor\'s Trail. Savegames produced by this version might not be compatible with the release version.</string>
|
||||
<string name="heroinfo_gamestats">Game statistics</string>
|
||||
<string name="heroinfo_gamestats_quests">Number of completed quests</string>
|
||||
<string name="heroinfo_gamestats_quests">Completed quests</string>
|
||||
<string name="heroinfo_gamestats_deaths">Times fallen unconscious</string>
|
||||
<string name="heroinfo_gamestats_spent_gold">Gold spent in shops</string>
|
||||
<string name="heroinfo_gamestats_bonemeals">Number of Bonemeal potions used</string>
|
||||
<string name="heroinfo_gamestats_num_used_items">Number of items used</string>
|
||||
<string name="heroinfo_gamestats_visited_maps">Number of places visited</string>
|
||||
<string name="heroinfo_gamestats_bonemeals">Bonemeal potions used</string>
|
||||
<string name="heroinfo_gamestats_num_used_items">Items used</string>
|
||||
<string name="heroinfo_gamestats_visited_maps">Places visited</string>
|
||||
<string name="heroinfo_gamestats_fav_item">Most commonly used item</string>
|
||||
<string name="heroinfo_gamestats_num_killed_monsters">Number of monsters killed</string>
|
||||
<string name="heroinfo_gamestats_num_killed_monsters">Monsters killed</string>
|
||||
<string name="heroinfo_gamestats_top_boss">Most powerful monster killed</string>
|
||||
<string name="heroinfo_gamestats_fav_monsters">Most commonly killed monsters</string>
|
||||
<string name="heroinfo_gamestats_name_and_qty">%1$s (%2$d)</string>
|
||||
|
||||
6
AndorsTrail/res/values/styles.xml
Normal file
6
AndorsTrail/res/values/styles.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="actorinfo_sectionheader">
|
||||
<item name="android:layout_marginTop">@dimen/section_margin</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -44,4 +44,11 @@
|
||||
<style name="traitsinfo_label" parent="android:Widget.TextView">
|
||||
<item name="android:layout_marginRight">10sp</item>
|
||||
</style>
|
||||
|
||||
<style name="traitsinfo_2linelabel" parent="android:Widget.TextView">
|
||||
</style>
|
||||
|
||||
<style name="traitsinfo_2linevalue" parent="android:Widget.TextView">
|
||||
<item name="android:layout_marginLeft">30sp</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -174,24 +174,31 @@ public final class HeroinfoActivity_Stats extends Fragment {
|
||||
updateStatsTableRow(world.model.statistics.getNumberOfUsedItems(), R.id.heroinfo_gamestats_num_used_items, R.id.heroinfo_gamestats_num_used_items_row);
|
||||
updateStatsTableRow(world.model.statistics.getNumberOfUsedBonemealPotions(), R.id.heroinfo_gamestats_bonemeals, R.id.heroinfo_gamestats_bonemeals_row);
|
||||
updateStatsTableRow(world.model.statistics.getNumberOfKilledMonsters(), R.id.heroinfo_gamestats_num_killed_monsters, R.id.heroinfo_gamestats_num_killed_monsters_row);
|
||||
updateStatsTableRow(world.model.statistics.getMostCommonlyUsedItem(world, res), R.id.heroinfo_gamestats_fav_item, R.id.heroinfo_gamestats_fav_item_row);
|
||||
updateStatsTableRow(world.model.statistics.getMostPowerfulKilledMonster(world), R.id.heroinfo_gamestats_top_boss, R.id.heroinfo_gamestats_top_boss_row);
|
||||
updateStatsTableRow(world.model.statistics.getTop5MostCommonlyKilledMonsters(world, res), R.id.heroinfo_gamestats_fav_monsters, R.id.heroinfo_gamestats_fav_monsters_row);
|
||||
updateStatsTableRow(world.model.statistics.getMostCommonlyUsedItem(world, res), R.id.heroinfo_gamestats_fav_item, R.id.heroinfo_gamestats_fav_item_row1, R.id.heroinfo_gamestats_fav_item_row2);
|
||||
updateStatsTableRow(world.model.statistics.getMostPowerfulKilledMonster(world), R.id.heroinfo_gamestats_top_boss, R.id.heroinfo_gamestats_top_boss_row1, R.id.heroinfo_gamestats_top_boss_row2);
|
||||
updateStatsTableRow(world.model.statistics.getTop5MostCommonlyKilledMonsters(world, res), R.id.heroinfo_gamestats_fav_monsters, R.id.heroinfo_gamestats_fav_monsters_row1, R.id.heroinfo_gamestats_fav_monsters_row2);
|
||||
}
|
||||
|
||||
private void updateStatsTableRow(int value, int textView, int tableRow) {
|
||||
String s = (value > 0) ? Integer.toString(value) : null;
|
||||
updateStatsTableRow(s, textView, tableRow);
|
||||
updateStatsTableRow(s, textView, tableRow, 0);
|
||||
}
|
||||
|
||||
private void updateStatsTableRow(String value, int textView, int tableRow) {
|
||||
updateStatsTableRow(value, textView, tableRow, 0);
|
||||
}
|
||||
private void updateStatsTableRow(String value, int textView, int tableRow1, int tableRow2) {
|
||||
TextView tv = (TextView) view.findViewById(textView);
|
||||
TableRow tr = (TableRow) view.findViewById(tableRow);
|
||||
TableRow tr1 = (TableRow) view.findViewById(tableRow1);
|
||||
TableRow tr2 = null;
|
||||
if (tableRow2 != 0) tr2 = (TableRow) view.findViewById(tableRow2);
|
||||
if (value != null) {
|
||||
tv.setText(value);
|
||||
tr.setVisibility(View.VISIBLE);
|
||||
tr1.setVisibility(View.VISIBLE);
|
||||
if (tr2 != null) tr2.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
tr.setVisibility(View.GONE);
|
||||
tr1.setVisibility(View.GONE);
|
||||
if (tr2 != null) tr2.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user