aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java5
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java12
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java20
-rw-r--r--app/src/main/res/values-de/strings.xml1
-rw-r--r--app/src/main/res/values-es/strings.xml1
-rw-r--r--app/src/main/res/values-fr/strings.xml1
-rw-r--r--app/src/main/res/values-it/strings.xml1
-rw-r--r--app/src/main/res/values-ja/strings.xml1
-rw-r--r--app/src/main/res/values-ko/strings.xml1
-rw-r--r--app/src/main/res/values-pt/strings.xml1
-rw-r--r--app/src/main/res/values/progress_bar.xml7
-rw-r--r--app/src/main/res/values/strings.xml1
12 files changed, 45 insertions, 7 deletions
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java
index 7247e58..8084714 100644
--- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java
+++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java
@@ -3,7 +3,6 @@ package me.brysonsteck.wiimmfiwatcher;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
-import android.view.ViewGroup;
import android.view.WindowManager;
import androidx.annotation.RequiresApi;
@@ -48,4 +47,8 @@ public class MainActivity extends AppCompatActivity {
});
}
+ @Override
+ protected void onStop() {
+ super.onStop();
+ }
} \ No newline at end of file
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java
index 53828f9..7034888 100644
--- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java
+++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java
@@ -1,5 +1,6 @@
package me.brysonsteck.wiimmfiwatcher;
+import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
@@ -24,12 +25,15 @@ public class WatchCodeAdapter extends RecyclerView.Adapter<WatchCodeAdapter.View
ObservableArrayList<FriendCode> entries;
Context context;
MaterialTextView errorText;
+ ProgressDialog progressBar;
ArrayList<String> recentCodes;
- public WatchCodeAdapter(Context context, ObservableArrayList<FriendCode> entries, MaterialTextView errorText) {
+ public WatchCodeAdapter(Context context, ObservableArrayList<FriendCode> entries,
+ MaterialTextView errorText, ProgressDialog progressBar) {
this.context = context;
this.entries = entries;
this.errorText = errorText;
+ this.progressBar = progressBar;
this.recentCodes = new ArrayList<>();
}
@@ -53,6 +57,12 @@ public class WatchCodeAdapter extends RecyclerView.Adapter<WatchCodeAdapter.View
}
fcButton.setText(currentFC);
fcButton.setOnClickListener(view -> {
+ progressBar.setCancelable(true);
+ progressBar.setMessage(holder.itemView.getResources().getString(R.string.locating_text, currentFC));
+ progressBar.setProgressStyle(ProgressDialog.STYLE_SPINNER);
+ progressBar.setProgress(0);
+ progressBar.setMax(100);
+ progressBar.show();
errorText.setText("");
Intent intent = new Intent(view.getContext(), WiimmfiActivity.class);
intent.putExtra("friendCode", currentFC);
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java
index e263bb6..01069b6 100644
--- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java
+++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java
@@ -1,5 +1,6 @@
package me.brysonsteck.wiimmfiwatcher;
+import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.transition.TransitionInflater;
@@ -8,13 +9,9 @@ import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
-import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.core.view.OnApplyWindowInsetsListener;
-import androidx.core.view.ViewCompat;
-import androidx.core.view.WindowInsetsCompat;
import androidx.databinding.ObservableList;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
@@ -28,6 +25,7 @@ import me.brysonsteck.wiimmfiwatcher.viewmodel.FriendCodeViewModel;
import me.brysonsteck.wiimmfiwatcher.wiimmfi.WiimmfiActivity;
public class WatchCodeFragment extends Fragment {
+ ProgressDialog progressBar;
public WatchCodeFragment() {
super(R.layout.watch_code_fragment);
@@ -60,9 +58,10 @@ public class WatchCodeFragment extends Fragment {
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
FriendCodeViewModel viewModel = new ViewModelProvider(getActivity()).get(FriendCodeViewModel.class);
+ progressBar = new ProgressDialog(getContext(), R.style.AppCompatAlertDialogStyle);
MaterialTextView errorText = view.findViewById(R.id.error_text);
- WatchCodeAdapter adapter = new WatchCodeAdapter(getContext(), viewModel.getEntries(), errorText);
+ WatchCodeAdapter adapter = new WatchCodeAdapter(getContext(), viewModel.getEntries(), errorText, progressBar);
viewModel.getEntries().addOnListChangedCallback(new ObservableList.OnListChangedCallback<ObservableList<FriendCode>>() {
@Override
public void onChanged(ObservableList<FriendCode> sender) {
@@ -145,11 +144,22 @@ public class WatchCodeFragment extends Fragment {
});
}
+ @Override
+ public void onStop() {
+ super.onStop();
+ if (progressBar.isShowing()) { progressBar.dismiss(); }
+ }
+
public void startWiimmfiActivity(View view, EditText friendCode, MaterialTextView errorText, Button watchButton, FriendCodeViewModel viewModel) {
Intent intent = new Intent(view.getContext(), WiimmfiActivity.class);
if (!isValidFriendCode(friendCode.getText().toString())) {
errorText.setText(R.string.error_fc_syntax);
} else {
+ progressBar.setCancelable(false);
+ progressBar.setMessage(getResources().getString(R.string.locating_text, friendCode.getText()));
+ progressBar.setProgressStyle(ProgressDialog.STYLE_SPINNER);
+ progressBar.show();
+
errorText.setText("");
viewModel.saveFriendCode("", friendCode.getText().toString());
intent.putExtra("friendCode", friendCode.getText().toString());
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index a19c3dc..05fc857 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -29,4 +29,5 @@
<string name="license_header">Lizenz und Copyright</string>
<string name="version_header">Ausführung</string>
<string name="version">Sie verwenden die Wiimmfi Watcher Version %1$s aus. Sie können die Versionshinweise für diese Version <![CDATA[<a href="https://github.com/brysonsteck/wiimmfi-watcher/releases/">hier</a>]]> anzeigen.</string>
+ <string name="locating_text">Suchen von %1$s…</string>
</resources> \ No newline at end of file
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index af5b148..29c9f22 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -29,4 +29,5 @@
<string name="bugs">Hablando de errores, ¿encontraste un error? ¿Quieres darnos tu opinión sobre la aplicación? ¡Me encantaría escucharlo! Primero, asegúrese de que el problema que encontró no esté en mi <a href='https://github.com/brysonsteck/wiimmfi-watcher/blob/master/TODO.md'>lista de tareas pendientes.</a> Es posible que ya sea consciente de ello o que esté trabajando en ello. Si su problema no se aborda en la lista de tareas pendientes, puede crear un problema en mi repositorio de GitHub <a href='https://github.com/brysonsteck/wiimmfi-watcher/issues'>aquí.</a> Si no sabe cómo usar GitHub, puede completar este <a href='https://docs.google.com/forms/d/e/1FAIpQLSd6qCONAP2tsbHPgzu_CdZcHVHL5nx7q0XFqrVfExEc84kqUQ/viewform?usp=sf_link'>formulario de Google.</a></string>
<string name="license">&#169; Copyright 2021 Bryson Steck Wiimmfi Watcher está disponible bajo la Licencia Pública General de GNU Versión 3. Puede ver la licencia <a href="https://github.com/brysonsteck/wiimmfi-watcher/tree/master/LICENSE">aquí.</a>\n\nWiimmfi Watcher is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nWiimmfi Watcher is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with Wiimmfi Watcher. If not, see &lt;<a href="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</a>&gt;.</string>
<string name="contact">Si desea comunicarse conmigo por cualquier motivo que no esté relacionado con los informes de errores o esta aplicación en general, puede comunicarse conmigo por correo electrónico a <a href='mailto:steck.bryson@gmail.com'>steck.bryson@gmail.com</a> o en Discord a bryzinga#9971.</string>
+ <string name="locating_text">Localizando %1$s…</string>
</resources> \ No newline at end of file
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index d6c9660..4109ad8 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -36,5 +36,6 @@
<string name="contact">Si vous souhaitez me contacter pour une raison non liée aux rapports de bogues ou à cette application en général, vous pouvez me contacter par e-mail à <a href="mailto:steck.bryson@gmail.com">steck.bryson@gmail.com</a> ou sur Discord à bryzinga#9971.</string>
<string name="version_header">Version</string>
<string name="version">Vous exécutez la version %1$s de Wiimmfi Watcher. Vous pouvez consulter les notes de publication de cette version <![CDATA[<a href="https://github.com/brysonsteck/wiimmfi-watcher/releases/">ici.</a>]]></string>
+ <string name="locating_text">Localisation de %1$s…</string>
</resources> \ No newline at end of file
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index df21294..d094f92 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -29,4 +29,5 @@
<string name="jsoup_error">Ops! Wiimmfi Watcher non è riuscito a connettersi ai server Wiimmfi. Potrebbe essere che non sei connesso a Internet, ma potrebbe essere qualcos\'altro. Ecco l\'errore: %1$s Se l\'errore è sulla falsariga di \"Unable to resolve host\" o \"Timeout\", probabilmente si sta avendo problemi di internet. Assicurati di essere connesso a Internet, quindi fai clic sul pulsante di aggiornamento o premi Indietro per guardare un nuovo codice amico. Se l\'errore è diverso da quello o se l\'errore persiste, assicurati che il sito Web di Wiimmfi sia attualmente in esecuzione. Altrimenti, fai uno screenshot di questa schermata e invia una segnalazione di bug facendo clic sull\'icona Informazioni sulla pagina principale.</string>
<string name="version_header">Versione</string>
<string name="version">Stai eseguendo Wiimmfi Watcher versione %1$s. È possibile visualizzare le note di rilascio per questa versione <![CDATA[<a href="https://github.com/brysonsteck/wiimmfi-watcher/releases/">qui.</a>]]></string>
+ <string name="locating_text">Individuazione %1$s…</string>
</resources> \ No newline at end of file
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index 0e0c5d6..cc89096 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -29,4 +29,5 @@
<string name="contact">バグレポートやこのアプリ全般とは関係のない理由で私を捕まえたい場合は、電子メール<a href='mailto:steck.bryson@gmail.com'>(steck.bryson@gmail.com)</a>またはDiscord(bryzinga#9971)で私に連絡できます。</string>
<string name="version_header">バージョン</string>
<string name="version">Wiimmfi Watcherバージョン%1$sを実行しています。このバージョンのリリースノートは<![CDATA[<a href="https://github.com/brysonsteck/wiimmfi-watcher/releases/">こちら</a>]]>でご覧いただけます。</string>
+ <string name="locating_text">%1$sの検索…</string>
</resources> \ No newline at end of file
diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml
index 6cd3b21..bde3c68 100644
--- a/app/src/main/res/values-ko/strings.xml
+++ b/app/src/main/res/values-ko/strings.xml
@@ -29,4 +29,5 @@
<string name="bugs">버그에 대해 말하면 버그를 찾았습니까? 앱에 대한 피드백을 제공 하시겠습니까? 나는 그것을 듣고 싶다! 먼저 발견 한 문제가 내 <a href='https://github.com/brysonsteck/wiimmfi-watcher/blob/master/TODO.md'>할 일 목록</a>에 없는지 확인하십시오. 내가 이미 알고 있거나 작업 중일 수 있습니다. 문제가 할일 목록에서 해결되지 않은 경우 <a href='https://github.com/brysonsteck/wiimmfi-watcher/issues'>여기</a>에서 내 GitHub 저장소에 문제를 생성 할 수 있습니다. GitHub 사용 방법을 모르는 경우 대신이 <a href='https://docs.google.com/forms/d/e/1FAIpQLSd6qCONAP2tsbHPgzu_CdZcHVHL5nx7q0XFqrVfExEc84kqUQ/viewform?usp=sf_link'>Google 양식</a>을 작성할 수 있습니다.</string>
<string name="license">&#169; Copyright 2021 Bryson Steck\n\nWiimmfi Watcher는 GNU General Public License 버전 3에 따라 사용할 수 있습니다. <a href="https://github.com/brysonsteck/wiimmfi-watcher/tree/master/LICENSE">여기</a>에서 라이센스를 볼 수 있습니다.\n\nWiimmfi Watcher is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nWiimmfi Watcher is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with Wiimmfi Watcher. If not, see &lt;<a href="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</a>&gt;.</string>
<string name="contact">일반적으로 버그 보고서 나이 앱과 관련이없는 이유로 저를 붙잡 으려면 <a href='mailto:steck.bryson@gmail.com'>steck.bryson@gmail.com</a>으로 이메일을 보내거나 bryzinga#9971로 Discord를 통해 저에게 연락 할 수 있습니다.</string>
+ <string name="locating_text">%1$s 찾는 중…</string>
</resources> \ No newline at end of file
diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml
index 6426058..d8aa961 100644
--- a/app/src/main/res/values-pt/strings.xml
+++ b/app/src/main/res/values-pt/strings.xml
@@ -29,4 +29,5 @@
<string name="bugs">Falando em bugs, você encontrou um bug? Quer fornecer feedback sobre o aplicativo? Eu adoraria ouvir isso! Primeiro, certifique-se de que o problema que você encontrou não está listado na minha <a href='https://github.com/brysonsteck/wiimmfi-watcher/blob/master/TODO.md'>lista de tarefas</a>. É possível que eu já esteja ciente ou trabalhando nisso. Se o seu problema não for abordado na lista de tarefas, você pode criar um problema no meu repositório GitHub <a href='https://github.com/brysonsteck/wiimmfi-watcher/issues'>aqui.</a>. Se você não sabe como usar o GitHub, pode preencher este <a href='https://docs.google.com/forms/d/e/1FAIpQLSd6qCONAP2tsbHPgzu_CdZcHVHL5nx7q0XFqrVfExEc84kqUQ/viewform?usp=sf_link'>Formulário Google.</a></string>
<string name="license">&#169; Copyright 2021 Bryson Steck\n\nWiimmfi Watcher está disponível sob a Licença Pública Geral GNU Versão 3. Você pode visualizar a licença <a href="https://github.com/brysonsteck/wiimmfi-watcher/tree/master/LICENSE">aqui.</a>\n\nWiimmfi Watcher is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nWiimmfi Watcher is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with Wiimmfi Watcher. If not, see &lt;<a href="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</a>&gt;.</string>
<string name="contact">Se você quiser entrar em contato comigo por qualquer motivo não relacionado a relatórios de bugs ou a este aplicativo em geral, pode entrar em contato comigo por e-mail <a href='mailto:steck.bryson@gmail.com'>steck.bryson@gmail.com</a> ou no Discord em bryzinga#9971.</string>
+ <string name="locating_text">Localizando %1$s…</string>
</resources> \ No newline at end of file
diff --git a/app/src/main/res/values/progress_bar.xml b/app/src/main/res/values/progress_bar.xml
new file mode 100644
index 0000000..d611f1f
--- /dev/null
+++ b/app/src/main/res/values/progress_bar.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
+ <item name="colorAccent">@color/blue_700</item>
+ <item name="android:textColorPrimary">@color/white</item>
+ </style>
+</resources> \ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index e254585..bb30d2a 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -36,4 +36,5 @@
<string name="header_null_error">This player is not online, not inside a room or does not exist. Click the refresh button to try again, or click on the back button to enter a different friend code.</string>
<string name="jsoup_error">Whoops! Wiimmfi Watcher was unable to connect to the Wiimmfi servers. This could be that you are not connected to the internet, but it could be something else. Here was the error:\n\n%1$s\n\nIf the error is along the lines of \"Unable to resolve host\" or \"Timeout\", you are probably having internet issues. Make sure you are connected to the internet then click the refresh button or press back to watch a new friend code.\n\nIf the error is something other than that or if the error persists, make sure that Wiimmfi\'s website is currently running. Otherwise, please screenshot this screen and submit a bug report by clicking the About icon on the main page.</string>
+ <string name="locating_text">Locating %1$s…</string>
</resources> \ No newline at end of file