From 6b6897f1d3a85ac9094afe547ae2e837bec49cf4 Mon Sep 17 00:00:00 2001 From: udnp Date: Thu, 1 Feb 2018 21:17:47 +0900 Subject: [PATCH 1/7] [C] changed to show pokedex number in the IVPopupButton scan result. --- .../com/kamron/pogoiv/pokeflycomponents/IVPopupButton.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/IVPopupButton.java b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/IVPopupButton.java index e1aa1758d..0e008e55c 100644 --- a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/IVPopupButton.java +++ b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/IVPopupButton.java @@ -107,9 +107,9 @@ public void showQuickIVPreviewLook(IVScanResult ivrs) { int low = ivrs.getLowestIVCombination().percentPerfect; int high = ivrs.getHighestIVCombination().percentPerfect; if (ivrs.getCount() == 1 || high == low) { // display something like "IV: 98%" - setText(ivrs.pokemon.name + "\nIV: " + low + "%"); + setText("#" + (ivrs.pokemon.number + 1) + " " + ivrs.pokemon.name + "\nIV: " + low + "%"); } else { // display something like "IV: 55 - 87%" - setText(ivrs.pokemon.name + "\nIV: " + low + " - " + high + "%"); + setText("#" + (ivrs.pokemon.number + 1) + " " + ivrs.pokemon.name + "\nIV: " + low + " - " + high + "%"); } if (ivrs.rangeIVScan) { setText(getText() + "*"); From 9599fece5566f254916fedbec5a0761bf5d7319c Mon Sep 17 00:00:00 2001 From: udnp Date: Sat, 3 Feb 2018 16:40:05 +0900 Subject: [PATCH 2/7] [A] added pokedex number TextView in the scan result dialog. --- app/src/main/java/com/kamron/pogoiv/Pokefly.java | 3 +++ app/src/main/res/layout/dialog_results.xml | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/app/src/main/java/com/kamron/pogoiv/Pokefly.java b/app/src/main/java/com/kamron/pogoiv/Pokefly.java index ddcbfa6fa..053de6eca 100644 --- a/app/src/main/java/com/kamron/pogoiv/Pokefly.java +++ b/app/src/main/java/com/kamron/pogoiv/Pokefly.java @@ -225,6 +225,8 @@ public class Pokefly extends Service { TextView exResCandy; @BindView(R.id.exResLevel) TextView exResLevel; + @BindView(R.id.resultsPokedexNumber) + TextView resultPokedexNumber; @BindView(R.id.resultsPokemonName) TextView resultsPokemonName; @BindView(R.id.resultsCombinations) @@ -1336,6 +1338,7 @@ private void populatePrevScanNarrowing() { * Shows the name and level of the pokemon in the results dialog. */ private void populateResultsHeader(IVScanResult ivScanResult) { + resultPokedexNumber.setText("#" + (ivScanResult.pokemon.number + 1)); resultsPokemonName.setText(ivScanResult.pokemon.toString()); resultsPokemonLevel.setText(getString(R.string.level_num, ivScanResult.estimatedPokemonLevel.toString())); } diff --git a/app/src/main/res/layout/dialog_results.xml b/app/src/main/res/layout/dialog_results.xml index 7763923c7..56336d8ba 100644 --- a/app/src/main/res/layout/dialog_results.xml +++ b/app/src/main/res/layout/dialog_results.xml @@ -17,6 +17,16 @@ android:orientation="horizontal" android:baselineAligned="true"> + + Date: Sat, 3 Feb 2018 20:10:37 +0900 Subject: [PATCH 3/7] [A] added pokedex nubmer field for the class pogoiv.scanlogic.Pokemon. --- app/src/main/java/com/kamron/pogoiv/scanlogic/Pokemon.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/kamron/pogoiv/scanlogic/Pokemon.java b/app/src/main/java/com/kamron/pogoiv/scanlogic/Pokemon.java index 4acd32ced..2bc26bd31 100644 --- a/app/src/main/java/com/kamron/pogoiv/scanlogic/Pokemon.java +++ b/app/src/main/java/com/kamron/pogoiv/scanlogic/Pokemon.java @@ -51,6 +51,7 @@ public String getCharacter() { private final String displayName; public final int number; //index number in resources, pokedex number - 1 + public final int pokedexNumber; public final int baseAttack; public final int baseDefense; public final int baseStamina; @@ -62,6 +63,7 @@ public Pokemon(String name, String displayName, int number, int baseAttack, int this.name = name; this.displayName = displayName; this.number = number; + this.pokedexNumber = number + 1; this.baseAttack = baseAttack; this.baseDefense = baseDefense; this.baseStamina = baseStamina; From e45f54bc2c6001a4d3031efd57188ab869541440 Mon Sep 17 00:00:00 2001 From: udnp Date: Sat, 3 Feb 2018 20:12:03 +0900 Subject: [PATCH 4/7] [C] changed to use pokedexNumber field. --- app/src/main/java/com/kamron/pogoiv/Pokefly.java | 2 +- .../com/kamron/pogoiv/pokeflycomponents/IVPopupButton.java | 4 ++-- .../java/com/kamron/pogoiv/scanlogic/PokemonShareHandler.java | 2 +- .../java/com/kamron/pogoiv/widgets/PokemonSpinnerAdapter.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/kamron/pogoiv/Pokefly.java b/app/src/main/java/com/kamron/pogoiv/Pokefly.java index 053de6eca..57c8e92cf 100644 --- a/app/src/main/java/com/kamron/pogoiv/Pokefly.java +++ b/app/src/main/java/com/kamron/pogoiv/Pokefly.java @@ -1338,7 +1338,7 @@ private void populatePrevScanNarrowing() { * Shows the name and level of the pokemon in the results dialog. */ private void populateResultsHeader(IVScanResult ivScanResult) { - resultPokedexNumber.setText("#" + (ivScanResult.pokemon.number + 1)); + resultPokedexNumber.setText("#" + (ivScanResult.pokemon.pokedexNumber)); resultsPokemonName.setText(ivScanResult.pokemon.toString()); resultsPokemonLevel.setText(getString(R.string.level_num, ivScanResult.estimatedPokemonLevel.toString())); } diff --git a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/IVPopupButton.java b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/IVPopupButton.java index 0e008e55c..501d42be1 100644 --- a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/IVPopupButton.java +++ b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/IVPopupButton.java @@ -107,9 +107,9 @@ public void showQuickIVPreviewLook(IVScanResult ivrs) { int low = ivrs.getLowestIVCombination().percentPerfect; int high = ivrs.getHighestIVCombination().percentPerfect; if (ivrs.getCount() == 1 || high == low) { // display something like "IV: 98%" - setText("#" + (ivrs.pokemon.number + 1) + " " + ivrs.pokemon.name + "\nIV: " + low + "%"); + setText("#" + ivrs.pokemon.pokedexNumber + " " + ivrs.pokemon.name + "\nIV: " + low + "%"); } else { // display something like "IV: 55 - 87%" - setText("#" + (ivrs.pokemon.number + 1) + " " + ivrs.pokemon.name + "\nIV: " + low + " - " + high + "%"); + setText("#" + ivrs.pokemon.pokedexNumber + " " + ivrs.pokemon.name + "\nIV: " + low + " - " + high + "%"); } if (ivrs.rangeIVScan) { setText(getText() + "*"); diff --git a/app/src/main/java/com/kamron/pogoiv/scanlogic/PokemonShareHandler.java b/app/src/main/java/com/kamron/pogoiv/scanlogic/PokemonShareHandler.java index 254cffed9..60539c901 100644 --- a/app/src/main/java/com/kamron/pogoiv/scanlogic/PokemonShareHandler.java +++ b/app/src/main/java/com/kamron/pogoiv/scanlogic/PokemonShareHandler.java @@ -22,7 +22,7 @@ public class PokemonShareHandler { public void spreadResultIntent(Pokefly pokefly, IVScanResult ivScan,String uniquePokemonID) { JSONObject jsonPokemon = new JSONObject(); try { - jsonPokemon.put("PokemonId", ivScan.pokemon.number + 1); + jsonPokemon.put("PokemonId", ivScan.pokemon.pokedexNumber); jsonPokemon.put("AtkMin", ivScan.lowAttack); jsonPokemon.put("AtkMax", ivScan.highAttack); jsonPokemon.put("DefMin", ivScan.lowDefense); diff --git a/app/src/main/java/com/kamron/pogoiv/widgets/PokemonSpinnerAdapter.java b/app/src/main/java/com/kamron/pogoiv/widgets/PokemonSpinnerAdapter.java index 8ea0555f8..c06b71ee9 100644 --- a/app/src/main/java/com/kamron/pogoiv/widgets/PokemonSpinnerAdapter.java +++ b/app/src/main/java/com/kamron/pogoiv/widgets/PokemonSpinnerAdapter.java @@ -64,7 +64,7 @@ private View getCustomView(int position, ViewGroup parent) { TextView row = (TextView) inflater.inflate(textViewResourceId, parent, false); Pokemon pokemon = pokemons.get(position); - String text = String.format("#%d %s", pokemon.number + 1, pokemon.toString()); + String text = String.format("#%d %s", pokemon.pokedexNumber, pokemon.toString()); int padding = GuiUtil.dpToPixels(5, context); row.setPadding(padding, 0, 0, padding); From d60c0d201e6fb8d3375741685899dc95d1cc0263 Mon Sep 17 00:00:00 2001 From: udnp Date: Sat, 3 Feb 2018 20:36:14 +0900 Subject: [PATCH 5/7] [C] used String.format(). --- .../com/kamron/pogoiv/pokeflycomponents/IVPopupButton.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/IVPopupButton.java b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/IVPopupButton.java index 501d42be1..dcbda50e6 100644 --- a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/IVPopupButton.java +++ b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/IVPopupButton.java @@ -107,9 +107,9 @@ public void showQuickIVPreviewLook(IVScanResult ivrs) { int low = ivrs.getLowestIVCombination().percentPerfect; int high = ivrs.getHighestIVCombination().percentPerfect; if (ivrs.getCount() == 1 || high == low) { // display something like "IV: 98%" - setText("#" + ivrs.pokemon.pokedexNumber + " " + ivrs.pokemon.name + "\nIV: " + low + "%"); + setText(String.format("#%d %s\nIV: %d%%", ivrs.pokemon.pokedexNumber, ivrs.pokemon.name, low)); } else { // display something like "IV: 55 - 87%" - setText("#" + ivrs.pokemon.pokedexNumber + " " + ivrs.pokemon.name + "\nIV: " + low + " - " + high + "%"); + setText(String.format("#%d %s\nIV: %d - %d%%", ivrs.pokemon.pokedexNumber, ivrs.pokemon.name, low, high)); } if (ivrs.rangeIVScan) { setText(getText() + "*"); From 34b27946d1526a6b613c7ad620814115458ac930 Mon Sep 17 00:00:00 2001 From: udnp Date: Sat, 3 Feb 2018 21:11:03 +0900 Subject: [PATCH 6/7] [C] adjusted pokedex number TextView in the result dialog. --- app/src/main/res/layout/dialog_results.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/res/layout/dialog_results.xml b/app/src/main/res/layout/dialog_results.xml index 56336d8ba..6d33c8c06 100644 --- a/app/src/main/res/layout/dialog_results.xml +++ b/app/src/main/res/layout/dialog_results.xml @@ -24,7 +24,6 @@ android:textSize="18sp" android:textColor="#888" android:text="#ddd" - android:layout_marginStart="6dp" android:layout_marginEnd="6dp"/> Date: Tue, 6 Feb 2018 02:46:23 +0900 Subject: [PATCH 7/7] [Rf] tiny improved. --- app/src/main/java/com/kamron/pogoiv/Pokefly.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/kamron/pogoiv/Pokefly.java b/app/src/main/java/com/kamron/pogoiv/Pokefly.java index 57c8e92cf..e4a90890b 100644 --- a/app/src/main/java/com/kamron/pogoiv/Pokefly.java +++ b/app/src/main/java/com/kamron/pogoiv/Pokefly.java @@ -1338,7 +1338,7 @@ private void populatePrevScanNarrowing() { * Shows the name and level of the pokemon in the results dialog. */ private void populateResultsHeader(IVScanResult ivScanResult) { - resultPokedexNumber.setText("#" + (ivScanResult.pokemon.pokedexNumber)); + resultPokedexNumber.setText("#" + ivScanResult.pokemon.pokedexNumber); resultsPokemonName.setText(ivScanResult.pokemon.toString()); resultsPokemonLevel.setText(getString(R.string.level_num, ivScanResult.estimatedPokemonLevel.toString())); }