From 2783b9964f4eadefce21f4f6044089c21e993738 Mon Sep 17 00:00:00 2001 From: pxgamer Date: Mon, 28 Jan 2019 09:09:03 +0000 Subject: [PATCH 01/12] Fix typo with 'pref_alarmrssnew_info' value --- app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d737b584..55261817 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -251,7 +251,7 @@ Requires authentication Opens links in the webbrowser for user login New item notification - Nofity when new torrents are released + Notify when new torrents are released Exclude filter Don\'t show torrents whose name matches these |-separated words Include filter From 06718e6793f03552829f7996e05e553b52a46d5d Mon Sep 17 00:00:00 2001 From: pxgamer Date: Mon, 28 Jan 2019 09:15:39 +0000 Subject: [PATCH 02/12] Fix typo with 'pref_alarmnew_info' value --- app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 55261817..3c889f91 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -277,7 +277,7 @@ Finished notification Notify when a torrent finishes New torrent notification - Nofity when a torrent was added + Notify when a torrent was added Exclude filter Notify only if torrent name matches these |-separated words Include filter From b9a1980f754245d1ef3b9476552e34c5daa4b33e Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Tue, 23 Apr 2019 10:13:13 +0200 Subject: [PATCH 03/12] Removed donate link in Transdrone version to meet Play Store regulations --- app/src/lite/res/values/strings.xml | 4 ++-- .../transdroid/core/gui/settings/MainSettingsActivity.java | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/lite/res/values/strings.xml b/app/src/lite/res/values/strings.xml index d0af0753..36912a08 100644 --- a/app/src/lite/res/values/strings.xml +++ b/app/src/lite/res/values/strings.xml @@ -18,7 +18,7 @@ Transdrone - Donate via transdroid.org - https://transdroid.org + + diff --git a/app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java b/app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java index 4e66825f..7d803716 100644 --- a/app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java +++ b/app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java @@ -178,6 +178,7 @@ public class MainSettingsActivity extends PreferenceCompatActivity { boolean enableSearchUi = navigationHelper.enableSearchUi(); boolean enableRssUi = navigationHelper.enableRssUi(); + boolean enableDonateLink = !getString(R.string.donate_url).isEmpty(); // Load the preference menu and attach actions addPreferencesFromResource(R.xml.pref_main); @@ -191,7 +192,11 @@ public class MainSettingsActivity extends PreferenceCompatActivity { findPreference("header_background").setOnPreferenceClickListener(onBackgroundSettings); findPreference("header_system").setOnPreferenceClickListener(onSystemSettings); findPreference("header_help").setOnPreferenceClickListener(onHelpSettings); - findPreference("header_donate").setOnPreferenceClickListener(onDonate); + if (enableDonateLink) { + findPreference("header_donate").setOnPreferenceClickListener(onDonate); + } else { + getPreferenceScreen().removePreference(findPreference("header_donate")); + } // Keep a list of the server codes and names (for default server selection) List serverCodes = new ArrayList<>(); From 6832dd423b379f25c268542fa89a68cc5bf420af Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Tue, 23 Apr 2019 10:48:19 +0200 Subject: [PATCH 04/12] Removed donate link in Transdrone version to meet Play Store regulations --- app/src/main/res/values/changelog.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/res/values/changelog.xml b/app/src/main/res/values/changelog.xml index bcd3c667..b960bbed 100644 --- a/app/src/main/res/values/changelog.xml +++ b/app/src/main/res/values/changelog.xml @@ -17,6 +17,9 @@ --> +Transdroid 2.5.15\n +- Removed donate link in Transdrone\n +\n Transdroid 2.5.14\n - Fix crashes in the UI here and there\n - Fix notifications on Android 8+\n From f6e8de2b52abac5e9bd0102247025237c7534aeb Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Tue, 23 Apr 2019 17:46:23 +0200 Subject: [PATCH 05/12] Fixing UI crashes due to #391 #495 #484 #483... --- .../transdroid/core/gui/DetailsActivity.java | 11 +++++++---- .../transdroid/core/gui/DetailsFragment.java | 4 ++-- .../transdroid/core/gui/TorrentsActivity.java | 18 +++++++++--------- .../transdroid/core/gui/TorrentsFragment.java | 17 +++++++++++------ .../org/transdroid/daemon/DummyAdapter.java | 2 +- app/src/main/res/values/changelog.xml | 2 ++ 6 files changed, 32 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/org/transdroid/core/gui/DetailsActivity.java b/app/src/main/java/org/transdroid/core/gui/DetailsActivity.java index 84ede89c..8a0da758 100644 --- a/app/src/main/java/org/transdroid/core/gui/DetailsActivity.java +++ b/app/src/main/java/org/transdroid/core/gui/DetailsActivity.java @@ -170,6 +170,7 @@ public class DetailsActivity extends AppCompatActivity implements TorrentTasksEx @Background public void refreshTorrentDetails(Torrent torrent) { + if (currentConnection == null) return; if (!Daemon.supportsFineDetails(torrent.getDaemon())) { return; } @@ -183,6 +184,7 @@ public class DetailsActivity extends AppCompatActivity implements TorrentTasksEx @Background public void refreshTorrentFiles(Torrent torrent) { + if (currentConnection == null) return; if (!Daemon.supportsFileListing(torrent.getDaemon())) { return; } @@ -197,6 +199,7 @@ public class DetailsActivity extends AppCompatActivity implements TorrentTasksEx @Background @Override public void resumeTorrent(Torrent torrent) { + if (currentConnection == null) return; torrent.mimicResume(); DaemonTaskResult result = ResumeTask.create(currentConnection, torrent).execute(log); if (result instanceof DaemonTaskSuccessResult) { @@ -333,14 +336,14 @@ public class DetailsActivity extends AppCompatActivity implements TorrentTasksEx @UiThread protected void onTorrentDetailsRetrieved(Torrent torrent, TorrentDetails torrentDetails) { // Update the details fragment with the new fine details for the shown torrent - if (fragmentDetails.isAdded()) + if (fragmentDetails.isResumed()) fragmentDetails.updateTorrentDetails(torrent, torrentDetails); } @UiThread protected void onTorrentFilesRetrieved(Torrent torrent, List torrentFiles) { // Update the details fragment with the newly retrieved list of files - if (fragmentDetails.isAdded()) + if (fragmentDetails.isResumed()) fragmentDetails.updateTorrentFiles(torrent, new ArrayList<>(torrentFiles)); } @@ -348,7 +351,7 @@ public class DetailsActivity extends AppCompatActivity implements TorrentTasksEx protected void onCommunicationError(DaemonTaskFailureResult result, boolean isCritical) { log.i(this, result.getException().toString()); String error = getString(LocalTorrent.getResourceForDaemonException(result.getException())); - if (fragmentDetails.isAdded()) + if (fragmentDetails.isResumed()) fragmentDetails.updateIsLoading(false, isCritical ? error : null); SnackbarManager.show(Snackbar.with(this).text(getString(LocalTorrent.getResourceForDaemonException(result.getException()))) .colorResource(R.color.red)); @@ -357,7 +360,7 @@ public class DetailsActivity extends AppCompatActivity implements TorrentTasksEx @UiThread protected void onTorrentsRetrieved(List torrents, List labels) { // Update the details fragment accordingly - if (fragmentDetails.isAdded()) { + if (fragmentDetails.isResumed()) { fragmentDetails.updateIsLoading(false, null); fragmentDetails.perhapsUpdateTorrent(torrents); fragmentDetails.updateLabels(Label.convertToNavigationLabels(labels, getResources().getString(R.string.labels_unlabeled))); diff --git a/app/src/main/java/org/transdroid/core/gui/DetailsFragment.java b/app/src/main/java/org/transdroid/core/gui/DetailsFragment.java index 456e297e..79843c00 100644 --- a/app/src/main/java/org/transdroid/core/gui/DetailsFragment.java +++ b/app/src/main/java/org/transdroid/core/gui/DetailsFragment.java @@ -150,10 +150,10 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen if (torrent != null) { updateTorrent(torrent); } - if (torrentDetails != null) { + if (torrent != null && torrentDetails != null) { updateTorrentDetails(torrent, torrentDetails); } - if (torrentFiles != null) { + if (torrent != null && torrentFiles != null) { updateTorrentFiles(torrent, torrentFiles); } diff --git a/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java b/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java index df0627af..2956cf2b 100644 --- a/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java +++ b/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java @@ -566,7 +566,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE // Clear the currently shown list of torrents and perhaps the details fragmentTorrents.clear(true, true); - if (fragmentDetails != null && fragmentDetails.isAdded() && fragmentDetails.getActivity() != null) { + if (fragmentDetails != null && fragmentDetails.isResumed() && fragmentDetails.getActivity() != null) { fragmentDetails.updateIsLoading(false, null); fragmentDetails.clear(); fragmentDetails.setCurrentServerSettings(server); @@ -586,7 +586,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE // Remember that the user last selected this applicationSettings.setLastUsedNavigationFilter(currentFilter); // Clear the details view - if (fragmentDetails != null && fragmentDetails.isAdded()) { + if (fragmentDetails != null && fragmentDetails.isResumed()) { fragmentDetails.updateIsLoading(false, null); fragmentDetails.clear(); } @@ -599,7 +599,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE * @param hasServerSettings Whether there are server settings available, so we can continue to connect */ private void updateFragmentVisibility(boolean hasServerSettings) { - if (fragmentDetails != null && fragmentDetails.isAdded()) { + if (fragmentDetails != null && fragmentDetails.isResumed()) { if (hasServerSettings) { getFragmentManager().beginTransaction().show(fragmentDetails).commit(); } else { @@ -905,7 +905,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE * @param torrent The torrent to show detailed statistics for */ public void openDetails(Torrent torrent) { - if (fragmentDetails != null && fragmentDetails.isAdded()) { + if (fragmentDetails != null && fragmentDetails.isResumed()) { fragmentDetails.updateTorrent(torrent); } else { DetailsActivity_.intent(this).torrent(torrent).currentLabels(lastNavigationLabels).startForResult(RESULT_DETAILS); @@ -1296,7 +1296,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE fragmentTorrents.updateIsLoading(false); if (isCritical) { fragmentTorrents.updateError(error); - if (fragmentDetails != null && fragmentDetails.isAdded()) { + if (fragmentDetails != null && fragmentDetails.isResumed()) { fragmentDetails.updateIsLoading(false, error); } } @@ -1312,13 +1312,13 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE fragmentTorrents.updateTorrents(new ArrayList<>(torrents), lastNavigationLabels); // Update the details fragment if the currently shown torrent is in the newly retrieved list - if (fragmentDetails != null && fragmentDetails.isAdded()) { + if (fragmentDetails != null && fragmentDetails.isResumed()) { fragmentDetails.perhapsUpdateTorrent(torrents); } // Update local list of labels in the navigation navigationListAdapter.updateLabels(lastNavigationLabels); - if (fragmentDetails != null && fragmentDetails.isAdded()) { + if (fragmentDetails != null && fragmentDetails.isResumed()) { fragmentDetails.updateLabels(lastNavigationLabels); } @@ -1347,7 +1347,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE @UiThread protected void onTorrentDetailsRetrieved(Torrent torrent, TorrentDetails torrentDetails) { // Update the details fragment with the new fine details for the shown torrent - if (fragmentDetails != null && fragmentDetails.isAdded()) { + if (fragmentDetails != null && fragmentDetails.isResumed()) { fragmentDetails.updateTorrentDetails(torrent, torrentDetails); } } @@ -1355,7 +1355,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE @UiThread protected void onTorrentFilesRetrieved(Torrent torrent, List torrentFiles) { // Update the details fragment with the newly retrieved list of files - if (fragmentDetails != null && fragmentDetails.isAdded()) { + if (fragmentDetails != null && fragmentDetails.isResumed()) { fragmentDetails.updateTorrentFiles(torrent, new ArrayList<>(torrentFiles)); } } diff --git a/app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java b/app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java index 7b2c48a5..fd9257a7 100644 --- a/app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java +++ b/app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java @@ -74,8 +74,8 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener protected ApplicationSettings applicationSettings; @Bean protected SystemSettings systemSettings; - @InstanceState - protected ArrayList torrents = null; + // HACK Working around #391 while hopefully we rework the UI in the future to persist the list in db or something + protected static ArrayList torrents = null; @InstanceState protected ArrayList lastMultiSelectedTorrents; @InstanceState @@ -144,7 +144,8 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener * @param newTorrents The new, updated list of torrents */ public void updateTorrents(ArrayList newTorrents, ArrayList