From 72c839bd12c37b95776f2a03f98c52036b9400fc Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Sun, 30 May 2021 23:04:42 -0600 Subject: added dialog between main and wiimmfi activities, updated todo list for release --- .../me/brysonsteck/wiimmfiwatcher/MainActivity.java | 5 ++++- .../brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java | 12 +++++++++++- .../wiimmfiwatcher/WatchCodeFragment.java | 20 +++++++++++++++----- app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-ko/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values/progress_bar.xml | 7 +++++++ app/src/main/res/values/strings.xml | 1 + 12 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 app/src/main/res/values/progress_bar.xml (limited to 'app/src') 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 entries; Context context; MaterialTextView errorText; + ProgressDialog progressBar; ArrayList recentCodes; - public WatchCodeAdapter(Context context, ObservableArrayList entries, MaterialTextView errorText) { + public WatchCodeAdapter(Context context, ObservableArrayList 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 { + 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>() { @Override public void onChanged(ObservableList 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 @@ Lizenz und Copyright Ausführung Sie verwenden die Wiimmfi Watcher Version %1$s aus. Sie können die Versionshinweise für diese Version hier]]> anzeigen. + Suchen von %1$s… \ 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 @@ 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 lista de tareas pendientes. 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 aquí. Si no sabe cómo usar GitHub, puede completar este formulario de Google. © Copyright 2021 Bryson Steck Wiimmfi Watcher está disponible bajo la Licencia Pública General de GNU Versión 3. Puede ver la licencia aquí.\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 <https://www.gnu.org/licenses/>. 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 steck.bryson@gmail.com o en Discord a bryzinga#9971. + Localizando %1$s… \ 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 @@ 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 à steck.bryson@gmail.com ou sur Discord à bryzinga#9971. Version Vous exécutez la version %1$s de Wiimmfi Watcher. Vous pouvez consulter les notes de publication de cette version ici.]]> + Localisation de %1$s… \ 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 @@ 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. Versione Stai eseguendo Wiimmfi Watcher versione %1$s. È possibile visualizzare le note di rilascio per questa versione qui.]]> + Individuazione %1$s… \ 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 @@ バグレポートやこのアプリ全般とは関係のない理由で私を捕まえたい場合は、電子メール(steck.bryson@gmail.com)またはDiscord(bryzinga#9971)で私に連絡できます。 バージョン Wiimmfi Watcherバージョン%1$sを実行しています。このバージョンのリリースノートはこちら]]>でご覧いただけます。 + %1$sの検索… \ 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 @@ 버그에 대해 말하면 버그를 찾았습니까? 앱에 대한 피드백을 제공 하시겠습니까? 나는 그것을 듣고 싶다! 먼저 발견 한 문제가 내 할 일 목록에 없는지 확인하십시오. 내가 이미 알고 있거나 작업 중일 수 있습니다. 문제가 할일 목록에서 해결되지 않은 경우 여기에서 내 GitHub 저장소에 문제를 생성 할 수 있습니다. GitHub 사용 방법을 모르는 경우 대신이 Google 양식을 작성할 수 있습니다. © Copyright 2021 Bryson Steck\n\nWiimmfi Watcher는 GNU General Public License 버전 3에 따라 사용할 수 있습니다. 여기에서 라이센스를 볼 수 있습니다.\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 <https://www.gnu.org/licenses/>. 일반적으로 버그 보고서 나이 앱과 관련이없는 이유로 저를 붙잡 으려면 steck.bryson@gmail.com으로 이메일을 보내거나 bryzinga#9971로 Discord를 통해 저에게 연락 할 수 있습니다. + %1$s 찾는 중… \ 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 @@ 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 lista de tarefas. É 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 aqui.. Se você não sabe como usar o GitHub, pode preencher este Formulário Google. © 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 aqui.\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 <https://www.gnu.org/licenses/>. 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 steck.bryson@gmail.com ou no Discord em bryzinga#9971. + Localizando %1$s… \ 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 @@ + + + + \ 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 @@ 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. 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. + Locating %1$s… \ No newline at end of file -- cgit v1.2.3