Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Commit

Permalink
Fixes for Beta 7 (#250)
Browse files Browse the repository at this point in the history
* Fixed NPE
* Added uses-feature
* Updated translations
* Fixed broken wear input
  • Loading branch information
DreierF authored Mar 28, 2017
1 parent 5409be2 commit 794d13c
Show file tree
Hide file tree
Showing 42 changed files with 105 additions and 123 deletions.
17 changes: 13 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,18 @@
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="com.android.vending.BILLING" />

<uses-feature android:name="android.hardware.camera.flash" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.flash"
android:required="false" />
<uses-feature
android:name="android.hardware.location"
android:required="false" />

<application
android:name=".app.ApplicationInstance"
Expand Down Expand Up @@ -317,4 +326,4 @@

</application>

</manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -398,32 +398,36 @@ private void updateEnd() {
R.string.round) + " " + (data.getCurrentRound().index + 1) + "/" + data.training
.getRounds().size());
updateNavigationButtons();

// Send message to wearable app, that we are starting an end
new Thread(InputActivity.this::startWearNotification).start();
updateWearNotification();
}

private void startWearNotification() {
NotificationInfo info = buildInfo();
manager = new WearMessageManager(this, info);
if (manager == null) {
manager = new WearMessageManager(this, info);
} else {
manager.sendMessageUpdate(info);
}
}

private NotificationInfo buildInfo() {
String title = getString(R.string.passe) + " " + (data.getEnds().size());
String title = getString(R.string.my_targets);
String text = "";

// Initialize message text
if (data.getEnds().size() > 0) {
End lastEnd = lastItem(data.getEnds());
if(lastEnd != null) {
if (lastEnd != null && lastEnd.getId() == null && data.getEnds().size() > 1) {
lastEnd = data.getEnds().get(data.getEnds().size() - 2);
}
if (lastEnd != null && lastEnd.getId() != null) { //TODO change when merging with #4
title = getString(R.string.passe) + " " + (lastEnd.index + 1);
for (Shot shot : lastEnd.getShots()) {
text += data.getCurrentRound().getTarget()
.zoneToString(shot.scoringRing, shot.index) + " ";
}
text += "\n";
}
} else {
title = getString(R.string.my_targets);
}

// Load bow settings
Expand All @@ -438,6 +442,11 @@ private void updateNavigationButtons() {
updateNextButton();
}

private void updateWearNotification() {
// Send message to wearable app, that we are starting an end
new Thread(InputActivity.this::startWearNotification).start();
}

private void updatePreviousButton() {
final boolean isFirstEnd = data.endIndex == 0;
final boolean isFirstRound = data.roundIndex == 0;
Expand Down Expand Up @@ -532,8 +541,11 @@ public void onEndUpdated(List<Shot> changedEnd) {

@Override
public void onEndFinished(List<Shot> shots, boolean remote) {
if(remote && data.getCurrentRound().getEnds().size() > data.endIndex) {
data.endIndex = data.getCurrentRound().getEnds().size();
if (remote) {
data.endIndex = data.getCurrentRound().getEnds().size() - 1;
if (data.getCurrentEnd().getId() != null) {
data.endIndex = data.getCurrentRound().getEnds().size();
}
}
data.getCurrentEnd().setShots(shots);
data.getCurrentEnd().exact = targetView.getInputMode() == EInputMethod.PLOTTING && !remote;
Expand All @@ -543,11 +555,10 @@ public void onEndFinished(List<Shot> shots, boolean remote) {

data.getCurrentEnd().save();

if (manager != null) {
manager.sendMessageUpdate(buildInfo());
}
if (remote) {
showEnd(data.getEnds().size());
showEnd(data.getEnds().size() - 1);
} else {
updateWearNotification();
}
updateNavigationButtons();
supportInvalidateOptionsMenu();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import android.text.InputType;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Property;
import android.view.MotionEvent;
import android.view.View;
Expand Down Expand Up @@ -112,7 +111,6 @@ public Matrix get(TargetView targetView) {
private static final int POINTER_OFFSET_Y_DP = -60;
private static final int MIN_END_RECT_HEIGHT_DP = 80;
private static final int KEYBOARD_INNER_PADDING_DP = 40;
private static final String TAG = "TargetView";
private Matrix[] spotMatrices;
private boolean arrowNumbering;
private Dimension arrowDiameter;
Expand Down Expand Up @@ -198,20 +196,14 @@ private void init() {

@Override
public void setEnd(End end) {
Log.d(TAG, "setEnd: " + end.getShots());
shots = end.getShots();
setCurrentShotIndex(getNextShotIndex(-1));
endRenderer.setShots(shots);
endRenderer.setSelection(getCurrentShotIndex(), null, EndRenderer.MAX_CIRCLE_SIZE);
EInputMethod inputMethod;
if (end.getId() != null) {
inputMethod = end.exact ? PLOTTING : KEYBOARD;
} else {
inputMethod = SettingsManager.getInputMethod();
}
setInputMethod(inputMethod, false);
animateToNewState();
notifyTargetShotsChanged();
super.setEnd(end);
}

public void setArrow(Dimension diameter, boolean numbers) {
Expand Down Expand Up @@ -577,6 +569,7 @@ private void onLongPressArrow() {
.inputType(InputType.TYPE_CLASS_TEXT)
.input("", shots.get(pressed).comment, (dialog, input) -> {
shots.get(pressed).comment = input.toString();
notifyEndFinished();
notifyTargetShotsChanged();
})
.negativeText(android.R.string.cancel)
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-af/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,4 @@
<string name="show_total_score">Show total score</string>
<string name="show_percentage">Show percentage</string>
<string name="show_arrow_average">Show arrow average</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -380,5 +380,4 @@
<string name="show_total_score">Show total score</string>
<string name="show_percentage">Show percentage</string>
<string name="show_arrow_average">Show arrow average</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-ca/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,4 @@
<string name="show_total_score">Show total score</string>
<string name="show_percentage">Show percentage</string>
<string name="show_arrow_average">Show arrow average</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -338,5 +338,4 @@
<string name="show_total_score">Zobrazit celkové skóre</string>
<string name="show_percentage">Zobrazit procenta</string>
<string name="show_arrow_average">Zobrazit průměr na šíp</string>
<string name="backup_folder">Složka</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,4 @@
<string name="show_total_score">Show total score</string>
<string name="show_percentage">Show percentage</string>
<string name="show_arrow_average">Show arrow average</string>
<string name="backup_folder">Folder</string>
</resources>
3 changes: 1 addition & 2 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
<string name="bow_nocking_point">Nockpunkt</string>
<string name="bow_string">Sehne</string>
<string name="bow_scope_magnification">Scope Vergrößerung</string>
<string name="bow_rest_stiffness">Stiffness</string>
<string name="bow_rest_stiffness">Steifigkeit</string>
<string name="bow_button">Button</string>
<string name="more_fields">Weitere Felder</string>
<string name="recently_used">Zuletzt verwendet</string>
Expand All @@ -324,5 +324,4 @@
<string name="show_total_score">Maximal erreichbare Ringzahl anzeigen</string>
<string name="show_percentage">Prozent anzeigen</string>
<string name="show_arrow_average">Pfeildurchschnitt anzeigen</string>
<string name="backup_folder">Folder</string>
</resources>
7 changes: 3 additions & 4 deletions app/src/main/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
-->
<resources>
<!-- General -->
<string name="preferences">Recurve</string>
<string name="prev">Bow</string>
<string name="next">Yumi</string>
<string name="preferences">Options</string>
<string name="prev">Previous</string>
<string name="next">Next</string>
<string name="save">Save</string>
<string name="custom">Custom</string>
<string name="training">Training</string>
Expand Down Expand Up @@ -324,5 +324,4 @@
<string name="show_total_score">Show total score</string>
<string name="show_percentage">Show percentage</string>
<string name="show_arrow_average">Show arrow average</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,4 @@
<string name="show_total_score">Mostrar puntuación total</string>
<string name="show_percentage">Mostrar porcentajes</string>
<string name="show_arrow_average">Mostrar media de flechas</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-fi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,4 @@
<string name="show_total_score">Show total score</string>
<string name="show_percentage">Show percentage</string>
<string name="show_arrow_average">Show arrow average</string>
<string name="backup_folder">Folder</string>
</resources>
63 changes: 31 additions & 32 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<!-- Settings -->
<string name="backup_action">Sauvegarde</string>
<string name="import_action">Importer</string>
<string name="exports_as_csv">Exports as csv</string>
<string name="exports_as_csv">Exporter en CSV</string>
<string name="licences">Licences - Open Source</string>
<string name="licences_summary">Notes légales sur les licences</string>
<string name="version">Version %s</string>
Expand Down Expand Up @@ -256,10 +256,10 @@
<string name="arrow_diameter_scale">Échelle de diamètre de flèche</string>
<string name="timestamp">Date et heure</string>
<string name="change_target_face">Changer de blason</string>
<string name="your_first_training">Your first training</string>
<string name="your_first_training">Votre première entrainement</string>
<string name="grouping">Groupement</string>
<string name="show_clusters">Groupe</string>
<string name="first_training_description">Tap the plus to start a new training.</string>
<string name="first_training_description">Appuyez sur le plus pour commencer un nouveau entrainement.</string>
<string name="show_average">Moyenne</string>
<string name="show_none">Vide</string>
<string name="left_handed">Gaucher</string>
Expand Down Expand Up @@ -289,40 +289,39 @@
<string name="monthly">Mensuel</string>
<string name="connection_failed">Echec de la connexion !</string>
<string name="shooting_indoor">Tir en salle</string>
<string name="bow_rest_vertical_position">Vertical position</string>
<string name="bow_rest">Rest</string>
<string name="bow_rest_horizontal_position">Horizontal position</string>
<string name="bow_rest_vertical_position">Position verticale</string>
<string name="bow_rest">Repose flèche</string>
<string name="bow_rest_horizontal_position">Position horizontale</string>
<string name="bow_cam_settings">Cam settings</string>
<string name="bow_letoff_weight">Letoff weight</string>
<string name="bow_nocking_point">Nocking point</string>
<string name="bow_string">String</string>
<string name="bow_scope_magnification">Scope magnification</string>
<string name="bow_rest_stiffness">Stiffness</string>
<string name="bow_button">Button</string>
<string name="more_fields">More fields</string>
<string name="recently_used">Recently used</string>
<string name="intro_title_track_training_progress">Forget paper scoresheets!</string>
<string name="bow_nocking_point">Nockset</string>
<string name="bow_string">Corde</string>
<string name="bow_scope_magnification">Zoom du scope</string>
<string name="bow_rest_stiffness">Rigidité</string>
<string name="bow_button">Berger button</string>
<string name="more_fields">Autres champs</string>
<string name="recently_used">Utilisé récemment</string>
<string name="intro_title_track_training_progress">Oublier la feuille de scores !</string>
<string name="intro_description_track_training_progress">With exact arrow plotting,\nyou can get more useful insights\nout of your training data.</string>
<string name="intro_title_everything_in_one_place">Everything you need\nin one place</string>
<string name="intro_title_everything_in_one_place">Tout ce qu\'il vous faut\nen un endroit</string>
<string name="intro_description_everything_in_one_place">Including bow-, arrow-\nand sightmark-management,\narchery timer, statistics \nand much more&#8230;</string>
<string name="average_arrow_score_per_end">Average arrow score per end</string>
<string name="show_end">Show end</string>
<string name="show_round">Show round</string>
<string name="show_training">Show training</string>
<string name="summary">Summary</string>
<string name="show_end">Affichage sur la volée</string>
<string name="show_round">Affichage sur la serie</string>
<string name="show_training">Affichage sur l\'entraînement</string>
<string name="summary">Résumé</string>
<string name="end">End</string>
<string name="average_of">Average of</string>
<string name="displayed_shots">Displayed shots</string>
<string name="invalid_decimal_number">Invalid decimal number</string>
<string name="not_within_expected_range_mm">Not within the expected range of 1 to 20 mm</string>
<string name="not_within_expected_range_inch">Not within the expected range of 0 to 1 inch</string>
<string name="next_round">Next round</string>
<string name="previous_round">Previous round</string>
<string name="overview">Overview</string>
<string name="average_of">La moyenne de</string>
<string name="displayed_shots">Tirs affichés</string>
<string name="invalid_decimal_number">Nombre décimal non valide</string>
<string name="not_within_expected_range_mm">Pas dans l\'intervalle prévu de 1 à 20mm</string>
<string name="not_within_expected_range_inch">Pas dans l\'intervalle attendu de 0 à 1 pouce</string>
<string name="next_round">Série suivante</string>
<string name="previous_round">Série précédente</string>
<string name="overview">Résumé</string>
<string name="score">Score</string>
<string name="show_reached_score">Show reached score</string>
<string name="show_total_score">Show total score</string>
<string name="show_percentage">Show percentage</string>
<string name="show_arrow_average">Show arrow average</string>
<string name="backup_folder">Folder</string>
<string name="show_reached_score">Afficher le score</string>
<string name="show_total_score">Voir le score total</string>
<string name="show_percentage">Voir le pourcentage</string>
<string name="show_arrow_average">Afficher la moyenne par flèche</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-hu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,4 @@
<string name="show_total_score">A teljes pontszám</string>
<string name="show_percentage">Százalékos megjelenítés</string>
<string name="show_arrow_average">Mutasd a vesszők pontátlagát</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-in/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -310,5 +310,4 @@
<string name="show_total_score">Tunjukkan nilai keseluruhan</string>
<string name="show_percentage">Tunjukkan persentase</string>
<string name="show_arrow_average">Show arrow average</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,4 @@
<string name="show_total_score">Show total score</string>
<string name="show_percentage">Show percentage</string>
<string name="show_arrow_average">Show arrow average</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-iw/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -352,5 +352,4 @@
<string name="show_total_score">Show total score</string>
<string name="show_percentage">Show percentage</string>
<string name="show_arrow_average">Show arrow average</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -310,5 +310,4 @@
<string name="show_total_score">Show total score</string>
<string name="show_percentage">Show percentage</string>
<string name="show_arrow_average">Show arrow average</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -310,5 +310,4 @@
<string name="show_total_score">Show total score</string>
<string name="show_percentage">Show percentage</string>
<string name="show_arrow_average">Show arrow average</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-nb/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,4 @@
<string name="show_total_score">Vis total poengsum</string>
<string name="show_percentage">Vis prosent</string>
<string name="show_arrow_average">Vis pil gjennomsnitt</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,4 @@
<string name="show_total_score">Show total score</string>
<string name="show_percentage">Show percentage</string>
<string name="show_arrow_average">Show arrow average</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-no/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,4 @@
<string name="show_total_score">Vis total poengsum</string>
<string name="show_percentage">Vis prosent</string>
<string name="show_arrow_average">Vis pil gjennomsnitt</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -338,5 +338,4 @@
<string name="show_total_score">Pokaż całkowity wynik</string>
<string name="show_percentage">Pokaż procenty</string>
<string name="show_arrow_average">Pokaż średnią strzały</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,4 @@
<string name="show_total_score">Show total score</string>
<string name="show_percentage">Show percentage</string>
<string name="show_arrow_average">Show arrow average</string>
<string name="backup_folder">Folder</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-pt-rPT/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,4 @@
<string name="show_total_score">Show total score</string>
<string name="show_percentage">Show percentage</string>
<string name="show_arrow_average">Show arrow average</string>
<string name="backup_folder">Folder</string>
</resources>
Loading

0 comments on commit 794d13c

Please sign in to comment.