Skip to content

Commit

Permalink
Merge branch 'master' into hatchEgg
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/src/main/java/com/icecream/snorlax/module/feature/encounter/EncounterNotification.java
  • Loading branch information
pperle committed Sep 27, 2016
2 parents 5773bc3 + 592a569 commit 598a6c5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ public final class Encounter implements Feature {
private String formatMove(String move) {
StringBuilder builder = new StringBuilder();
for (String part : move.split("_")) {
builder
.append(part.charAt(0))
.append(part.substring(1).toLowerCase(Locale.US))
.append(" ");
if (!part.equalsIgnoreCase("fast")) {
builder
.append(part.charAt(0))
.append(part.substring(1).toLowerCase(Locale.US))
.append(" ");
}
}
return builder.toString().trim();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ void show(int pokemonNumber, String pokemonName, double iv, int attack, int defe
getLargeIconHeight(),
false
))
.setContentTitle(mContext.getString(R.string.notification_title, Helper.getPokemonName(pokemonNumber, mResources)))
.setContentText(mContext.getString(R.string.notification_content, iv, attack, defense, stamina, cp, level, hp))
.setContentTitle(mContext.getString(R.string.notification_title, Helper.getPokemonName(pokemonNumber, mResources), cp, hp, level))
.setContentText(mContext.getString(R.string.notification_content, iv, attack, defense, stamina))
.setStyle(new NotificationCompat.InboxStyle()
.addLine(mContext.getString(R.string.notification_categoty_stats_content, iv, attack, defense, stamina, cp, level, hp))
.addLine(mContext.getString(R.string.notification_categoty_stats_content, iv, attack, defense, stamina))
.addLine(getBoldSpannable(mContext.getString(R.string.notification_categoty_moves_title)))
.addLine(mContext.getString(R.string.notification_categoty_moves_content, move1, move2))
.addLine(getBoldSpannable(mContext.getString(R.string.notification_categoty_catch_title)))
Expand All @@ -84,7 +84,8 @@ void show(int pokemonNumber, String pokemonName, double iv, int attack, int defe
)
.setColor(ContextCompat.getColor(mContext, R.color.red_700))
.setAutoCancel(true)
.setVibrate(new long[]{0, 60, 300, 60})
//.setVibrate(new long[]{0, 60, 300, 60})
.setVibrate(new long[]{0})
.setPriority(Notification.PRIORITY_MAX)
.setCategory(NotificationCompat.CATEGORY_ALARM)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ int getNumber() {
String getName() {
StringBuilder builder = new StringBuilder();
for (String part : mPokemon.getPokemonId().name().split("_")) {
builder
.append(part.charAt(0))
.append(part.substring(1).toLowerCase(Locale.US))
.append(" ");
if (!part.equalsIgnoreCase("male") && !part.equalsIgnoreCase("female")) {
builder
.append(part.charAt(0))
.append(part.substring(1).toLowerCase(Locale.US))
.append(" ");
}
}
return builder.toString().trim();
}
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<string name="error_xposed_missing">Install xposed to use Snorlax</string>
<string name="error_pokemon_missing">Install Pokemon Go to launch it</string>

<string name="notification_title">%1$s has appeared!</string>
<string name="notification_content">IV %1$4.1f%% %2$d/%3$d/%4$d - CP %5$d - LV %6$3.1f - HP %7$d</string>
<string name="notification_title">%1$s (CP %2$d HP %3$d) LV %4$3.1f</string>
<string name="notification_content">%1$4.1f%% [A/D/S %2$d/%3$d/%4$d]</string>

<string name="notification_categoty_stats_title">Stats</string>
<string name="notification_categoty_stats_content">IV %1$4.1f%% %2$d/%3$d/%4$d - CP %5$d - LV %6$3.1f - HP %7$d</string>
<string name="notification_categoty_stats_content">%1$4.1f%% [A/D/S %2$d/%3$d/%4$d]</string>

<string name="notification_categoty_moves_title">Moves</string>
<string name="notification_categoty_moves_content">%1$s - %2$s</string>
Expand All @@ -37,7 +37,7 @@
<string name="preference_encounter_notification">Encounter Notifications</string>
<string name="preference_encounter_notification_enable_key">encounter_notification_key</string>
<string name="preference_encounter_notification_enable_title">Enable encounter notifications</string>
<string name="preference_encounter_notification_enable_summary">Show encountered encounterPokemon stats via system notification</string>
<string name="preference_encounter_notification_enable_summary">Show encounter pokemons stats via system notification</string>

<string name="preference_catch_notification">Catch Notifications</string>
<string name="preference_catch_notification_enable_key">catch_notification_key</string>
Expand Down

0 comments on commit 598a6c5

Please sign in to comment.