Commit 4582db68 authored by Adrien Oliva's avatar Adrien Oliva

fix(Lint): Drop down many lint issue

Signed-off-by: Adrien Oliva's avatarAdrien Oliva <olivaa+gitlab@yapbreak.fr>
parent 0fb8c973
Pipeline #473 passed with stage
in 0 seconds
......@@ -12,6 +12,7 @@ android {
}
lintOptions {
disable 'GoogleAppIndexingWarning'
disable 'Autofill'
}
buildTypes {
release {
......
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Disable string not used in files strings_*.xml since -->
<!-- strings are only accessed using reflection -->
<issue id="UnusedResources">
<ignore path="res/values/race.xml" />
<ignore path="res/values/strings_mainquest.xml" />
</issue>
</lint>
......@@ -70,7 +70,7 @@ public class CharacterCreation extends AppCompatActivity {
}
});
Cursor raceCursor = QuestList.getInstance().getQuest_data().getAllRaces();
Cursor raceCursor = QuestList.getDataHandler().getAllRaces();
ArrayList<String> raceSelection = new ArrayList<>();
raceIdArray = new ArrayList<>();
......
package fr.yapbreak.skyrimquest;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.NavigationView;
......@@ -15,13 +16,15 @@ import android.widget.ListView;
import android.widget.TextView;
import fr.yapbreak.skyrimquest.data.DataHelper;
import fr.yapbreak.skyrimquest.quests.Quest;
import fr.yapbreak.skyrimquest.quests.SkyrimCursorAdapter;
import fr.yapbreak.skyrimquest.character.Character;
public class QuestList extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
protected static QuestList instance;
protected static DataHelper instance;
protected static Context context;
private DataHelper quest_data;
private Character activeCharacter;
......@@ -30,10 +33,13 @@ public class QuestList extends AppCompatActivity
TextView navigation_name;
TextView navigation_details;
public static QuestList getInstance()
public static DataHelper getDataHandler()
{
return instance;
}
public static Context getContext() {
return context;
}
private void updateCharacterInfo()
{
......@@ -62,7 +68,7 @@ public class QuestList extends AppCompatActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
instance = this;
QuestList.context = getApplicationContext();
// TODO: remove this line when database is ready
this.deleteDatabase("quest_database");
......@@ -72,6 +78,7 @@ public class QuestList extends AppCompatActivity
******************************************************************************************/
quest_data = new DataHelper(this);
quest_data.populate();
instance = quest_data;
/*******************************************************************************************
Retrieve active character
......@@ -169,9 +176,4 @@ public class QuestList extends AppCompatActivity
updateCharacterInfo();
return true;
}
public DataHelper getQuest_data()
{
return quest_data;
}
}
......@@ -17,7 +17,7 @@ public class Character {
public Character(int id) throws DataHelper.DataNotFound
{
this.id = id;
QuestList.getInstance().getQuest_data().FillCharacter(id, this);
QuestList.getDataHandler().FillCharacter(id, this);
}
public Character(String name,
......@@ -29,12 +29,12 @@ public class Character {
this.avatarFileName = avatarFileName;
this.level = level;
try {
this.raceId = QuestList.getInstance().getQuest_data().getRaceId(raceId);
this.raceId = QuestList.getDataHandler().getRaceId(raceId);
} catch (DataHelper.DataNotFound e) {
this.raceId = -1;
}
this.id = QuestList.getInstance().getQuest_data().getCharacterId(this);
this.id = QuestList.getDataHandler().getCharacterId(this);
}
public String getName()
......@@ -62,7 +62,7 @@ public class Character {
String raceIdString;
try {
raceIdString = QuestList.getInstance().getQuest_data().getRaceIdString(raceId);
raceIdString = QuestList.getDataHandler().getRaceIdString(raceId);
} catch (DataHelper.DataNotFound e) {
return Integer.toString(raceId);
}
......@@ -70,7 +70,7 @@ public class Character {
String race;
try {
Field translatedRace = R.string.class.getDeclaredField(raceIdString);
race = QuestList.getInstance().getString(translatedRace.getInt(translatedRace));
race = QuestList.getContext().getString(translatedRace.getInt(translatedRace));
} catch (Exception e) {
race = raceIdString;
}
......@@ -85,7 +85,7 @@ public class Character {
void store()
{
this.id = QuestList.getInstance().getQuest_data().storeCharacter(this);
this.id = QuestList.getDataHandler().storeCharacter(this);
}
public void setName(String name)
......
......@@ -15,6 +15,7 @@
android:layout_height="wrap_content"
android:padding="20dp"
android:src="@mipmap/ic_default_avatar"
android:contentDescription="@string/avatar_description"
app:layout_constraintBottom_toBottomOf="@id/sp_race"/>
<EditText
......@@ -24,7 +25,7 @@
android:ems="10"
android:inputType="textPersonName"
android:padding="20dp"
android:text="@string/character_name_label"
android:hint="@string/character_name_label"
app:layout_constraintLeft_toRightOf="@id/iv_avatar"
app:layout_constraintTop_toTopOf="@id/iv_avatar"
tools:layout_editor_absoluteX="152dp"
......@@ -42,6 +43,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/level_label"
android:labelFor="@id/et_level"
app:layout_constraintTop_toBottomOf="@id/iv_avatar"
/>
......@@ -49,7 +51,7 @@
android:id="@+id/bt_level_minus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:text="@string/minus"
app:layout_constraintTop_toBottomOf="@id/tv_level_label" />
<EditText
......@@ -65,7 +67,7 @@
android:id="@+id/bt_level_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+"
android:text="@string/plus"
app:layout_constraintLeft_toRightOf="@id/et_level"
app:layout_constraintTop_toBottomOf="@id/tv_level_label"
/>
......
......@@ -57,4 +57,5 @@
<string name="quest_dragonslayer_desc">Tuer le dévoreur de monde.</string>
<string name="quest_fallen">Le déchu</string>
<string name="quest_fallen_desc">Capturer et interroger un des alliés d’Alduin.</string>
<string name="avatar_description">Avatar</string>
</resources>
\ No newline at end of file
<resources>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>
......@@ -4,5 +4,4 @@
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen>
<dimen name="fab_margin">16dp</dimen>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="quest_unbound">Unbound</string>
<string name="quest_unbound_desc">Escape Imperial custody and a dragon raid.</string>
<string name="quest_before_storm">Before the Storm</string>
<string name="quest_before_storm_desc">Inform the Jarl of Whiterun about the dragon attack on Helgen.</string>
<string name="quest_bleak_falls_barrow">Bleak Falls Barrow</string>
<string name="quest_bleak_falls_barrow_desc">Retrieve the Dragonstone.</string>
<string name="quest_dragon_rising">Dragon Rising</string>
<string name="quest_dragon_rising_desc">Investigate a Dragon sighting near Whiterun.</string>
<string name="quest_way_of_voice">The Way of the Voice</string>
<string name="quest_way_of_voice_desc">Meet the Greybeards.</string>
<string name="quest_horn_windcaller">The Horn of Jurgen Windcaller</string>
<string name="quest_horn_windcaller_desc">Retrieve a Greybeard artifact from Ustengrav.</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="quest_fallen">The Fallen</string>
<string name="quest_fallen_desc">Capture and interrogate one of Alduin\'s allies.</string>
<string name="quest_season_unending">Season Unending</string>
<string name="quest_season_unending_desc">Enforce a ceasefire to secure Dragonsreach.</string>
<string name="quest_paarthurnax">Paarthurnax</string>
<string name="quest_paarthurnax_desc">Deal with a potential threat.</string>
<string name="quest_world_eaters_eyrie">The World-Eater\'s Eyrie</string>
<string name="quest_world_eaters_eyrie_desc">Battle through Skuldafn Temple to reach Alduin\'s portal to Sovngarde.</string>
<string name="quest_sovnguard">Sovngarde</string>
<string name="quest_sovnguard_desc">Seek out Alduin within Sovngarde.</string>
<string name="quest_dragonslayer">Dragonslayer</string>
<string name="quest_dragonslayer_desc">Put an end to the World Eater.</string>
</resources>
......@@ -2,8 +2,6 @@
<string name="app_name" translatable="false">Skyrim Quest</string>
<string name="navigation_drawer_open" translatable="false">Open navigation drawer</string>
<string name="navigation_drawer_close" translatable="false">Close navigation drawer</string>
<string name="nav_header_title" translatable="false">Android Studio</string>
<string name="nav_header_subtitle" translatable="false">android.studio@android.com</string>
<string name="nav_header_desc" translatable="false">Navigation header</string>
<string name="action_character_switch">Switch</string>
......@@ -18,4 +16,7 @@
<string name="level_label">Level</string>
<string name="character_create">Create</string>
<string name="action_character_create">Create new…</string>
<string name="avatar_description">Avatar picture</string>
<string name="plus" translatable="false">+</string>
<string name="minus" translatable="false">-</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Act I Main Quest strings -->
<string name="quest_unbound">Unbound</string>
<string name="quest_unbound_desc">Escape Imperial custody and a dragon raid.</string>
<string name="quest_before_storm">Before the Storm</string>
<string name="quest_before_storm_desc">Inform the Jarl of Whiterun about the dragon attack on Helgen.</string>
<string name="quest_bleak_falls_barrow">Bleak Falls Barrow</string>
<string name="quest_bleak_falls_barrow_desc">Retrieve the Dragonstone.</string>
<string name="quest_dragon_rising">Dragon Rising</string>
<string name="quest_dragon_rising_desc">Investigate a Dragon sighting near Whiterun.</string>
<string name="quest_way_of_voice">The Way of the Voice</string>
<string name="quest_way_of_voice_desc">Meet the Greybeards.</string>
<string name="quest_horn_windcaller">The Horn of Jurgen Windcaller</string>
<string name="quest_horn_windcaller_desc">Retrieve a Greybeard artifact from Ustengrav.</string>
<!-- Act II Main Quest strings -->
<string name="quest_blade_in_the_dark">A Blade in the Dark</string>
<string name="quest_blade_in_the_dark_desc">Prove you are Dragonborn to Delphine by slaying the dragon Sahloknir.</string>
<string name="quest_diplomatic_immunity">Diplomatic Immunity</string>
<string name="quest_diplomatic_immunity_desc">Infiltrate a party at the Thalmor Embassy.</string>
<string name="quest_cornered_rat">A Cornered Rat</string>
<string name="quest_cornered_rat_desc">Locate Esbern.</string>
<string name="quest_alduins_wall">Alduin\'s Wall</string>
<string name="quest_alduins_wall_desc">Locate the prophecy within Sky Haven Temple.</string>
<string name="quest_throat_of_the_world">The Throat of the World</string>
<string name="quest_throat_of_the_world_desc">Receive a lesson from Paarthurnax.</string>
<string name="quest_elder_knowledge">Elder Knowledge</string>
<string name="quest_elder_knowledge_desc">Locate an Elder Scroll.</string>
<string name="quest_alduins_bane">Alduin\'s Bane</string>
<string name="quest_alduins_bane_desc">Exploit the Time Wound to learn Dragonrend.</string>
<!-- Act III Main Quest strings -->
<string name="quest_fallen">The Fallen</string>
<string name="quest_fallen_desc">Capture and interrogate one of Alduin\'s allies.</string>
<string name="quest_season_unending">Season Unending</string>
<string name="quest_season_unending_desc">Enforce a ceasefire to secure Dragonsreach.</string>
<string name="quest_paarthurnax">Paarthurnax</string>
<string name="quest_paarthurnax_desc">Deal with a potential threat.</string>
<string name="quest_world_eaters_eyrie">The World-Eater\'s Eyrie</string>
<string name="quest_world_eaters_eyrie_desc">Battle through Skuldafn Temple to reach Alduin\'s portal to Sovngarde.</string>
<string name="quest_sovnguard">Sovngarde</string>
<string name="quest_sovnguard_desc">Seek out Alduin within Sovngarde.</string>
<string name="quest_dragonslayer">Dragonslayer</string>
<string name="quest_dragonslayer_desc">Put an end to the World Eater.</string>
</resources>
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