Browse Source

Adjust codestyle to an .editorconfig

pull/559/head
TacoTheDank 4 years ago
parent
commit
8204bd56a7
  1. 9
      .editorconfig
  2. 9
      app/src/main/AndroidManifest.xml
  3. 3
      app/src/main/java/androidx/preference/PreferenceManagerBinder.java
  4. 4
      app/src/main/java/org/transdroid/core/app/search/SearchHelper.java
  5. 1
      app/src/main/java/org/transdroid/core/app/search/SearchResult.java
  6. 1
      app/src/main/java/org/transdroid/core/app/search/SearchSite.java
  7. 40
      app/src/main/java/org/transdroid/core/app/settings/ApplicationSettings.java
  8. 8
      app/src/main/java/org/transdroid/core/app/settings/NotificationSettings.java
  9. 4
      app/src/main/java/org/transdroid/core/app/settings/RssfeedSetting.java
  10. 6
      app/src/main/java/org/transdroid/core/app/settings/ServerSetting.java
  11. 5
      app/src/main/java/org/transdroid/core/app/settings/SettingsPersistence.java
  12. 1
      app/src/main/java/org/transdroid/core/app/settings/SettingsUtils.java
  13. 4
      app/src/main/java/org/transdroid/core/app/settings/SystemSettings.java
  14. 2
      app/src/main/java/org/transdroid/core/app/settings/WebsearchSetting.java
  15. 2
      app/src/main/java/org/transdroid/core/gui/DetailsActivity.java
  16. 10
      app/src/main/java/org/transdroid/core/gui/DetailsFragment.java
  17. 2
      app/src/main/java/org/transdroid/core/gui/ServerPickerDialog.java
  18. 2
      app/src/main/java/org/transdroid/core/gui/ServerSelectionView.java
  19. 1
      app/src/main/java/org/transdroid/core/gui/ServerStatusView.java
  20. 1
      app/src/main/java/org/transdroid/core/gui/TorrentTasksExecutor.java
  21. 7
      app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
  22. 12
      app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java
  23. 3
      app/src/main/java/org/transdroid/core/gui/TransdroidApp.java
  24. 6
      app/src/main/java/org/transdroid/core/gui/lists/DetailsAdapter.java
  25. 9
      app/src/main/java/org/transdroid/core/gui/lists/LocalTorrent.java
  26. 8
      app/src/main/java/org/transdroid/core/gui/lists/MergeAdapter.java
  27. 3
      app/src/main/java/org/transdroid/core/gui/lists/PiecesMapView.java
  28. 1
      app/src/main/java/org/transdroid/core/gui/lists/SimpleListItem.java
  29. 3
      app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemAdapter.java
  30. 2
      app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemSpinnerAdapter.java
  31. 1
      app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemView.java
  32. 3
      app/src/main/java/org/transdroid/core/gui/lists/SortByListItem.java
  33. 2
      app/src/main/java/org/transdroid/core/gui/lists/TorrentDetailsView.java
  34. 1
      app/src/main/java/org/transdroid/core/gui/lists/TorrentFilePriorityLayout.java
  35. 1
      app/src/main/java/org/transdroid/core/gui/lists/TorrentFileView.java
  36. 2
      app/src/main/java/org/transdroid/core/gui/lists/TorrentStatusLayout.java
  37. 1
      app/src/main/java/org/transdroid/core/gui/lists/TorrentView.java
  38. 2
      app/src/main/java/org/transdroid/core/gui/lists/TorrentsAdapter.java
  39. 4
      app/src/main/java/org/transdroid/core/gui/lists/ViewHolderAdapter.java
  40. 3
      app/src/main/java/org/transdroid/core/gui/log/DatabaseHelper.java
  41. 1
      app/src/main/java/org/transdroid/core/gui/log/ErrorLogEntry.java
  42. 1
      app/src/main/java/org/transdroid/core/gui/log/Log.java
  43. 4
      app/src/main/java/org/transdroid/core/gui/navigation/DialogHelper.java
  44. 4
      app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java
  45. 1
      app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemAdapter.java
  46. 1
      app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemView.java
  47. 2
      app/src/main/java/org/transdroid/core/gui/navigation/FilterSeparatorView.java
  48. 3
      app/src/main/java/org/transdroid/core/gui/navigation/Label.java
  49. 4
      app/src/main/java/org/transdroid/core/gui/navigation/NavigationFilter.java
  50. 12
      app/src/main/java/org/transdroid/core/gui/navigation/NavigationHelper.java
  51. 1
      app/src/main/java/org/transdroid/core/gui/navigation/RefreshableActivity.java
  52. 3
      app/src/main/java/org/transdroid/core/gui/navigation/SelectionManagerMode.java
  53. 6
      app/src/main/java/org/transdroid/core/gui/navigation/SelectionModificationSpinner.java
  54. 1
      app/src/main/java/org/transdroid/core/gui/navigation/SetLabelDialog.java
  55. 1
      app/src/main/java/org/transdroid/core/gui/navigation/SetStorageLocationDialog.java
  56. 1
      app/src/main/java/org/transdroid/core/gui/navigation/SetTrackersDialog.java
  57. 1
      app/src/main/java/org/transdroid/core/gui/navigation/SetTransferRatesDialog.java
  58. 5
      app/src/main/java/org/transdroid/core/gui/navigation/StatusType.java
  59. 5
      app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssFragment.java
  60. 1
      app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssItemView.java
  61. 3
      app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssItemsAdapter.java
  62. 16
      app/src/main/java/org/transdroid/core/gui/rss/RssFeedsActivity.java
  63. 2
      app/src/main/java/org/transdroid/core/gui/rss/RssFeedsFragment.java
  64. 1
      app/src/main/java/org/transdroid/core/gui/rss/RssItemsActivity.java
  65. 4
      app/src/main/java/org/transdroid/core/gui/rss/RssItemsFragment.java
  66. 1
      app/src/main/java/org/transdroid/core/gui/rss/RssfeedLoader.java
  67. 1
      app/src/main/java/org/transdroid/core/gui/rss/RssfeedView.java
  68. 2
      app/src/main/java/org/transdroid/core/gui/rss/RssfeedsAdapter.java
  69. 1
      app/src/main/java/org/transdroid/core/gui/rss/RssitemStatusLayout.java
  70. 1
      app/src/main/java/org/transdroid/core/gui/rss/RssitemView.java
  71. 2
      app/src/main/java/org/transdroid/core/gui/rss/RssitemsAdapter.java
  72. 2
      app/src/main/java/org/transdroid/core/gui/search/BarcodeHelper.java
  73. 1
      app/src/main/java/org/transdroid/core/gui/search/FilePickerHelper.java
  74. 4
      app/src/main/java/org/transdroid/core/gui/search/SearchActivity.java
  75. 1
      app/src/main/java/org/transdroid/core/gui/search/SearchHistoryProvider.java
  76. 1
      app/src/main/java/org/transdroid/core/gui/search/SearchResultView.java
  77. 2
      app/src/main/java/org/transdroid/core/gui/search/SearchResultsAdapter.java
  78. 3
      app/src/main/java/org/transdroid/core/gui/search/SearchResultsFragment.java
  79. 2
      app/src/main/java/org/transdroid/core/gui/search/SearchSetting.java
  80. 1
      app/src/main/java/org/transdroid/core/gui/search/SearchSettingSelectionView.java
  81. 1
      app/src/main/java/org/transdroid/core/gui/search/SearchSettingsDropDownAdapter.java
  82. 1
      app/src/main/java/org/transdroid/core/gui/search/SearchSiteView.java
  83. 2
      app/src/main/java/org/transdroid/core/gui/search/SearchSitesAdapter.java
  84. 2
      app/src/main/java/org/transdroid/core/gui/search/SendIntentHelper.java
  85. 1
      app/src/main/java/org/transdroid/core/gui/search/UrlEntryDialog.java
  86. 1
      app/src/main/java/org/transdroid/core/gui/settings/AboutDialog.java
  87. 1
      app/src/main/java/org/transdroid/core/gui/settings/ChangelogDialog.java
  88. 10
      app/src/main/java/org/transdroid/core/gui/settings/KeyBoundPreferencesActivity.java
  89. 2
      app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java
  90. 3
      app/src/main/java/org/transdroid/core/gui/settings/RssfeedPreference.java
  91. 1
      app/src/main/java/org/transdroid/core/gui/settings/RssfeedSettingsActivity.java
  92. 3
      app/src/main/java/org/transdroid/core/gui/settings/ServerPreference.java
  93. 1
      app/src/main/java/org/transdroid/core/gui/settings/ServerSettingsActivity.java
  94. 3
      app/src/main/java/org/transdroid/core/gui/settings/WebsearchPreference.java
  95. 1
      app/src/main/java/org/transdroid/core/gui/settings/WebsearchSettingsActivity.java
  96. 2
      app/src/main/java/org/transdroid/core/rssparser/Item.java
  97. 5
      app/src/main/java/org/transdroid/core/rssparser/RssParser.java
  98. 1
      app/src/main/java/org/transdroid/core/seedbox/DediseedboxSettings.java
  99. 1
      app/src/main/java/org/transdroid/core/seedbox/DediseedboxSettingsActivity.java
  100. 5
      app/src/main/java/org/transdroid/core/seedbox/SeedboxPreference.java
  101. Some files were not shown because too many files have changed in this diff Show More

9
.editorconfig

@ -0,0 +1,9 @@
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

9
app/src/main/AndroidManifest.xml

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?><!--
<!--
Copyright 2010-2018 Eric Kok et al. Copyright 2010-2018 Eric Kok et al.
Transdroid is free software: you can redistribute it and/or modify Transdroid is free software: you can redistribute it and/or modify
@ -193,8 +192,7 @@
<activity <activity
android:name="org.transdroid.core.gui.DetailsActivity_" android:name="org.transdroid.core.gui.DetailsActivity_"
android:theme="@style/TransdroidTheme" android:theme="@style/TransdroidTheme"
android:uiOptions="splitActionBarWhenNarrow" > android:uiOptions="splitActionBarWhenNarrow"></activity>
</activity>
<!-- Settings screens --> <!-- Settings screens -->
<activity <activity
@ -318,8 +316,7 @@
android:exported="false" android:exported="false"
android:permission="android.permission.BIND_REMOTEVIEWS" /> android:permission="android.permission.BIND_REMOTEVIEWS" />
<receiver <receiver android:name="org.transdroid.core.widget.ListWidgetProvider_">
android:name="org.transdroid.core.widget.ListWidgetProvider_">
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter> </intent-filter>

3
app/src/main/java/androidx/preference/PreferenceManagerBinder.java

@ -5,7 +5,8 @@ package androidx.preference;
* around the protected visibility of {@link Preference#onAttachedToHierarchy(PreferenceManager)}. * around the protected visibility of {@link Preference#onAttachedToHierarchy(PreferenceManager)}.
*/ */
public class PreferenceManagerBinder { public class PreferenceManagerBinder {
private PreferenceManagerBinder() {} private PreferenceManagerBinder() {
}
public static void bind(Preference pref, PreferenceManager manager) { public static void bind(Preference pref, PreferenceManager manager) {
pref.onAttachedToHierarchy(manager); pref.onAttachedToHierarchy(manager);

4
app/src/main/java/org/transdroid/core/app/search/SearchHelper.java

@ -59,6 +59,7 @@ public class SearchHelper {
/** /**
* Return whether the Torrent Search package is installed and available to query against * Return whether the Torrent Search package is installed and available to query against
*
* @return True if the available sites can be retrieved from the content provider, false otherwise * @return True if the available sites can be retrieved from the content provider, false otherwise
*/ */
public boolean isTorrentSearchInstalled() { public boolean isTorrentSearchInstalled() {
@ -67,6 +68,7 @@ public class SearchHelper {
/** /**
* Queries the Torrent Search package for all available in-app search sites. This method is synchronous. * Queries the Torrent Search package for all available in-app search sites. This method is synchronous.
*
* @return A list of available search sites as POJOs, or null if the Torrent Search package is not installed * @return A list of available search sites as POJOs, or null if the Torrent Search package is not installed
*/ */
public List<SearchSite> getAvailableSites() { public List<SearchSite> getAvailableSites() {
@ -103,6 +105,7 @@ public class SearchHelper {
/** /**
* Queries the Torrent Search module to search for torrents on the web. This method is synchronous and should always * Queries the Torrent Search module to search for torrents on the web. This method is synchronous and should always
* be called in a background thread. * be called in a background thread.
*
* @param query The search query to pass to the torrent site * @param query The search query to pass to the torrent site
* @param site The site to search, as retrieved from the TorrentSitesProvider, or null if the Torrent Search package * @param site The site to search, as retrieved from the TorrentSitesProvider, or null if the Torrent Search package
* @param sortBy The sort order to request from the torrent site, if supported * @param sortBy The sort order to request from the torrent site, if supported
@ -148,6 +151,7 @@ public class SearchHelper {
* Asks the Torrent Search module to download a torrent file given the provided url, while using the specifics of * Asks the Torrent Search module to download a torrent file given the provided url, while using the specifics of
* the supplied torrent search site to do so. This way the Search Module can take care of user credentials, for * the supplied torrent search site to do so. This way the Search Module can take care of user credentials, for
* example. * example.
*
* @param site The unique key of the search site that this url belongs to, which is used to create a connection * @param site The unique key of the search site that this url belongs to, which is used to create a connection
* specific to this (private) site * specific to this (private) site
* @param url The full url of the torrent to download * @param url The full url of the torrent to download

1
app/src/main/java/org/transdroid/core/app/search/SearchResult.java

@ -23,6 +23,7 @@ import android.os.Parcelable;
/** /**
* Represents a search result as retrieved by querying the Torrent Search package. * Represents a search result as retrieved by querying the Torrent Search package.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class SearchResult implements Parcelable { public class SearchResult implements Parcelable {

1
app/src/main/java/org/transdroid/core/app/search/SearchSite.java

@ -21,6 +21,7 @@ import org.transdroid.core.gui.search.SearchSetting;
/** /**
* Represents an available torrent site that can be searched using the Torrent Search package. * Represents an available torrent site that can be searched using the Torrent Search package.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class SearchSite implements SimpleListItem, SearchSetting { public class SearchSite implements SimpleListItem, SearchSetting {

40
app/src/main/java/org/transdroid/core/app/settings/ApplicationSettings.java

@ -49,6 +49,7 @@ import java.util.List;
/** /**
* Singleton object to access all application settings, including stored servers, web search sites and RSS feeds. * Singleton object to access all application settings, including stored servers, web search sites and RSS feeds.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EBean(scope = Scope.Singleton) @EBean(scope = Scope.Singleton)
@ -69,6 +70,7 @@ public class ApplicationSettings {
/** /**
* Returns all available user-configured normal and seed servers * Returns all available user-configured normal and seed servers
*
* @return A list of all stored server settings objects * @return A list of all stored server settings objects
*/ */
public List<ServerSetting> getAllServerSettings() { public List<ServerSetting> getAllServerSettings() {
@ -82,6 +84,7 @@ public class ApplicationSettings {
/** /**
* Returns the order number/identifying key of the last server, normal or seedbox configured * Returns the order number/identifying key of the last server, normal or seedbox configured
*
* @return The zero-based order number (index) of the last stored server settings * @return The zero-based order number (index) of the last stored server settings
*/ */
public int getMaxOfAllServers() { public int getMaxOfAllServers() {
@ -95,6 +98,7 @@ public class ApplicationSettings {
/** /**
* Returns the server settings for either a normal or a seedbox server as the user configured. WARNING: This method * Returns the server settings for either a normal or a seedbox server as the user configured. WARNING: This method
* does not check if the settings actually exist and may reply on empty default if called for a non-existing server. * does not check if the settings actually exist and may reply on empty default if called for a non-existing server.
*
* @param order The order number/identifying key of the server's settings to retrieve, where the normal servers are * @param order The order number/identifying key of the server's settings to retrieve, where the normal servers are
* first and the seedboxes are numbers thereafter onwards * first and the seedboxes are numbers thereafter onwards
* @return The server settings object, loaded from shared preferences * @return The server settings object, loaded from shared preferences
@ -116,6 +120,7 @@ public class ApplicationSettings {
/** /**
* Returns all available normal, user-configured servers (so no seedbox settings) * Returns all available normal, user-configured servers (so no seedbox settings)
*
* @return A list of all stored server settings objects * @return A list of all stored server settings objects
*/ */
public List<ServerSetting> getNormalServerSettings() { public List<ServerSetting> getNormalServerSettings() {
@ -128,6 +133,7 @@ public class ApplicationSettings {
/** /**
* Returns the order number/identifying key of the last normal server * Returns the order number/identifying key of the last normal server
*
* @return The zero-based order number (index) of the last stored normal server settings * @return The zero-based order number (index) of the last stored normal server settings
*/ */
public int getMaxNormalServer() { public int getMaxNormalServer() {
@ -140,6 +146,7 @@ public class ApplicationSettings {
/** /**
* Returns the user-specified server settings for a normal (non-seedbox) server. WARNING: This method does not check * Returns the user-specified server settings for a normal (non-seedbox) server. WARNING: This method does not check
* if the settings actually exist and may rely on empty defaults if called for a non-existing server. * if the settings actually exist and may rely on empty defaults if called for a non-existing server.
*
* @param order The order number/identifying key of the normal server's settings to retrieve * @param order The order number/identifying key of the normal server's settings to retrieve
* @return The server settings object, loaded from shared preferences * @return The server settings object, loaded from shared preferences
*/ */
@ -198,6 +205,7 @@ public class ApplicationSettings {
/** /**
* Removes all settings related to a configured server. Since servers are ordered, the order of the remaining * Removes all settings related to a configured server. Since servers are ordered, the order of the remaining
* servers will be updated accordingly. * servers will be updated accordingly.
*
* @param order The identifying order number/key of the settings to remove * @param order The identifying order number/key of the settings to remove
*/ */
public void removeNormalServerSettings(int order) { public void removeNormalServerSettings(int order) {
@ -275,6 +283,7 @@ public class ApplicationSettings {
* specific default server was selected, the last used server settings. As opposed to getDefaultServerKey(int), this * specific default server was selected, the last used server settings. As opposed to getDefaultServerKey(int), this
* method checks whether the particular server still exists (and returns the first server if not). If no servers are * method checks whether the particular server still exists (and returns the first server if not). If no servers are
* configured, null is returned. * configured, null is returned.
*
* @return A server settings object of the server to use by default, or null if no server is yet configured * @return A server settings object of the server to use by default, or null if no server is yet configured
*/ */
public ServerSetting getDefaultServer() { public ServerSetting getDefaultServer() {
@ -302,6 +311,7 @@ public class ApplicationSettings {
* Returns the unique key of the server setting that the user selected as their default server, or code indicating * Returns the unique key of the server setting that the user selected as their default server, or code indicating
* that the last used server should be selected by default; use with getDefaultServer directly. WARNING: the * that the last used server should be selected by default; use with getDefaultServer directly. WARNING: the
* returned string may no longer refer to a known server setting key. * returned string may no longer refer to a known server setting key.
*
* @return An integer; if it is 0 or higher it represents the unique key of a configured server setting, -2 means * @return An integer; if it is 0 or higher it represents the unique key of a configured server setting, -2 means
* the last used server should be selected as default instead and -1 means the last used server should be * the last used server should be selected as default instead and -1 means the last used server should be
* selected by default for viewing yet it should always ask when adding a new torrent * selected by default for viewing yet it should always ask when adding a new torrent
@ -320,6 +330,7 @@ public class ApplicationSettings {
* Returns the settings of the server that was last used by the user. As opposed to getLastUsedServerKey(int), this * Returns the settings of the server that was last used by the user. As opposed to getLastUsedServerKey(int), this
* method checks whether a server was already registered as being last used and check whether the server still * method checks whether a server was already registered as being last used and check whether the server still
* exists. It returns the first server if that fails. If no servers are configured, null is returned. * exists. It returns the first server if that fails. If no servers are configured, null is returned.
*
* @return A server settings object of the last used server (or, if not known, the first server), or null if no * @return A server settings object of the last used server (or, if not known, the first server), or null if no
* servers exist * servers exist
*/ */
@ -341,6 +352,7 @@ public class ApplicationSettings {
* Returns the order number/unique key of the server that the used last used; use with getServerSettings(int) or * Returns the order number/unique key of the server that the used last used; use with getServerSettings(int) or
* call getLastUsedServer directly. WARNING: the returned integer may no longer refer to a known server settings * call getLastUsedServer directly. WARNING: the returned integer may no longer refer to a known server settings
* object: check the bounds. * object: check the bounds.
*
* @return An integer indicating the order number/key or the last used server, or -1 if it was not set * @return An integer indicating the order number/key or the last used server, or -1 if it was not set
*/ */
public int getLastUsedServerKey() { public int getLastUsedServerKey() {
@ -349,6 +361,7 @@ public class ApplicationSettings {
/** /**
* Registers some server as being the last used by the user * Registers some server as being the last used by the user
*
* @param server The settings of the server that the user last used * @param server The settings of the server that the user last used
*/ */
public void setLastUsedServer(ServerSetting server) { public void setLastUsedServer(ServerSetting server) {
@ -357,6 +370,7 @@ public class ApplicationSettings {
/** /**
* Registers the order number/unique key of some server as being last used by the user * Registers the order number/unique key of some server as being last used by the user
*
* @param order The key identifying the specific server * @param order The key identifying the specific server
*/ */
public void setLastUsedServerKey(int order) { public void setLastUsedServerKey(int order) {
@ -366,6 +380,7 @@ public class ApplicationSettings {
/** /**
* Returns the unique code that (should) uniquely identify a navigation filter, such as a label, in the list of all * Returns the unique code that (should) uniquely identify a navigation filter, such as a label, in the list of all
* available filters * available filters
*
* @return A code that the last used navigation filter reported as uniquely identifying itself, or null if no last * @return A code that the last used navigation filter reported as uniquely identifying itself, or null if no last
* used filter is known * used filter is known
*/ */
@ -375,6 +390,7 @@ public class ApplicationSettings {
/** /**
* Registers some navigation filter as being the last used by the user * Registers some navigation filter as being the last used by the user
*
* @param filter The navigation filter that the user last used in the interface * @param filter The navigation filter that the user last used in the interface
*/ */
public void setLastUsedNavigationFilter(NavigationFilter filter) { public void setLastUsedNavigationFilter(NavigationFilter filter) {
@ -383,6 +399,7 @@ public class ApplicationSettings {
/** /**
* Returns all available user-configured web-based (as opped to in-app) search sites * Returns all available user-configured web-based (as opped to in-app) search sites
*
* @return A list of all stored web search site settings objects * @return A list of all stored web search site settings objects
*/ */
public List<WebsearchSetting> getWebsearchSettings() { public List<WebsearchSetting> getWebsearchSettings() {
@ -395,6 +412,7 @@ public class ApplicationSettings {
/** /**
* Returns the order number/identifying key of the last web search site * Returns the order number/identifying key of the last web search site
*
* @return The zero-based order number (index) of the last stored web search site * @return The zero-based order number (index) of the last stored web search site
*/ */
public int getMaxWebsearch() { public int getMaxWebsearch() {
@ -406,6 +424,7 @@ public class ApplicationSettings {
/** /**
* Returns the user-specified web-based search site setting for a specific site * Returns the user-specified web-based search site setting for a specific site
*
* @param order The order number/identifying key of the settings to retrieve * @param order The order number/identifying key of the settings to retrieve
* @return The web search site settings object, loaded from shared preferences * @return The web search site settings object, loaded from shared preferences
*/ */
@ -421,6 +440,7 @@ public class ApplicationSettings {
/** /**
* Removes all settings related to a configured web-based search site. Since sites are ordered, the order of the * Removes all settings related to a configured web-based search site. Since sites are ordered, the order of the
* remaining sites will be updated accordingly. * remaining sites will be updated accordingly.
*
* @param order The identifying order number/key of the settings to remove * @param order The identifying order number/key of the settings to remove
*/ */
public void removeWebsearchSettings(int order) { public void removeWebsearchSettings(int order) {
@ -446,6 +466,7 @@ public class ApplicationSettings {
/** /**
* Returns all available user-configured RSS feeds * Returns all available user-configured RSS feeds
*
* @return A list of all stored RSS feed settings objects * @return A list of all stored RSS feed settings objects
*/ */
public List<RssfeedSetting> getRssfeedSettings() { public List<RssfeedSetting> getRssfeedSettings() {
@ -458,6 +479,7 @@ public class ApplicationSettings {
/** /**
* Returns the order number/identifying key of the last stored RSS feed * Returns the order number/identifying key of the last stored RSS feed
*
* @return The zero-based order number (index) of the last stored RSS feed * @return The zero-based order number (index) of the last stored RSS feed
*/ */
public int getMaxRssfeed() { public int getMaxRssfeed() {
@ -469,6 +491,7 @@ public class ApplicationSettings {
/** /**
* Returns the user-specified RSS feed setting for a specific feed * Returns the user-specified RSS feed setting for a specific feed
*
* @param order The order number/identifying key of the settings to retrieve * @param order The order number/identifying key of the settings to retrieve
* @return The RSS feed settings object, loaded from shared preferences * @return The RSS feed settings object, loaded from shared preferences
*/ */
@ -490,6 +513,7 @@ public class ApplicationSettings {
/** /**
* Removes all settings related to a configured RSS feed. Since feeds are ordered, the order of the remaining feeds * Removes all settings related to a configured RSS feed. Since feeds are ordered, the order of the remaining feeds
* will be updated accordingly. * will be updated accordingly.
*
* @param order The identifying order number/key of the settings to remove * @param order The identifying order number/key of the settings to remove
*/ */
public void removeRssfeedSettings(int order) { public void removeRssfeedSettings(int order) {
@ -528,6 +552,7 @@ public class ApplicationSettings {
* the user. This is used to determine which items in an RSS feed are 'new'. Warning: any previously retrieved * the user. This is used to determine which items in an RSS feed are 'new'. Warning: any previously retrieved
* {@link RssfeedSetting} object is now no longer in sync, as this will not automatically be updated in the object. * {@link RssfeedSetting} object is now no longer in sync, as this will not automatically be updated in the object.
* Use {@link #getRssfeedSetting(int)} to get fresh data. * Use {@link #getRssfeedSetting(int)} to get fresh data.
*
* @param order The identifying order number/key of the settings of te RSS feed that was viewed * @param order The identifying order number/key of the settings of te RSS feed that was viewed
* @param lastViewed The date and time that the feed was last viewed; typically now * @param lastViewed The date and time that the feed was last viewed; typically now
* @param lastViewedItemUrl The url of the last item the last time that the feed was viewed * @param lastViewedItemUrl The url of the last item the last time that the feed was viewed
@ -543,6 +568,7 @@ public class ApplicationSettings {
/** /**
* Registers the torrents list sort order as being last used by the user * Registers the torrents list sort order as being last used by the user
*
* @param currentSortOrder The sort order property the user selected last * @param currentSortOrder The sort order property the user selected last
* @param currentSortAscending The sort order direction that was last used * @param currentSortAscending The sort order direction that was last used
*/ */
@ -556,6 +582,7 @@ public class ApplicationSettings {
/** /**
* Returns the sort order property that the user last used. Use together with {@link #getLastUsedSortDescending()} * Returns the sort order property that the user last used. Use together with {@link #getLastUsedSortDescending()}
* to get the full last used sort settings. * to get the full last used sort settings.
*
* @return The last used sort order enumeration value * @return The last used sort order enumeration value
*/ */
public TorrentsSortBy getLastUsedSortOrder() { public TorrentsSortBy getLastUsedSortOrder() {
@ -565,6 +592,7 @@ public class ApplicationSettings {
/** /**
* Registers the search list sort order as being last used by the user * Registers the search list sort order as being last used by the user
*
* @param currentSortOrder The sort order property the user selected last * @param currentSortOrder The sort order property the user selected last
*/ */
public void setLastUsedSearchSortOrder(SearchSortOrder currentSortOrder) { public void setLastUsedSearchSortOrder(SearchSortOrder currentSortOrder) {
@ -575,6 +603,7 @@ public class ApplicationSettings {
/** /**
* Returns the search sort order property that the user last used. * Returns the search sort order property that the user last used.
*
* @return The last used sort order enumeration value * @return The last used sort order enumeration value
*/ */
public SearchSortOrder getLastUsedSearchSortOrder() { public SearchSortOrder getLastUsedSearchSortOrder() {
@ -584,6 +613,7 @@ public class ApplicationSettings {
/** /**
* Returns the sort order direction that the user last used. Use together with {@link #getLastUsedSortOrder()} to * Returns the sort order direction that the user last used. Use together with {@link #getLastUsedSortOrder()} to
* get the full last used sort settings. * get the full last used sort settings.
*
* @return True if the last used sort direction was descending, false otherwise (i.e. the default ascending * @return True if the last used sort direction was descending, false otherwise (i.e. the default ascending
* direction) * direction)
*/ */
@ -593,6 +623,7 @@ public class ApplicationSettings {
/** /**
* Returns the list of all available in-app search sites as well as all web searches that the user configured. * Returns the list of all available in-app search sites as well as all web searches that the user configured.
*
* @return A list of search settings, all of which are either a {@link SearchSite} or {@link WebsearchSetting} * @return A list of search settings, all of which are either a {@link SearchSite} or {@link WebsearchSetting}
*/ */
public List<SearchSetting> getSearchSettings() { public List<SearchSetting> getSearchSettings() {
@ -607,6 +638,7 @@ public class ApplicationSettings {
* site in the main settings. As opposed to getLastUsedSearchSiteKey(int), this method checks whether a site was * site in the main settings. As opposed to getLastUsedSearchSiteKey(int), this method checks whether a site was
* already registered as being last used (or set as default) and checks whether the site still exists. It returns * already registered as being last used (or set as default) and checks whether the site still exists. It returns
* the first in-app search site if that fails. * the first in-app search site if that fails.
*
* @return A site settings object of the last used server (or, if not known, the first server), or null if no * @return A site settings object of the last used server (or, if not known, the first server), or null if no
* servers exist * servers exist
*/ */
@ -658,6 +690,7 @@ public class ApplicationSettings {
* Returns the unique key of the site that the used last used or selected as default form the main settings; use * Returns the unique key of the site that the used last used or selected as default form the main settings; use
* with getLastUsedSearchSite directly. WARNING: the returned string may no longer refer to a known web search site * with getLastUsedSearchSite directly. WARNING: the returned string may no longer refer to a known web search site
* or in-app search settings object. * or in-app search settings object.
*
* @return A string indicating the key of the last used search site, or null if no site was yet used or set as * @return A string indicating the key of the last used search site, or null if no site was yet used or set as
* default * default
*/ */
@ -667,6 +700,7 @@ public class ApplicationSettings {
/** /**
* Registers the unique key of some web search or in-app search site as being last used by the user * Registers the unique key of some web search or in-app search site as being last used by the user
*
* @param site The site settings to register as being last used * @param site The site settings to register as being last used
*/ */
public void setLastUsedSearchSite(SearchSetting site) { public void setLastUsedSearchSite(SearchSetting site) {
@ -675,6 +709,7 @@ public class ApplicationSettings {
/** /**
* Returns the statistics of this server as it was last seen by the background server checker service. * Returns the statistics of this server as it was last seen by the background server checker service.
*
* @param server The server for which to retrieved the statistics from the stored preferences * @param server The server for which to retrieved the statistics from the stored preferences
* @return A JSON array of JSON objects, each which represent a since torrent * @return A JSON array of JSON objects, each which represent a since torrent
*/ */
@ -692,6 +727,7 @@ public class ApplicationSettings {
/** /**
* Stores the now-last seen statistics of the supplied server by the background server checker service to the * Stores the now-last seen statistics of the supplied server by the background server checker service to the
* internal stored preferences. * internal stored preferences.
*
* @param server The server to which the statistics apply to * @param server The server to which the statistics apply to
* @param lastStats A JSON array of JSON objects that each represent a single seen torrent * @param lastStats A JSON array of JSON objects that each represent a single seen torrent
*/ */
@ -701,6 +737,7 @@ public class ApplicationSettings {
/** /**
* Returns the user configuration for some specific app widget, if the widget is known at all. * Returns the user configuration for some specific app widget, if the widget is known at all.
*
* @param appWidgetId The unique ID of the app widget to retrieve settings for, as supplied by the AppWidgetManager * @param appWidgetId The unique ID of the app widget to retrieve settings for, as supplied by the AppWidgetManager
* @return A widget configuration object, or null if no settings were stored for the widget ID * @return A widget configuration object, or null if no settings were stored for the widget ID
*/ */
@ -720,6 +757,7 @@ public class ApplicationSettings {
/** /**
* Stores the user settings for some specific app widget. Existing settings for the supplied app widget ID will be * Stores the user settings for some specific app widget. Existing settings for the supplied app widget ID will be
* overridden. * overridden.
*
* @param appWidgetId The unique ID of the app widget to store settings for, as supplied by the AppWidgetManager * @param appWidgetId The unique ID of the app widget to store settings for, as supplied by the AppWidgetManager
* @param settings A widget configuration object, which may not be null * @param settings A widget configuration object, which may not be null
*/ */
@ -738,6 +776,7 @@ public class ApplicationSettings {
/** /**
* Remove the setting for some specific app widget. * Remove the setting for some specific app widget.
*
* @param appWidgetId The unique ID of the app widget to store settings for, as supplied by the AppWidgetManager * @param appWidgetId The unique ID of the app widget to store settings for, as supplied by the AppWidgetManager
*/ */
public void removeWidgetConfig(int appWidgetId) { public void removeWidgetConfig(int appWidgetId) {
@ -753,6 +792,7 @@ public class ApplicationSettings {
/** /**
* Trims away whitespace around a string, or returns null if str is null * Trims away whitespace around a string, or returns null if str is null
*
* @param str The string to trim, or null * @param str The string to trim, or null
* @return The trimmed string, or null if str is null * @return The trimmed string, or null if str is null
*/ */

8
app/src/main/java/org/transdroid/core/app/settings/NotificationSettings.java

@ -30,6 +30,7 @@ import org.transdroid.R;
/** /**
* Allows instantiation of the settings specified in R.xml.pref_notifications. * Allows instantiation of the settings specified in R.xml.pref_notifications.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EBean(scope = Scope.Singleton) @EBean(scope = Scope.Singleton)
@ -47,6 +48,7 @@ public class NotificationSettings {
/** /**
* Whether the background service is enabled and the user wants to receive RSS-related notifications * Whether the background service is enabled and the user wants to receive RSS-related notifications
*
* @return True if the server should be checked for RSS feed updates * @return True if the server should be checked for RSS feed updates
*/ */
public boolean isEnabledForRss() { public boolean isEnabledForRss() {
@ -55,6 +57,7 @@ public class NotificationSettings {
/** /**
* Whether the background service is enabled and the user wants to receive torrent-related notifications * Whether the background service is enabled and the user wants to receive torrent-related notifications
*
* @return True if the server should be checked for torrent status updates * @return True if the server should be checked for torrent status updates
*/ */
public boolean isEnabledForTorrents() { public boolean isEnabledForTorrents() {
@ -67,6 +70,7 @@ public class NotificationSettings {
/** /**
* Returns the interval between two server checks * Returns the interval between two server checks
*
* @return The interval, in milliseconds * @return The interval, in milliseconds
*/ */
public Long getInvervalInMilliseconds() { public Long getInvervalInMilliseconds() {
@ -79,6 +83,7 @@ public class NotificationSettings {
/** /**
* Returns the sound (ring tone) to play on a new notification, or null if it should not play any * Returns the sound (ring tone) to play on a new notification, or null if it should not play any
*
* @return Either the user-specified sound, null if the user specified 'Silent' or the system default notification sound * @return Either the user-specified sound, null if the user specified 'Silent' or the system default notification sound
*/ */
public Uri getSound() { public Uri getSound() {
@ -100,6 +105,7 @@ public class NotificationSettings {
/** /**
* Returns the default vibrate pattern to use if the user enabled notification vibrations; check * Returns the default vibrate pattern to use if the user enabled notification vibrations; check
* {@link #shouldVibrate()}, * {@link #shouldVibrate()},
*
* @return A unique pattern for vibrations in Transdroid * @return A unique pattern for vibrations in Transdroid
*/ */
public long[] getDefaultVibratePattern() { public long[] getDefaultVibratePattern() {
@ -112,6 +118,7 @@ public class NotificationSettings {
/** /**
* Returns the LED colour to use on a new notification * Returns the LED colour to use on a new notification
*
* @return The integer value of the user-specified or default colour * @return The integer value of the user-specified or default colour
*/ */
public int getDesiredLedColour() { public int getDesiredLedColour() {
@ -123,6 +130,7 @@ public class NotificationSettings {
/** /**
* Whether the background service should report to ADW Launcher * Whether the background service should report to ADW Launcher
*
* @return True if the user want Transdroid to report to ADW Launcher * @return True if the user want Transdroid to report to ADW Launcher
*/ */
public boolean shouldReportToAdwLauncher() { public boolean shouldReportToAdwLauncher() {

4
app/src/main/java/org/transdroid/core/app/settings/RssfeedSetting.java

@ -25,6 +25,7 @@ import android.text.TextUtils;
/** /**
* Represents a user-specified RSS feed. * Represents a user-specified RSS feed.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class RssfeedSetting implements SimpleListItem { public class RssfeedSetting implements SimpleListItem {
@ -93,6 +94,7 @@ public class RssfeedSetting implements SimpleListItem {
* Returns the date on which we last checked this feed. Note that this is NOT updated automatically after the * Returns the date on which we last checked this feed. Note that this is NOT updated automatically after the
* settings were loaded from {@link ApplicationSettings}; instead the settings have to be manually loaded again * settings were loaded from {@link ApplicationSettings}; instead the settings have to be manually loaded again
* using {@link ApplicationSettings#getRssfeedSetting(int)}. * using {@link ApplicationSettings#getRssfeedSetting(int)}.
*
* @return The last new item's URL as URL-encoded string * @return The last new item's URL as URL-encoded string
*/ */
public Date getLastViewed() { public Date getLastViewed() {
@ -103,6 +105,7 @@ public class RssfeedSetting implements SimpleListItem {
* Returns the URL of the item that was the newest last time we checked this feed. Note that this is NOT updated * Returns the URL of the item that was the newest last time we checked this feed. Note that this is NOT updated
* automatically after the settings were loaded from {@link ApplicationSettings}; instead the settings have to be * automatically after the settings were loaded from {@link ApplicationSettings}; instead the settings have to be
* manually loaded again using {@link ApplicationSettings#getRssfeedSetting(int)}. * manually loaded again using {@link ApplicationSettings#getRssfeedSetting(int)}.
*
* @return The last new item's URL as URL-encoded string * @return The last new item's URL as URL-encoded string
*/ */
public String getLastViewedItemUrl() { public String getLastViewedItemUrl() {
@ -111,6 +114,7 @@ public class RssfeedSetting implements SimpleListItem {
/** /**
* Returns a nicely formatted identifier containing (a portion of) the feed URL * Returns a nicely formatted identifier containing (a portion of) the feed URL
*
* @return A string to identify this feed's URL * @return A string to identify this feed's URL
*/ */
public String getHumanReadableIdentifier() { public String getHumanReadableIdentifier() {

6
app/src/main/java/org/transdroid/core/app/settings/ServerSetting.java

@ -29,6 +29,7 @@ import org.transdroid.daemon.OS;
/** /**
* Represents a user-configured remote server. * Represents a user-configured remote server.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class ServerSetting implements SimpleListItem { public class ServerSetting implements SimpleListItem {
@ -65,6 +66,7 @@ public class ServerSetting implements SimpleListItem {
/** /**
* Creates a daemon settings instance, providing full connection details * Creates a daemon settings instance, providing full connection details
*
* @param name A name used to identify this server to the user * @param name A name used to identify this server to the user
* @param type The server daemon type * @param type The server daemon type
* @param address The server domain name or IP address * @param address The server domain name or IP address
@ -235,6 +237,7 @@ public class ServerSetting implements SimpleListItem {
/** /**
* Returns a string that the user can use to identify the server by internal settings (rather than the name). * Returns a string that the user can use to identify the server by internal settings (rather than the name).
*
* @return A human-readable identifier in the form [https://]username@address:port/folder * @return A human-readable identifier in the form [https://]username@address:port/folder
*/ */
public String getHumanReadableIdentifier() { public String getHumanReadableIdentifier() {
@ -253,6 +256,7 @@ public class ServerSetting implements SimpleListItem {
* Returns a string that acts as a unique identifier for this server, non-depending on the internal storage * Returns a string that acts as a unique identifier for this server, non-depending on the internal storage
* order/index. THis may be used to store additional details about this server elsewhere. It may change if the user * order/index. THis may be used to store additional details about this server elsewhere. It may change if the user
* changes server settings, but not with name or notification settings. * changes server settings, but not with name or notification settings.
*
* @return A unique identifying string, based primarily on the configured address, port number, SSL settings and * @return A unique identifying string, based primarily on the configured address, port number, SSL settings and
* user name; returns null if the server is not yet fully identifiable (during configuration, for example) * user name; returns null if the server is not yet fully identifiable (during configuration, for example)
*/ */
@ -284,6 +288,7 @@ public class ServerSetting implements SimpleListItem {
/** /**
* Returns the appropriate daemon adapter to which tasks can be executed, in accordance with this server's settings * Returns the appropriate daemon adapter to which tasks can be executed, in accordance with this server's settings
*
* @param connectedToNetwork The name of the (wifi) network we are currently connected to, or null if this could not * @param connectedToNetwork The name of the (wifi) network we are currently connected to, or null if this could not
* be determined * be determined
* @param context A context to access the logger * @param context A context to access the logger
@ -295,6 +300,7 @@ public class ServerSetting implements SimpleListItem {
/** /**
* Converts local server settings into an old-style {@link DaemonSettings} object. * Converts local server settings into an old-style {@link DaemonSettings} object.
*
* @param connectedToNetwork The name of the (wifi) network we are currently connected to, or null if this could not * @param connectedToNetwork The name of the (wifi) network we are currently connected to, or null if this could not
* be determined * be determined
* @param caller A context to access the logger * @param caller A context to access the logger

5
app/src/main/java/org/transdroid/core/app/settings/SettingsPersistence.java

@ -56,6 +56,7 @@ public class SettingsPersistence {
/** /**
* Reads the server, web searches, RSS feed, background service and system settings from a JSON-encoded String, such as when read via a QR code. * Reads the server, web searches, RSS feed, background service and system settings from a JSON-encoded String, such as when read via a QR code.
*
* @param prefs The application-global preferences object to write settings to * @param prefs The application-global preferences object to write settings to
* @param contents The JSON-encoded settings as raw String * @param contents The JSON-encoded settings as raw String
* @throws JSONException Thrown when the file did not contain valid JSON content * @throws JSONException Thrown when the file did not contain valid JSON content
@ -67,6 +68,7 @@ public class SettingsPersistence {
/** /**
* Synchronously reads the server, web searches, RSS feed, background service and system settings from a file in * Synchronously reads the server, web searches, RSS feed, background service and system settings from a file in
* JSON format. * JSON format.
*
* @param prefs The application-global preferences object to write settings to * @param prefs The application-global preferences object to write settings to
* @param settingsFile The local file to read the settings from * @param settingsFile The local file to read the settings from
* @throws FileNotFoundException Thrown when the settings file doesn't exist or couldn't be read * @throws FileNotFoundException Thrown when the settings file doesn't exist or couldn't be read
@ -79,6 +81,7 @@ public class SettingsPersistence {
/** /**
* Synchronously reads the server, web searches, RSS feed, background service and system settings from a stream (file) in * Synchronously reads the server, web searches, RSS feed, background service and system settings from a stream (file) in
* JSON format. * JSON format.
*
* @param prefs The application-global preferences object to write settings to * @param prefs The application-global preferences object to write settings to
* @param settingsStream The stream to read the settings from * @param settingsStream The stream to read the settings from
* @throws JSONException Thrown when the file did not contain valid JSON content * @throws JSONException Thrown when the file did not contain valid JSON content
@ -229,6 +232,7 @@ public class SettingsPersistence {
/** /**
* Returns encoded server, web searches, RSS feed, background service and system settings as a JSON data object structure, serialized to a String. * Returns encoded server, web searches, RSS feed, background service and system settings as a JSON data object structure, serialized to a String.
*
* @param prefs The application-global preferences object to read settings from * @param prefs The application-global preferences object to read settings from
* @throws JSONException Thrown when the JSON content could not be constructed properly * @throws JSONException Thrown when the JSON content could not be constructed properly
*/ */
@ -239,6 +243,7 @@ public class SettingsPersistence {
/** /**
* Synchronously writes the server, web searches, RSS feed, background service and system settings to a file in JSON * Synchronously writes the server, web searches, RSS feed, background service and system settings to a file in JSON
* format. * format.
*
* @param prefs The application-global preferences object to read settings from * @param prefs The application-global preferences object to read settings from
* @param settingsFile The local file to read the settings from * @param settingsFile The local file to read the settings from
* @throws JSONException Thrown when the JSON content could not be constructed properly * @throws JSONException Thrown when the JSON content could not be constructed properly

1
app/src/main/java/org/transdroid/core/app/settings/SettingsUtils.java

@ -2,6 +2,7 @@ package org.transdroid.core.app.settings;
import android.content.Context; import android.content.Context;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.app.AppCompatDelegate;

4
app/src/main/java/org/transdroid/core/app/settings/SystemSettings.java

@ -29,6 +29,7 @@ import java.util.Date;
/** /**
* Allows instantiation of the settings specified in R.xml.pref_system. * Allows instantiation of the settings specified in R.xml.pref_system.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EBean(scope = Scope.Singleton) @EBean(scope = Scope.Singleton)
@ -48,6 +49,7 @@ public class SystemSettings {
/** /**
* Returns the interval in which automatic screen refreshes should be scheduled. * Returns the interval in which automatic screen refreshes should be scheduled.
*
* @return The selected refresh interval in milliseconds or 0 if automatic refreshes should be disabled * @return The selected refresh interval in milliseconds or 0 if automatic refreshes should be disabled
*/ */
public long getRefreshIntervalMilliseconds() { public long getRefreshIntervalMilliseconds() {
@ -68,6 +70,7 @@ public class SystemSettings {
/** /**
* Returns the date when we last checked transdroid.org for the latest app version. * Returns the date when we last checked transdroid.org for the latest app version.
*
* @return The date/time when the {@link org.transdroid.core.service.AppUpdateJob} checked on the server for updates * @return The date/time when the {@link org.transdroid.core.service.AppUpdateJob} checked on the server for updates
*/ */
public Date getLastCheckedForAppUpdates() { public Date getLastCheckedForAppUpdates() {
@ -77,6 +80,7 @@ public class SystemSettings {
/** /**
* Stores the date at which was last successfully, fully checked for new updates to the app. * Stores the date at which was last successfully, fully checked for new updates to the app.
*
* @param lastChecked The date/time at which the {@link org.transdroid.core.service.AppUpdateJob} last checked the server for updates * @param lastChecked The date/time at which the {@link org.transdroid.core.service.AppUpdateJob} last checked the server for updates
*/ */
public void setLastCheckedForAppUpdates(Date lastChecked) { public void setLastCheckedForAppUpdates(Date lastChecked) {

2
app/src/main/java/org/transdroid/core/app/settings/WebsearchSetting.java

@ -24,6 +24,7 @@ import android.text.TextUtils;
/** /**
* Represents a user-specified website that can be searched (by starting the browser, rather than in-app) * Represents a user-specified website that can be searched (by starting the browser, rather than in-app)
*
* @author Eric Kok * @author Eric Kok
*/ */
public class WebsearchSetting implements SimpleListItem, SearchSetting { public class WebsearchSetting implements SimpleListItem, SearchSetting {
@ -72,6 +73,7 @@ public class WebsearchSetting implements SimpleListItem, SearchSetting {
/** /**
* Returns a nicely formatted identifier containing (a portion of) the search base URL * Returns a nicely formatted identifier containing (a portion of) the search base URL
*
* @return A string to identify this site's search URL * @return A string to identify this site's search URL
*/ */
public String getHumanReadableIdentifier() { public String getHumanReadableIdentifier() {

2
app/src/main/java/org/transdroid/core/gui/DetailsActivity.java

@ -20,6 +20,7 @@ import android.annotation.TargetApi;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
@ -82,6 +83,7 @@ import java.util.List;
* An activity that holds a single torrents details fragment. It is used on devices (i.e. phones) where there is no room to show details in the {@link * An activity that holds a single torrents details fragment. It is used on devices (i.e. phones) where there is no room to show details in the {@link
* TorrentsActivity} directly. Task execution, such as loading of more details and updating file priorities, is performed in this activity via * TorrentsActivity} directly. Task execution, such as loading of more details and updating file priorities, is performed in this activity via
* background methods. * background methods.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EActivity(R.layout.activity_details) @EActivity(R.layout.activity_details)

10
app/src/main/java/org/transdroid/core/gui/DetailsFragment.java

@ -23,9 +23,11 @@ import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.ActionMenuView; import androidx.appcompat.widget.ActionMenuView;
import android.view.ActionMode; import android.view.ActionMode;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
@ -75,6 +77,7 @@ import java.util.List;
* Fragment that shows detailed statistics about some torrent. These come from some already fetched {@link Torrent} object, but it also retrieves * Fragment that shows detailed statistics about some torrent. These come from some already fetched {@link Torrent} object, but it also retrieves
* further detailed statistics. The actual execution of tasks is performed by the activity that contains this fragment, as per the {@link * further detailed statistics. The actual execution of tasks is performed by the activity that contains this fragment, as per the {@link
* TorrentTasksExecutor} interface. * TorrentTasksExecutor} interface.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EFragment(R.layout.fragment_details) @EFragment(R.layout.fragment_details)
@ -161,6 +164,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
/** /**
* Updates the details adapter header to show the new torrent data. * Updates the details adapter header to show the new torrent data.
*
* @param newTorrent The new, non-null torrent object * @param newTorrent The new, non-null torrent object
*/ */
public void updateTorrent(Torrent newTorrent) { public void updateTorrent(Torrent newTorrent) {
@ -186,6 +190,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
/** /**
* Updates the details adapter to show the list of trackers and tracker errors. * Updates the details adapter to show the list of trackers and tracker errors.
*
* @param checkTorrent The torrent for which the details were retrieved * @param checkTorrent The torrent for which the details were retrieved
* @param newTorrentDetails The new fine details object of some torrent * @param newTorrentDetails The new fine details object of some torrent
*/ */
@ -205,6 +210,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
/** /**
* Updates the list adapter to show a new list of torrent files, replacing the old files list. * Updates the list adapter to show a new list of torrent files, replacing the old files list.
*
* @param checkTorrent The torrent for which the details were retrieved * @param checkTorrent The torrent for which the details were retrieved
* @param newTorrentFiles The new, updated list of torrent file objects * @param newTorrentFiles The new, updated list of torrent file objects
*/ */
@ -220,6 +226,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
/** /**
* Can be called if some outside activity returned new torrents, so we can perhaps piggyback on this by update our data as well. * Can be called if some outside activity returned new torrents, so we can perhaps piggyback on this by update our data as well.
*
* @param torrents The last of retrieved torrents * @param torrents The last of retrieved torrents
*/ */
public void perhapsUpdateTorrent(List<Torrent> torrents) { public void perhapsUpdateTorrent(List<Torrent> torrents) {
@ -239,6 +246,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
/** /**
* Updates the locally maintained list of labels that are active on the server. Used in the label picking dialog and should be updated every time * Updates the locally maintained list of labels that are active on the server. Used in the label picking dialog and should be updated every time
* after the list of torrents was retrieved to keep it updated. * after the list of torrents was retrieved to keep it updated.
*
* @param currentLabels The list of known server labels * @param currentLabels The list of known server labels
*/ */
public void updateLabels(ArrayList<Label> currentLabels) { public void updateLabels(ArrayList<Label> currentLabels) {
@ -261,6 +269,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
/** /**
* Updates the shown screen depending on whether the torrent is loading * Updates the shown screen depending on whether the torrent is loading
*
* @param isLoading True if the torrent is (re)loading, false otherwise * @param isLoading True if the torrent is (re)loading, false otherwise
* @param connectionErrorMessage The error message text to show to the user, or null if there was no error * @param connectionErrorMessage The error message text to show to the user, or null if there was no error
*/ */
@ -680,6 +689,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
/** /**
* Returns the object responsible for executing torrent tasks against a connected server * Returns the object responsible for executing torrent tasks against a connected server
*
* @return The executor for tasks on some torrent * @return The executor for tasks on some torrent
*/ */
private TorrentTasksExecutor getTasksExecutor() { private TorrentTasksExecutor getTasksExecutor() {

2
app/src/main/java/org/transdroid/core/gui/ServerPickerDialog.java

@ -21,6 +21,7 @@ import java.util.List;
import android.app.Dialog; import android.app.Dialog;
import android.app.DialogFragment; import android.app.DialogFragment;
import android.os.Bundle; import android.os.Bundle;
import org.transdroid.R; import org.transdroid.R;
import org.transdroid.core.app.settings.ServerSetting; import org.transdroid.core.app.settings.ServerSetting;
@ -46,6 +47,7 @@ public class ServerPickerDialog extends DialogFragment {
/** /**
* Opens a dialog that allows the selection of a configured server (manual or seedbox). The calling activity will * Opens a dialog that allows the selection of a configured server (manual or seedbox). The calling activity will
* receive a callback on its switchServerAndAddFromIntent(int) method. * receive a callback on its switchServerAndAddFromIntent(int) method.
*
* @param activity The torrents activity from which the picker is started (and which received the callback) * @param activity The torrents activity from which the picker is started (and which received the callback)
* @param serverSettings The list of all available servers, of which their names will be offered to the user to pick * @param serverSettings The list of all available servers, of which their names will be offered to the user to pick
* from (and its position in the list is returned to the activity) * from (and its position in the list is returned to the activity)

2
app/src/main/java/org/transdroid/core/gui/ServerSelectionView.java

@ -42,6 +42,7 @@ public class ServerSelectionView extends RelativeLayout {
/** /**
* Updates the name of the current connected server. * Updates the name of the current connected server.
*
* @param currentServer The server currently connected to * @param currentServer The server currently connected to
*/ */
public void updateCurrentServer(IDaemonAdapter currentServer) { public void updateCurrentServer(IDaemonAdapter currentServer) {
@ -50,6 +51,7 @@ public class ServerSelectionView extends RelativeLayout {
/** /**
* Updates the name of the selected filter. * Updates the name of the selected filter.
*
* @param currentFilter The filter that is currently selected * @param currentFilter The filter that is currently selected
*/ */
public void updateCurrentFilter(NavigationFilter currentFilter) { public void updateCurrentFilter(NavigationFilter currentFilter) {

1
app/src/main/java/org/transdroid/core/gui/ServerStatusView.java

@ -54,6 +54,7 @@ public class ServerStatusView extends RelativeLayout implements OnRatesPickedLis
/** /**
* Updates the statistics as shown in the action bar through this server status view. * Updates the statistics as shown in the action bar through this server status view.
*
* @param torrents The most recently received list of torrents * @param torrents The most recently received list of torrents
* @param dormantAsInactive Whether to treat dormant (0KB/s) torrent as inactive state torrents * @param dormantAsInactive Whether to treat dormant (0KB/s) torrent as inactive state torrents
* @param supportsSetTransferRates Whether the connected torrent client supports setting of max transfer speeds * @param supportsSetTransferRates Whether the connected torrent client supports setting of max transfer speeds

1
app/src/main/java/org/transdroid/core/gui/TorrentTasksExecutor.java

@ -27,6 +27,7 @@ import java.util.List;
/** /**
* Interface to be implemented by any activity that wants containing fragments to be able to load data and execute commands against a torrent server. * Interface to be implemented by any activity that wants containing fragments to be able to load data and execute commands against a torrent server.
*
* @author Eric Kok * @author Eric Kok
*/ */
public interface TorrentTasksExecutor { public interface TorrentTasksExecutor {

7
app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java

@ -24,6 +24,7 @@ import android.net.Uri;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.view.MenuItemCompat; import androidx.core.view.MenuItemCompat;
import androidx.drawerlayout.widget.DrawerLayout; import androidx.drawerlayout.widget.DrawerLayout;
@ -32,6 +33,7 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.ActionMenuView; import androidx.appcompat.widget.ActionMenuView;
import androidx.appcompat.widget.SearchView; import androidx.appcompat.widget.SearchView;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
@ -142,6 +144,7 @@ import java.util.Map.Entry;
* Main activity that holds the fragment that shows the torrents list, presents a way to filter the list (via an action bar spinner or list side list) * Main activity that holds the fragment that shows the torrents list, presents a way to filter the list (via an action bar spinner or list side list)
* and potentially shows a torrent details fragment too, if there is room. Task execution such as loading of and adding torrents is performs in this * and potentially shows a torrent details fragment too, if there is room. Task execution such as loading of and adding torrents is performs in this
* activity, using background methods. Finally, the activity offers navigation elements such as access to settings and showing connection issues. * activity, using background methods. Finally, the activity offers navigation elements such as access to settings and showing connection issues.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EActivity(R.layout.activity_torrents) @EActivity(R.layout.activity_torrents)
@ -537,6 +540,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE
/** /**
* A new filter was selected; update the view over the current data * A new filter was selected; update the view over the current data
*
* @param item The touched filter item * @param item The touched filter item
* @param forceNewConnection Whether a new connection should be initialised regardless of the old server selection * @param forceNewConnection Whether a new connection should be initialised regardless of the old server selection
*/ */
@ -596,6 +600,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE
/** /**
* Hides the filter list and details fragment's full view if there is no configured connection * Hides the filter list and details fragment's full view if there is no configured connection
*
* @param hasServerSettings Whether there are server settings available, so we can continue to connect * @param hasServerSettings Whether there are server settings available, so we can continue to connect
*/ */
private void updateFragmentVisibility(boolean hasServerSettings) { private void updateFragmentVisibility(boolean hasServerSettings) {
@ -885,6 +890,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE
/** /**
* Redirect the newly entered list filter to the torrents fragment. * Redirect the newly entered list filter to the torrents fragment.
*
* @param newFilterText The newly entered filter (or empty to clear the current filter). * @param newFilterText The newly entered filter (or empty to clear the current filter).
*/ */
public void filterTorrents(String newFilterText) { public void filterTorrents(String newFilterText) {
@ -894,6 +900,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE
/** /**
* Shows the a details fragment for the given torrent, either in the dedicated details fragment pane, in the same pane as the torrent list was * Shows the a details fragment for the given torrent, either in the dedicated details fragment pane, in the same pane as the torrent list was
* displayed or by starting a details activity. * displayed or by starting a details activity.
*
* @param torrent The torrent to show detailed statistics for * @param torrent The torrent to show detailed statistics for
*/ */
public void openDetails(Torrent torrent) { public void openDetails(Torrent torrent) {

12
app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java

@ -18,10 +18,12 @@ package org.transdroid.core.gui;
import android.app.Fragment; import android.app.Fragment;
import android.content.Context; import android.content.Context;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.ActionMenuView; import androidx.appcompat.widget.ActionMenuView;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.view.ActionMode; import android.view.ActionMode;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
@ -64,6 +66,7 @@ import java.util.Locale;
/** /**
* Fragment that shows a list of torrents that are active on the server. It supports sorting and filtering and can show connection progress and * Fragment that shows a list of torrents that are active on the server. It supports sorting and filtering and can show connection progress and
* issues. However, actual task starting and execution and overall navigation elements are part of the containing activity, not this fragment. * issues. However, actual task starting and execution and overall navigation elements are part of the containing activity, not this fragment.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EFragment(R.layout.fragment_torrents) @EFragment(R.layout.fragment_torrents)
@ -141,6 +144,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
/** /**
* Updates the list adapter to show a new list of torrent objects, replacing the old torrents completely * Updates the list adapter to show a new list of torrent objects, replacing the old torrents completely
*
* @param newTorrents The new, updated list of torrents * @param newTorrents The new, updated list of torrents
*/ */
public void updateTorrents(ArrayList<Torrent> newTorrents, ArrayList<Label> currentLabels) { public void updateTorrents(ArrayList<Torrent> newTorrents, ArrayList<Label> currentLabels) {
@ -155,6 +159,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
/** /**
* Just look for a specific torrent in the currently shown list (by its unique id) and update only this * Just look for a specific torrent in the currently shown list (by its unique id) and update only this
*
* @param affected The affected torrent to update * @param affected The affected torrent to update
* @param wasRemoved Whether the affected torrent was indeed removed; otherwise it was updated somehow * @param wasRemoved Whether the affected torrent was indeed removed; otherwise it was updated somehow
*/ */
@ -182,6 +187,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
/** /**
* Clears the currently visible list of torrents. * Clears the currently visible list of torrents.
*
* @param clearError Also clear any error message * @param clearError Also clear any error message
* @param clearFilter Also clear any selected filter * @param clearFilter Also clear any selected filter
*/ */
@ -200,6 +206,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
/** /**
* Stores the new sort order (for future refreshes) and sorts the current visible list. If the given new sort property equals the existing * Stores the new sort order (for future refreshes) and sorts the current visible list. If the given new sort property equals the existing
* property, the list sort order is reversed instead. * property, the list sort order is reversed instead.
*
* @param newSortOrder The sort order that the user selected. * @param newSortOrder The sort order that the user selected.
*/ */
public void sortBy(TorrentsSortBy newSortOrder) { public void sortBy(TorrentsSortBy newSortOrder) {
@ -222,6 +229,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
/** /**
* Apply a filter on the current list of all torrents, showing the appropriate sublist of torrents only * Apply a filter on the current list of all torrents, showing the appropriate sublist of torrents only
*
* @param newFilter The new filter to apply to the local list of torrents * @param newFilter The new filter to apply to the local list of torrents
*/ */
public void applyNavigationFilter(NavigationFilter newFilter) { public void applyNavigationFilter(NavigationFilter newFilter) {
@ -425,6 +433,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
/** /**
* Updates the shown screen depending on whether we have a connection (so torrents can be shown) or not (in case we need to show a message * Updates the shown screen depending on whether we have a connection (so torrents can be shown) or not (in case we need to show a message
* suggesting help). This should only ever be called on the UI thread. * suggesting help). This should only ever be called on the UI thread.
*
* @param hasAConnection True if the user has servers configured and therefore has a connection that can be used * @param hasAConnection True if the user has servers configured and therefore has a connection that can be used
*/ */
public void updateConnectionStatus(boolean hasAConnection, Daemon daemonType) { public void updateConnectionStatus(boolean hasAConnection, Daemon daemonType) {
@ -446,6 +455,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
/** /**
* Updates the shown screen depending on whether the torrents are loading. This should only ever be called on the UI thread. * Updates the shown screen depending on whether the torrents are loading. This should only ever be called on the UI thread.
*
* @param isLoading True if the list of torrents is (re)loading, false otherwise * @param isLoading True if the list of torrents is (re)loading, false otherwise
*/ */
public void updateIsLoading(boolean isLoading) { public void updateIsLoading(boolean isLoading) {
@ -460,6 +470,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
/** /**
* Updates the shown screen depending on whether a connection error occurred. This should only ever be called on the UI thread. * Updates the shown screen depending on whether a connection error occurred. This should only ever be called on the UI thread.
*
* @param connectionErrorMessage The error message from the last failed connection attempt, or null to clear the visible error text * @param connectionErrorMessage The error message from the last failed connection attempt, or null to clear the visible error text
*/ */
public void updateError(String connectionErrorMessage) { public void updateError(String connectionErrorMessage) {
@ -489,6 +500,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
/** /**
* Returns the object responsible for executing torrent tasks against a connected server * Returns the object responsible for executing torrent tasks against a connected server
*
* @return The executor for tasks on some torrent * @return The executor for tasks on some torrent
*/ */
private TorrentTasksExecutor getTasksExecutor() { private TorrentTasksExecutor getTasksExecutor() {

3
app/src/main/java/org/transdroid/core/gui/TransdroidApp.java

@ -17,11 +17,14 @@
package org.transdroid.core.gui; package org.transdroid.core.gui;
import android.app.Application; import android.app.Application;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.evernote.android.job.JobConfig; import com.evernote.android.job.JobConfig;
import com.evernote.android.job.JobManager; import com.evernote.android.job.JobManager;
import com.evernote.android.job.util.JobLogger; import com.evernote.android.job.util.JobLogger;
import org.androidannotations.annotations.Bean; import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EApplication; import org.androidannotations.annotations.EApplication;
import org.transdroid.core.gui.log.Log; import org.transdroid.core.gui.log.Log;

6
app/src/main/java/org/transdroid/core/gui/lists/DetailsAdapter.java

@ -33,6 +33,7 @@ import android.widget.BaseAdapter;
/** /**
* List adapter that holds a header view showing torrent details and show the list list contained by the torrent. * List adapter that holds a header view showing torrent details and show the list list contained by the torrent.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class DetailsAdapter extends MergeAdapter { public class DetailsAdapter extends MergeAdapter {
@ -104,6 +105,7 @@ public class DetailsAdapter extends MergeAdapter {
/** /**
* Update the torrent data in the details header of this merge adapter * Update the torrent data in the details header of this merge adapter
*
* @param torrent The torrent for which detailed data is shown * @param torrent The torrent for which detailed data is shown
*/ */
public void updateTorrent(Torrent torrent) { public void updateTorrent(Torrent torrent) {
@ -113,6 +115,7 @@ public class DetailsAdapter extends MergeAdapter {
/** /**
* Update the list of files contained in this torrent * Update the list of files contained in this torrent
*
* @param torrentFiles The new list of files, or null if the list and header should be hidden * @param torrentFiles The new list of files, or null if the list and header should be hidden
*/ */
public void updateTorrentFiles(List<TorrentFile> torrentFiles) { public void updateTorrentFiles(List<TorrentFile> torrentFiles) {
@ -127,6 +130,7 @@ public class DetailsAdapter extends MergeAdapter {
/** /**
* Update the list of trackers * Update the list of trackers
*
* @param trackers The new list of trackers known for this torrent, or null if the list and header should be hidden * @param trackers The new list of trackers known for this torrent, or null if the list and header should be hidden
*/ */
public void updateTrackers(List<? extends SimpleListItem> trackers) { public void updateTrackers(List<? extends SimpleListItem> trackers) {
@ -141,6 +145,7 @@ public class DetailsAdapter extends MergeAdapter {
/** /**
* Update the list of errors * Update the list of errors
*
* @param errors The new list of errors known for this torrent, or null if the list and header should be hidden * @param errors The new list of errors known for this torrent, or null if the list and header should be hidden
*/ */
public void updateErrors(List<? extends SimpleListItem> errors) { public void updateErrors(List<? extends SimpleListItem> errors) {
@ -191,6 +196,7 @@ public class DetailsAdapter extends MergeAdapter {
/** /**
* Allows updating of the full data list underlying this adapter, replacing all items * Allows updating of the full data list underlying this adapter, replacing all items
*
* @param newItems The new list of files to display * @param newItems The new list of files to display
*/ */
public void update(List<TorrentFile> newItems) { public void update(List<TorrentFile> newItems) {

9
app/src/main/java/org/transdroid/core/gui/lists/LocalTorrent.java

@ -30,12 +30,14 @@ import android.content.res.Resources;
/** /**
* Wrapper around Torrent to provide some addition getters that give translatable or otherwise formatted Strings of * Wrapper around Torrent to provide some addition getters that give translatable or otherwise formatted Strings of
* torrent statistics. * torrent statistics.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class LocalTorrent { public class LocalTorrent {
/** /**
* Creates the LocalTorrent object so that the translatable/formattable version of a Torrent can be used. * Creates the LocalTorrent object so that the translatable/formattable version of a Torrent can be used.
*
* @param torrent The Torrent object * @param torrent The Torrent object
* @return The torrent wrapped as LocalTorrent object * @return The torrent wrapped as LocalTorrent object
*/ */
@ -56,6 +58,7 @@ public class LocalTorrent {
* Builds a string showing the upload/download seed ratio. If not downloading, it will base the ratio on the total * Builds a string showing the upload/download seed ratio. If not downloading, it will base the ratio on the total
* size; so if you created the torrent yourself you will have downloaded 0 bytes, but the ratio will pretend you * size; so if you created the torrent yourself you will have downloaded 0 bytes, but the ratio will pretend you
* have 100%. * have 100%.
*
* @return A nicely formatted string containing the upload/download seed ratio * @return A nicely formatted string containing the upload/download seed ratio
*/ */
public String getRatioString() { public String getRatioString() {
@ -74,6 +77,7 @@ public class LocalTorrent {
/** /**
* Returns a formatted string indicating the current progress in terms of transferred bytes * Returns a formatted string indicating the current progress in terms of transferred bytes
*
* @param r The context resources, to access translations * @param r The context resources, to access translations
* @param withAvailability Whether to show file availability in-line * @param withAvailability Whether to show file availability in-line
* @return A nicely formatted string indicating torrent status and, if applicable, progress in bytes * @return A nicely formatted string indicating torrent status and, if applicable, progress in bytes
@ -111,6 +115,7 @@ public class LocalTorrent {
/** /**
* Returns a formatted string indicating either the expected time to download (ETA) or, when seeding, the ratio * Returns a formatted string indicating either the expected time to download (ETA) or, when seeding, the ratio
*
* @param r The context resources, to access translations * @param r The context resources, to access translations
* @return A string like '~ 34 seconds', or 'RATIO 8.2' or an empty string * @return A string like '~ 34 seconds', or 'RATIO 8.2' or an empty string
*/ */
@ -134,6 +139,7 @@ public class LocalTorrent {
/** /**
* Returns a formatted string indicating the torrent status and connected peers * Returns a formatted string indicating the torrent status and connected peers
*
* @param r The context resources, to access translations * @param r The context resources, to access translations
* @return A string like 'Queued' or, when seeding or leeching, '2 OF 28 PEERS' * @return A string like 'Queued' or, when seeding or leeching, '2 OF 28 PEERS'
*/ */
@ -162,6 +168,7 @@ public class LocalTorrent {
/** /**
* Returns a formatted string indicating current transfer speeds for the torrent * Returns a formatted string indicating current transfer speeds for the torrent
*
* @param r The context resources, to access translations * @param r The context resources, to access translations
* @return A string like ' 28KB/s 1.8MB/s', or an empty string when not transferrring * @return A string like ' 28KB/s 1.8MB/s', or an empty string when not transferrring
*/ */
@ -210,6 +217,7 @@ public class LocalTorrent {
/** /**
* Returns a formatted string indicating the remaining download time * Returns a formatted string indicating the remaining download time
*
* @param r The context resources, to access translations * @param r The context resources, to access translations
* @param inDays Whether to show days or use hours for > 24 hours left instead * @param inDays Whether to show days or use hours for > 24 hours left instead
* @return A string like '4d 8h 34m 5s' or '2m 3s' * @return A string like '4d 8h 34m 5s' or '2m 3s'
@ -224,6 +232,7 @@ public class LocalTorrent {
/** /**
* Convert a DaemonException to a translatable human-readable error message * Convert a DaemonException to a translatable human-readable error message
*
* @param e The exception that was thrown by the server * @param e The exception that was thrown by the server
* @return A string resource ID to show to the user * @return A string resource ID to show to the user
*/ */

8
app/src/main/java/org/transdroid/core/gui/lists/MergeAdapter.java

@ -31,6 +31,7 @@ import android.widget.TextView;
* An adapter that can contain many other adapters and shows them in sequence. Taken from * An adapter that can contain many other adapters and shows them in sequence. Taken from
* http://stackoverflow.com/questions/7964259/android-attaching-multiple-adapters-to-one-adapter and based on the Apache * http://stackoverflow.com/questions/7964259/android-attaching-multiple-adapters-to-one-adapter and based on the Apache
* 2-licensed CommonsWare MergeAdapter. * 2-licensed CommonsWare MergeAdapter.
*
* @author Eric Kok * @author Eric Kok
* @author Alex Amiryan * @author Alex Amiryan
* @author Mark Murphy * @author Mark Murphy
@ -49,6 +50,7 @@ public class MergeAdapter extends BaseAdapter implements SectionIndexer {
/** /**
* Adds a new adapter to the roster of things to appear in the aggregate list. * Adds a new adapter to the roster of things to appear in the aggregate list.
*
* @param adapter Source for row views for this section * @param adapter Source for row views for this section
*/ */
public void addAdapter(ListAdapter adapter) { public void addAdapter(ListAdapter adapter) {
@ -58,6 +60,7 @@ public class MergeAdapter extends BaseAdapter implements SectionIndexer {
/** /**
* Get the data item associated with the specified position in the data set. * Get the data item associated with the specified position in the data set.
*
* @param position Position of the item whose data we want * @param position Position of the item whose data we want
*/ */
public Object getItem(int position) { public Object getItem(int position) {
@ -80,6 +83,7 @@ public class MergeAdapter extends BaseAdapter implements SectionIndexer {
/** /**
* Get the adapter associated with the specified position in the data set. * Get the adapter associated with the specified position in the data set.
*
* @param position Position of the item whose adapter we want * @param position Position of the item whose adapter we want
*/ */
public ListAdapter getAdapter(int position) { public ListAdapter getAdapter(int position) {
@ -130,6 +134,7 @@ public class MergeAdapter extends BaseAdapter implements SectionIndexer {
/** /**
* Get the type of {@link View} that will be created by {@link #getView(int, View, ViewGroup)} for the specified item. * Get the type of {@link View} that will be created by {@link #getView(int, View, ViewGroup)} for the specified item.
*
* @param position Position of the item whose data we want * @param position Position of the item whose data we want
*/ */
@Override @Override
@ -162,6 +167,7 @@ public class MergeAdapter extends BaseAdapter implements SectionIndexer {
/** /**
* Returns true if the item at the specified position is not a separator. * Returns true if the item at the specified position is not a separator.
*
* @param position Position of the item whose data we want * @param position Position of the item whose data we want
*/ */
@Override @Override
@ -181,6 +187,7 @@ public class MergeAdapter extends BaseAdapter implements SectionIndexer {
/** /**
* Get a {@link View} that displays the data at the specified position in the data set. * Get a {@link View} that displays the data at the specified position in the data set.
*
* @param position Position of the item whose data we want * @param position Position of the item whose data we want
* @param convertView View to recycle, if not null * @param convertView View to recycle, if not null
* @param parent ViewGroup containing the returned View * @param parent ViewGroup containing the returned View
@ -208,6 +215,7 @@ public class MergeAdapter extends BaseAdapter implements SectionIndexer {
/** /**
* Get the row id associated with the specified position in the list. * Get the row id associated with the specified position in the list.
*
* @param position Position of the item whose data we want * @param position Position of the item whose data we want
*/ */
public long getItemId(int position) { public long getItemId(int position) {

3
app/src/main/java/org/transdroid/core/gui/lists/PiecesMapView.java

@ -115,8 +115,7 @@ class PiecesMapView extends View {
} }
String scaledPiecesString = ""; String scaledPiecesString = "";
for (int s : piecesScaled) for (int s : piecesScaled) {
{
scaledPiecesString += s; scaledPiecesString += s;
} }

1
app/src/main/java/org/transdroid/core/gui/lists/SimpleListItem.java

@ -19,6 +19,7 @@ package org.transdroid.core.gui.lists;
/** /**
* Represents a filter item as shown in the navigation list or spinner. * Represents a filter item as shown in the navigation list or spinner.
*
* @author Eric Kok * @author Eric Kok
*/ */
public interface SimpleListItem { public interface SimpleListItem {

3
app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemAdapter.java

@ -37,6 +37,7 @@ public class SimpleListItemAdapter extends BaseAdapter {
/** /**
* Allows updating of the full data list underlying this adapter, replacing all items * Allows updating of the full data list underlying this adapter, replacing all items
*
* @param newItems The new list of simple list items to display * @param newItems The new list of simple list items to display
*/ */
public void update(List<? extends SimpleListItem> newItems) { public void update(List<? extends SimpleListItem> newItems) {
@ -78,6 +79,7 @@ public class SimpleListItemAdapter extends BaseAdapter {
/** /**
* Represents a very simple list item that only contains a single string to show in the list. Use wrapStringsList to * Represents a very simple list item that only contains a single string to show in the list. Use wrapStringsList to
* wrap an existing list of strings into a list of {@link SimpleListItem}s. * wrap an existing list of strings into a list of {@link SimpleListItem}s.
*
* @author Eric Kok * @author Eric Kok
*/ */
public static class SimpleStringItem implements SimpleListItem { public static class SimpleStringItem implements SimpleListItem {
@ -85,6 +87,7 @@ public class SimpleListItemAdapter extends BaseAdapter {
/** /**
* Wraps a simple string of strings into a list of SimpleStringItem to add as data to a * Wraps a simple string of strings into a list of SimpleStringItem to add as data to a
* {@link SimpleListItemAdapter} * {@link SimpleListItemAdapter}
*
* @param strings A list of string * @param strings A list of string
* @return A list of SimpleStringItem objects representing the input strings * @return A list of SimpleStringItem objects representing the input strings
*/ */

2
app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemSpinnerAdapter.java

@ -27,6 +27,7 @@ import android.widget.TextView;
/** /**
* A wrapper around {@link ArrayAdapter} that contains {@link SimpleListItem}s which simply show their name in the * A wrapper around {@link ArrayAdapter} that contains {@link SimpleListItem}s which simply show their name in the
* Spinner. The standard Android spinner resources are used for the layout. * Spinner. The standard Android spinner resources are used for the layout.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class SimpleListItemSpinnerAdapter<T extends SimpleListItem> extends ArrayAdapter<T> { public class SimpleListItemSpinnerAdapter<T extends SimpleListItem> extends ArrayAdapter<T> {
@ -34,6 +35,7 @@ public class SimpleListItemSpinnerAdapter<T extends SimpleListItem> extends Arra
/** /**
* Constructs the adapter, supplying the {@link SimpleListItem}s to show in the spinner. The given resource will be * Constructs the adapter, supplying the {@link SimpleListItem}s to show in the spinner. The given resource will be
* ignored as the standard Android Spinner layout is used instead. * ignored as the standard Android Spinner layout is used instead.
*
* @param context The UI context to inflate the layout in * @param context The UI context to inflate the layout in
* @param resource This is ignored; android.R.layout.simple_spinner_item is always used instead * @param resource This is ignored; android.R.layout.simple_spinner_item is always used instead
* @param objects The items to show in the spinner, which can simply display some name * @param objects The items to show in the spinner, which can simply display some name

1
app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemView.java

@ -26,6 +26,7 @@ import org.transdroid.R;
/** /**
* View that represents some {@link SimpleListItem} object and simple prints out the text (in proper style) * View that represents some {@link SimpleListItem} object and simple prints out the text (in proper style)
*
* @author Eric Kok * @author Eric Kok
*/ */
@EViewGroup(R.layout.list_item_simple) @EViewGroup(R.layout.list_item_simple)

3
app/src/main/java/org/transdroid/core/gui/lists/SortByListItem.java

@ -17,11 +17,13 @@
package org.transdroid.core.gui.lists; package org.transdroid.core.gui.lists;
import android.content.Context; import android.content.Context;
import org.transdroid.R; import org.transdroid.R;
import org.transdroid.daemon.TorrentsSortBy; import org.transdroid.daemon.TorrentsSortBy;
/** /**
* Represents a way in which a torrents list can be sorted. * Represents a way in which a torrents list can be sorted.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class SortByListItem implements SimpleListItem { public class SortByListItem implements SimpleListItem {
@ -64,6 +66,7 @@ public class SortByListItem implements SimpleListItem {
/** /**
* Returns the contained represented sort order. * Returns the contained represented sort order.
*
* @return The sort by order as its enumeration value * @return The sort by order as its enumeration value
*/ */
public TorrentsSortBy getSortBy() { public TorrentsSortBy getSortBy() {

2
app/src/main/java/org/transdroid/core/gui/lists/TorrentDetailsView.java

@ -32,6 +32,7 @@ import org.transdroid.daemon.util.FileSizeConverter;
/** /**
* Represents a group of views that show torrent status, sizes, speeds and other details. * Represents a group of views that show torrent status, sizes, speeds and other details.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EViewGroup(R.layout.fragment_details_header) @EViewGroup(R.layout.fragment_details_header)
@ -49,6 +50,7 @@ public class TorrentDetailsView extends RelativeLayout {
/** /**
* Update the text fields with new/updated torrent details * Update the text fields with new/updated torrent details
*
* @param torrent The torrent for which to show details * @param torrent The torrent for which to show details
*/ */
public void update(Torrent torrent) { public void update(Torrent torrent) {

1
app/src/main/java/org/transdroid/core/gui/lists/TorrentFilePriorityLayout.java

@ -30,6 +30,7 @@ import android.widget.RelativeLayout;
* A relative layout that that is checkable (to be used in a contextual action bar) and shows a coloured bar in the far * A relative layout that that is checkable (to be used in a contextual action bar) and shows a coloured bar in the far
* left indicating the priority of the represented file. The darker the green, the higher the priority, while grey means * left indicating the priority of the represented file. The darker the green, the higher the priority, while grey means
* the file isn't downloaded at all. * the file isn't downloaded at all.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class TorrentFilePriorityLayout extends RelativeLayout { public class TorrentFilePriorityLayout extends RelativeLayout {

1
app/src/main/java/org/transdroid/core/gui/lists/TorrentFileView.java

@ -26,6 +26,7 @@ import org.transdroid.daemon.TorrentFile;
/** /**
* View that represents some {@link TorrentFile} object and show the file's name, status and priority * View that represents some {@link TorrentFile} object and show the file's name, status and priority
*
* @author Eric Kok * @author Eric Kok
*/ */
@EViewGroup(R.layout.list_item_torrentfile) @EViewGroup(R.layout.list_item_torrentfile)

2
app/src/main/java/org/transdroid/core/gui/lists/TorrentStatusLayout.java

@ -30,6 +30,7 @@ import android.widget.RelativeLayout;
* A relative layout that is checkable (to be used in a contextual action bar) and shows a coloured bar in the far left * A relative layout that is checkable (to be used in a contextual action bar) and shows a coloured bar in the far left
* indicating the status of the represented torrent. Active downloads are blue, seeding torrents are green, errors are * indicating the status of the represented torrent. Active downloads are blue, seeding torrents are green, errors are
* red, etc. * red, etc.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class TorrentStatusLayout extends RelativeLayout { public class TorrentStatusLayout extends RelativeLayout {
@ -68,6 +69,7 @@ public class TorrentStatusLayout extends RelativeLayout {
/** /**
* Registers the status of the represented torrent and invalidates the view so the status colour will be updated * Registers the status of the represented torrent and invalidates the view so the status colour will be updated
* accordingly. * accordingly.
*
* @param status The updated torrent status to show * @param status The updated torrent status to show
*/ */
public void setStatus(TorrentStatus status) { public void setStatus(TorrentStatus status) {

1
app/src/main/java/org/transdroid/core/gui/lists/TorrentView.java

@ -29,6 +29,7 @@ import org.transdroid.daemon.TorrentStatus;
/** /**
* View that represents some {@link Torrent} object and displays progress, status, speeds, etc. * View that represents some {@link Torrent} object and displays progress, status, speeds, etc.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EViewGroup(R.layout.list_item_torrent) @EViewGroup(R.layout.list_item_torrent)

2
app/src/main/java/org/transdroid/core/gui/lists/TorrentsAdapter.java

@ -29,6 +29,7 @@ import java.util.ArrayList;
/** /**
* Adapter that contains a list of torrent objects to show. * Adapter that contains a list of torrent objects to show.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EBean @EBean
@ -41,6 +42,7 @@ public class TorrentsAdapter extends BaseAdapter {
/** /**
* Allows updating the full internal list of torrents at once, replacing the old list * Allows updating the full internal list of torrents at once, replacing the old list
*
* @param newTorrents The new list of torrent objects * @param newTorrents The new list of torrent objects
*/ */
public void update(ArrayList<Torrent> newTorrents) { public void update(ArrayList<Torrent> newTorrents) {

4
app/src/main/java/org/transdroid/core/gui/lists/ViewHolderAdapter.java

@ -28,6 +28,7 @@ import android.widget.ListView;
* the view object. This is required since otherwise the adapter's consumer (i.e. a {@link ListView}) does not update * the view object. This is required since otherwise the adapter's consumer (i.e. a {@link ListView}) does not update
* the list row accordingly. Use {@link #setViewEnabled(boolean)} to enable or disable this contained view for user * the list row accordingly. Use {@link #setViewEnabled(boolean)} to enable or disable this contained view for user
* interaction. * interaction.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class ViewHolderAdapter extends BaseAdapter { public class ViewHolderAdapter extends BaseAdapter {
@ -38,6 +39,7 @@ public class ViewHolderAdapter extends BaseAdapter {
* Instantiates this wrapper adapter with the one and only view to show. It can not be updated and view visibility * Instantiates this wrapper adapter with the one and only view to show. It can not be updated and view visibility
* should be set directly on this adapter using {@link #setViewVisibility(int)}. Use * should be set directly on this adapter using {@link #setViewVisibility(int)}. Use
* {@link #setViewEnabled(boolean)} to enable or disable this contained view for user interaction. * {@link #setViewEnabled(boolean)} to enable or disable this contained view for user interaction.
*
* @param view The view that will be wrapper in an adapter to show in a list view * @param view The view that will be wrapper in an adapter to show in a list view
*/ */
public ViewHolderAdapter(View view) { public ViewHolderAdapter(View view) {
@ -47,6 +49,7 @@ public class ViewHolderAdapter extends BaseAdapter {
/** /**
* Sets the visibility on the contained view and notifies consumers of this adapter (i.e. a {@link ListView}) * Sets the visibility on the contained view and notifies consumers of this adapter (i.e. a {@link ListView})
* accordingly. Use {@link View#GONE} to hide this adapter's view altogether. * accordingly. Use {@link View#GONE} to hide this adapter's view altogether.
*
* @param visibility The visibility to set on the contained view * @param visibility The visibility to set on the contained view
*/ */
public void setViewVisibility(int visibility) { public void setViewVisibility(int visibility) {
@ -57,6 +60,7 @@ public class ViewHolderAdapter extends BaseAdapter {
/** /**
* Sets whether the contained view should be enabled and notifies consumers of this adapter (i.e. a {@link ListView} * Sets whether the contained view should be enabled and notifies consumers of this adapter (i.e. a {@link ListView}
* ) accordingly. A contained enabled view allows user interaction (clicks, focus), while a disabled view does not. * ) accordingly. A contained enabled view allows user interaction (clicks, focus), while a disabled view does not.
*
* @param enabled Whether the contained view should be enabled * @param enabled Whether the contained view should be enabled
*/ */
public void setViewEnabled(boolean enabled) { public void setViewEnabled(boolean enabled) {

3
app/src/main/java/org/transdroid/core/gui/log/DatabaseHelper.java

@ -20,7 +20,9 @@ import java.sql.SQLException;
import android.content.Context; import android.content.Context;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import androidx.annotation.Keep; import androidx.annotation.Keep;
import android.util.Log; import android.util.Log;
import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper; import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
@ -29,6 +31,7 @@ import com.j256.ormlite.table.TableUtils;
/** /**
* Helper to access the database to access persisting objects. * Helper to access the database to access persisting objects.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class DatabaseHelper extends OrmLiteSqliteOpenHelper { public class DatabaseHelper extends OrmLiteSqliteOpenHelper {

1
app/src/main/java/org/transdroid/core/gui/log/ErrorLogEntry.java

@ -26,6 +26,7 @@ import com.j256.ormlite.table.DatabaseTable;
/** /**
* Represents an error log entry to be registered in the database. * Represents an error log entry to be registered in the database.
*
* @author Eric Kok * @author Eric Kok
*/ */
@DatabaseTable(tableName = "ErrorLogEntry") @DatabaseTable(tableName = "ErrorLogEntry")

1
app/src/main/java/org/transdroid/core/gui/log/Log.java

@ -28,6 +28,7 @@ import java.util.Date;
/** /**
* Application-wide logging class that registers entries in the database (for a certain time). * Application-wide logging class that registers entries in the database (for a certain time).
*
* @author Eric Kok * @author Eric Kok
*/ */
@EBean(scope = Scope.Singleton) @EBean(scope = Scope.Singleton)

4
app/src/main/java/org/transdroid/core/gui/navigation/DialogHelper.java

@ -36,6 +36,7 @@ import android.view.Window;
* Helper class that show a dialog either as pop-up or as full screen activity. Should be used by calling * Helper class that show a dialog either as pop-up or as full screen activity. Should be used by calling
* {@link #showDialog(Context, DialogSpecification)} with in instance of the dialog specification that should be shown, * {@link #showDialog(Context, DialogSpecification)} with in instance of the dialog specification that should be shown,
* from the calling activity's {@link Activity#onCreateDialog(int)}. * from the calling activity's {@link Activity#onCreateDialog(int)}.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EActivity @EActivity
@ -71,6 +72,7 @@ public class DialogHelper extends Activity {
/** /**
* Call this from {@link Activity#onCreateDialog(int)}, supplying an instance of the {@link DialogSpecification} * Call this from {@link Activity#onCreateDialog(int)}, supplying an instance of the {@link DialogSpecification}
* that should be shown to the user. * that should be shown to the user.
*
* @param context The activity that calls this method and which will own the constructed dialog * @param context The activity that calls this method and which will own the constructed dialog
* @param dialog An instance of the specification for the dialog that needs to be shown * @param dialog An instance of the specification for the dialog that needs to be shown
* @return Either an instance of a {@link Dialog} that the activity should further control or null if the dialog * @return Either an instance of a {@link Dialog} that the activity should further control or null if the dialog
@ -106,7 +108,9 @@ public class DialogHelper extends Activity {
*/ */
public interface DialogSpecification extends Serializable { public interface DialogSpecification extends Serializable {
int getDialogLayoutId(); int getDialogLayoutId();
int getDialogMenuId(); int getDialogMenuId();
boolean onMenuItemSelected(Activity ownerActivity, int selectedItemId); boolean onMenuItemSelected(Activity ownerActivity, int selectedItemId);
} }

4
app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java

@ -33,6 +33,7 @@ import java.util.List;
/** /**
* List adapter that holds filter items, that is, servers, view types and labels. A header item is inserted where appropriate. * List adapter that holds filter items, that is, servers, view types and labels. A header item is inserted where appropriate.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EBean @EBean
@ -49,6 +50,7 @@ public class FilterListAdapter extends MergeAdapter {
/** /**
* Update the list of available servers * Update the list of available servers
*
* @param servers The new list of available servers * @param servers The new list of available servers
*/ */
public void updateServers(List<ServerSetting> servers) { public void updateServers(List<ServerSetting> servers) {
@ -70,6 +72,7 @@ public class FilterListAdapter extends MergeAdapter {
/** /**
* Update the list of available status types * Update the list of available status types
*
* @param statusTypes The new list of available status types * @param statusTypes The new list of available status types
*/ */
public void updateStatusTypes(List<StatusTypeFilter> statusTypes) { public void updateStatusTypes(List<StatusTypeFilter> statusTypes) {
@ -91,6 +94,7 @@ public class FilterListAdapter extends MergeAdapter {
/** /**
* Update the list of available labels * Update the list of available labels
*
* @param labels The new list of available labels * @param labels The new list of available labels
*/ */
public void updateLabels(List<Label> labels) { public void updateLabels(List<Label> labels) {

1
app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemAdapter.java

@ -38,6 +38,7 @@ public class FilterListItemAdapter extends BaseAdapter {
/** /**
* Allows updating of the full data list underlying this adapter, replacing all items * Allows updating of the full data list underlying this adapter, replacing all items
*
* @param newItems The new list of filter items to display * @param newItems The new list of filter items to display
*/ */
public void update(List<? extends SimpleListItem> newItems) { public void update(List<? extends SimpleListItem> newItems) {

1
app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemView.java

@ -27,6 +27,7 @@ import org.transdroid.core.gui.lists.SimpleListItem;
/** /**
* View that represents some {@link SimpleListItem} object specifically used to represent a navigation filter item. * View that represents some {@link SimpleListItem} object specifically used to represent a navigation filter item.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EViewGroup(R.layout.list_item_filter) @EViewGroup(R.layout.list_item_filter)

2
app/src/main/java/org/transdroid/core/gui/navigation/FilterSeparatorView.java

@ -27,6 +27,7 @@ import org.transdroid.R;
/** /**
* A list item that shows a sub header or separator (in underlined Holo style). * A list item that shows a sub header or separator (in underlined Holo style).
*
* @author Eric Kok * @author Eric Kok
*/ */
@EViewGroup(R.layout.list_item_separator) @EViewGroup(R.layout.list_item_separator)
@ -43,6 +44,7 @@ public class FilterSeparatorView extends FrameLayout {
/** /**
* Sets the text that will be shown in this separator (sub header) * Sets the text that will be shown in this separator (sub header)
*
* @param text The new text to show * @param text The new text to show
* @return Itself, for convenience of method chaining * @return Itself, for convenience of method chaining
*/ */

3
app/src/main/java/org/transdroid/core/gui/navigation/Label.java

@ -29,6 +29,7 @@ import java.util.List;
/** /**
* Represents some label that is active or available on the server. * Represents some label that is active or available on the server.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class Label implements SimpleListItem, NavigationFilter, Comparable<Label> { public class Label implements SimpleListItem, NavigationFilter, Comparable<Label> {
@ -73,6 +74,7 @@ public class Label implements SimpleListItem, NavigationFilter, Comparable<Label
/** /**
* Returns true if the torrent label's name matches this (selected) label's name, false otherwise * Returns true if the torrent label's name matches this (selected) label's name, false otherwise
*
* @param torrent The torrent to match against this label * @param torrent The torrent to match against this label
* @param dormantAsInactive This property is ignored for label comparisons * @param dormantAsInactive This property is ignored for label comparisons
*/ */
@ -91,6 +93,7 @@ public class Label implements SimpleListItem, NavigationFilter, Comparable<Label
/** /**
* Converts a list of labels as retrieved from a server daemon into a list of labels that can be used in the UI as navigation filters. * Converts a list of labels as retrieved from a server daemon into a list of labels that can be used in the UI as navigation filters.
*
* @param daemonLabels The raw list of labels as received from the server daemon adapter * @param daemonLabels The raw list of labels as received from the server daemon adapter
* @param unnamedLabel The text to show for the empty label (i.e. the unnamed label) * @param unnamedLabel The text to show for the empty label (i.e. the unnamed label)
* @return A label items that can be used in a filter list such as the action bar spinner * @return A label items that can be used in a filter list such as the action bar spinner

4
app/src/main/java/org/transdroid/core/gui/navigation/NavigationFilter.java

@ -22,6 +22,7 @@ import org.transdroid.daemon.Torrent;
/** /**
* Represents a filter, used in the app navigation, that can check if some torrent matches the user-set filter * Represents a filter, used in the app navigation, that can check if some torrent matches the user-set filter
*
* @author Eric Kok * @author Eric Kok
*/ */
public interface NavigationFilter extends Parcelable { public interface NavigationFilter extends Parcelable {
@ -29,6 +30,7 @@ public interface NavigationFilter extends Parcelable {
/** /**
* Implementations should check if the supplied torrent matches the filter; for example a label filter should return true if the torrent's label * Implementations should check if the supplied torrent matches the filter; for example a label filter should return true if the torrent's label
* equals this items label name. * equals this items label name.
*
* @param torrent The torrent to check for matches * @param torrent The torrent to check for matches
* @param dormantAsInactive If true, dormant (0KB/s, so no data transfer) torrents are never actively downloading or seeding * @param dormantAsInactive If true, dormant (0KB/s, so no data transfer) torrents are never actively downloading or seeding
* @return True if the torrent matches the filter and should be shown in the current screen, false otherwise * @return True if the torrent matches the filter and should be shown in the current screen, false otherwise
@ -37,12 +39,14 @@ public interface NavigationFilter extends Parcelable {
/** /**
* Implementations should return a name that can be shown to indicate the active filter * Implementations should return a name that can be shown to indicate the active filter
*
* @return The name of the filter item as string * @return The name of the filter item as string
*/ */
String getName(); String getName();
/** /**
* Implementations should return a code that (within reasonable expectations) uniquely identifies it in the list of navigation filters * Implementations should return a code that (within reasonable expectations) uniquely identifies it in the list of navigation filters
*
* @return The code to uniquely identify this specific navigation filter, such as the name with a class name prefix * @return The code to uniquely identify this specific navigation filter, such as the name with a class name prefix
*/ */
String getCode(); String getCode();

12
app/src/main/java/org/transdroid/core/gui/navigation/NavigationHelper.java

@ -26,9 +26,11 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import android.text.Spannable; import android.text.Spannable;
import android.text.SpannableString; import android.text.SpannableString;
import android.text.style.TypefaceSpan; import android.text.style.TypefaceSpan;
@ -54,6 +56,7 @@ import java.util.List;
/** /**
* Helper for activities to make navigation-related decisions, such as when a device can display a larger, tablet style layout or how to display * Helper for activities to make navigation-related decisions, such as when a device can display a larger, tablet style layout or how to display
* errors. * errors.
*
* @author Eric Kok * @author Eric Kok
*/ */
@SuppressLint("ResourceAsColor") @SuppressLint("ResourceAsColor")
@ -140,6 +143,7 @@ public class NavigationHelper {
/** /**
* Converts a string into a {@link Spannable} that displays the string in the Roboto Condensed font * Converts a string into a {@link Spannable} that displays the string in the Roboto Condensed font
*
* @param string A plain text {@link String} * @param string A plain text {@link String}
* @return A {@link Spannable} that can be applied to supporting views (such as the action bar title) so that the input string will be displayed * @return A {@link Spannable} that can be applied to supporting views (such as the action bar title) so that the input string will be displayed
* using the Roboto Condensed font (if the OS has this) * using the Roboto Condensed font (if the OS has this)
@ -155,6 +159,7 @@ public class NavigationHelper {
/** /**
* Analyses a torrent http or magnet URI and tries to come up with a reasonable human-readable name. * Analyses a torrent http or magnet URI and tries to come up with a reasonable human-readable name.
*
* @param rawTorrentUri The raw http:// or magnet: link to the torrent * @param rawTorrentUri The raw http:// or magnet: link to the torrent
* @return A best-guess, reasonably long name for the linked torrent * @return A best-guess, reasonably long name for the linked torrent
*/ */
@ -204,6 +209,7 @@ public class NavigationHelper {
/** /**
* Returns (and initialises, if needed) an image cache that uses memory and (1MB) local storage. * Returns (and initialises, if needed) an image cache that uses memory and (1MB) local storage.
*
* @return An image cache that loads web images synchronously and transparently * @return An image cache that loads web images synchronously and transparently
*/ */
public ImageLoader getImageCache() { public ImageLoader getImageCache() {
@ -250,6 +256,7 @@ public class NavigationHelper {
/** /**
* Returns the application name (like Transdroid) and version name (like 1.5.0), appended by the version code (like 180). * Returns the application name (like Transdroid) and version name (like 1.5.0), appended by the version code (like 180).
*
* @return The app name and version, such as 'Transdroid 1.5.0 (180)' * @return The app name and version, such as 'Transdroid 1.5.0 (180)'
*/ */
public String getAppNameAndVersion() { public String getAppNameAndVersion() {
@ -259,6 +266,7 @@ public class NavigationHelper {
/** /**
* Returns whether the device is considered small (i.e. a phone) rather than large (i.e. a tablet). Can, for example, be used to determine if a * Returns whether the device is considered small (i.e. a phone) rather than large (i.e. a tablet). Can, for example, be used to determine if a
* dialog should be shown full screen. Currently is true if the device's smallest dimension is 500 dip. * dialog should be shown full screen. Currently is true if the device's smallest dimension is 500 dip.
*
* @return True if the app runs on a small device, false otherwise * @return True if the app runs on a small device, false otherwise
*/ */
public boolean isSmallScreen() { public boolean isSmallScreen() {
@ -268,6 +276,7 @@ public class NavigationHelper {
/** /**
* Whether any search-related UI components should be shown in the interface. At the moment returns false only if we run as Transdroid Lite * Whether any search-related UI components should be shown in the interface. At the moment returns false only if we run as Transdroid Lite
* version. * version.
*
* @return True if search is enabled, false otherwise * @return True if search is enabled, false otherwise
*/ */
public boolean enableSearchUi() { public boolean enableSearchUi() {
@ -276,6 +285,7 @@ public class NavigationHelper {
/** /**
* Whether any RSS-related UI components should be shown in the interface. At the moment returns false only if we run as Transdroid Lite version. * Whether any RSS-related UI components should be shown in the interface. At the moment returns false only if we run as Transdroid Lite version.
*
* @return True if search is enabled, false otherwise * @return True if search is enabled, false otherwise
*/ */
public boolean enableRssUi() { public boolean enableRssUi() {
@ -285,6 +295,7 @@ public class NavigationHelper {
/** /**
* Returns whether any seedbox-related components should be shown in the interface; specifically the option to add server settings via easy * Returns whether any seedbox-related components should be shown in the interface; specifically the option to add server settings via easy
* seedbox-specific screens. * seedbox-specific screens.
*
* @return True if seedbox settings should be shown, false otherwise * @return True if seedbox settings should be shown, false otherwise
*/ */
public boolean enableSeedboxes() { public boolean enableSeedboxes() {
@ -293,6 +304,7 @@ public class NavigationHelper {
/** /**
* Whether the custom app update checker should be used to check for new app and search module versions. * Whether the custom app update checker should be used to check for new app and search module versions.
*
* @return True if it should be checked against transdroid.org if there are app updates (as opposed to using the Play Store for updates, for * @return True if it should be checked against transdroid.org if there are app updates (as opposed to using the Play Store for updates, for
* example), false otherwise * example), false otherwise
*/ */

1
app/src/main/java/org/transdroid/core/gui/navigation/RefreshableActivity.java

@ -18,6 +18,7 @@ package org.transdroid.core.gui.navigation;
/** /**
* Interface to be implemented by any activity that allows its content to be refreshed; fragments can ask for user-initiated refreshes. * Interface to be implemented by any activity that allows its content to be refreshed; fragments can ask for user-initiated refreshes.
*
* @author Eric Kok * @author Eric Kok
*/ */
public interface RefreshableActivity { public interface RefreshableActivity {

3
app/src/main/java/org/transdroid/core/gui/navigation/SelectionManagerMode.java

@ -32,6 +32,7 @@ import android.widget.ListView;
* A helper to implement {@link ListView} selection modification behaviour with the {@link SelectionModificationSpinner} * A helper to implement {@link ListView} selection modification behaviour with the {@link SelectionModificationSpinner}
* by implementing the specific actions and providing a title based on the number of currently selected items. It is * by implementing the specific actions and providing a title based on the number of currently selected items. It is
* important that the provided list was instantiated already. * important that the provided list was instantiated already.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class SelectionManagerMode implements MultiChoiceModeListener, OnModificationActionSelectedListener { public class SelectionManagerMode implements MultiChoiceModeListener, OnModificationActionSelectedListener {
@ -44,6 +45,7 @@ public class SelectionManagerMode implements MultiChoiceModeListener, OnModifica
/** /**
* Instantiates the helper by binding it to a specific {@link ListView} and providing the text resource to display * Instantiates the helper by binding it to a specific {@link ListView} and providing the text resource to display
* as title in the spinner. * as title in the spinner.
*
* @param themedContext The context which is associated with the correct theme to apply when inflating views, i.e. the toolbar context * @param themedContext The context which is associated with the correct theme to apply when inflating views, i.e. the toolbar context
* @param managedList The list to manage the selection for and execute selection action to * @param managedList The list to manage the selection for and execute selection action to
* @param titleTemplateResource The string resource id to show as the spinners title; the number of selected items * @param titleTemplateResource The string resource id to show as the spinners title; the number of selected items
@ -58,6 +60,7 @@ public class SelectionManagerMode implements MultiChoiceModeListener, OnModifica
/** /**
* Set the class type of items that are allowed to be checked in the {@link ListView}. Defaults to null, which means * Set the class type of items that are allowed to be checked in the {@link ListView}. Defaults to null, which means
* every list view row can be checked. * every list view row can be checked.
*
* @param onlyCheckClass The {@link Class} instance to use to check list item types against * @param onlyCheckClass The {@link Class} instance to use to check list item types against
*/ */
public void setOnlyCheckClass(Class<?> onlyCheckClass) { public void setOnlyCheckClass(Class<?> onlyCheckClass) {

6
app/src/main/java/org/transdroid/core/gui/navigation/SelectionModificationSpinner.java

@ -28,6 +28,7 @@ import android.widget.TextView;
/** /**
* Spinner that holds actions that can be performed on list selections. The spinner itself has some title, which can for * Spinner that holds actions that can be performed on list selections. The spinner itself has some title, which can for
* example be used to show the number of selected items. * example be used to show the number of selected items.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class SelectionModificationSpinner extends Spinner { public class SelectionModificationSpinner extends Spinner {
@ -37,6 +38,7 @@ public class SelectionModificationSpinner extends Spinner {
/** /**
* Instantiates a spinner that contains some fixed actions for a user to modify selections. * Instantiates a spinner that contains some fixed actions for a user to modify selections.
*
* @param context The interface context where the spinner will be shown in * @param context The interface context where the spinner will be shown in
*/ */
public SelectionModificationSpinner(Context context) { public SelectionModificationSpinner(Context context) {
@ -47,6 +49,7 @@ public class SelectionModificationSpinner extends Spinner {
/** /**
* Updates the fixed title text shown in the spinner, regardless of spinner item action selection. * Updates the fixed title text shown in the spinner, regardless of spinner item action selection.
*
* @param title The new static string to show, such as the number of selected items * @param title The new static string to show, such as the number of selected items
*/ */
public void updateTitle(String title) { public void updateTitle(String title) {
@ -56,6 +59,7 @@ public class SelectionModificationSpinner extends Spinner {
/** /**
* Sets the listener for action selection events. * Sets the listener for action selection events.
*
* @param onModificationActionSelected The listener that handles performing of the actions as selected in this * @param onModificationActionSelected The listener that handles performing of the actions as selected in this
* spinner by the user * spinner by the user
*/ */
@ -110,7 +114,9 @@ public class SelectionModificationSpinner extends Spinner {
*/ */
public interface OnModificationActionSelectedListener { public interface OnModificationActionSelectedListener {
public void selectAll(); public void selectAll();
public void selectFinished(); public void selectFinished();
public void invertSelection(); public void invertSelection();
} }

1
app/src/main/java/org/transdroid/core/gui/navigation/SetLabelDialog.java

@ -39,6 +39,7 @@ public class SetLabelDialog {
/** /**
* A dialog fragment that allows picking a label or entering a new label to set this new label to the torrent. * A dialog fragment that allows picking a label or entering a new label to set this new label to the torrent.
*
* @param context The activity context that opens (and owns) this dialog * @param context The activity context that opens (and owns) this dialog
* @param onLabelPickedListener The callback when a new label has been entered or picked by the user * @param onLabelPickedListener The callback when a new label has been entered or picked by the user
* @param currentLabels The list of labels as currently exist on the server, to present as list for easy selection * @param currentLabels The list of labels as currently exist on the server, to present as list for easy selection

1
app/src/main/java/org/transdroid/core/gui/navigation/SetStorageLocationDialog.java

@ -30,6 +30,7 @@ public class SetStorageLocationDialog {
/** /**
* A dialog fragment that allows changing of the storage location by editing the path text directly. * A dialog fragment that allows changing of the storage location by editing the path text directly.
*
* @param context The activity context that opens (and owns) this dialog * @param context The activity context that opens (and owns) this dialog
* @param onStorageLocationUpdatedListener The callback for when the user is done updating the storage location * @param onStorageLocationUpdatedListener The callback for when the user is done updating the storage location
* @param currentLocation The current storage location that will be available to the user to edit * @param currentLocation The current storage location that will be available to the user to edit

1
app/src/main/java/org/transdroid/core/gui/navigation/SetTrackersDialog.java

@ -34,6 +34,7 @@ public class SetTrackersDialog extends DialogFragment {
/** /**
* A dialog fragment that allows changing the trackers of a torrent by editing the text directly. * A dialog fragment that allows changing the trackers of a torrent by editing the text directly.
*
* @param context The activity context that opens (and owns) this dialog * @param context The activity context that opens (and owns) this dialog
* @param onTrackersUpdatedListener The callback for when the user is done updating the trackers list * @param onTrackersUpdatedListener The callback for when the user is done updating the trackers list
* @param currentTrackers The current trackers text/list that will be available to the user to edit * @param currentTrackers The current trackers text/list that will be available to the user to edit

1
app/src/main/java/org/transdroid/core/gui/navigation/SetTransferRatesDialog.java

@ -32,6 +32,7 @@ public class SetTransferRatesDialog {
/** /**
* A dialog fragment that allow picking of maximum download and upload transfer rates as well as the resetting of these values. * A dialog fragment that allow picking of maximum download and upload transfer rates as well as the resetting of these values.
*
* @param context The activity context that opens (and owns) this dialog * @param context The activity context that opens (and owns) this dialog
* @param onRatesPickedListener The callback for results in this dialog (with newly selected values or a reset) * @param onRatesPickedListener The callback for results in this dialog (with newly selected values or a reset)
*/ */

5
app/src/main/java/org/transdroid/core/gui/navigation/StatusType.java

@ -29,6 +29,7 @@ import android.os.Parcelable;
/** /**
* Enumeration of all status types, which filter the list of shown torrents based on transfer activity. * Enumeration of all status types, which filter the list of shown torrents based on transfer activity.
*
* @author Eric Kok * @author Eric Kok
*/ */
public enum StatusType { public enum StatusType {
@ -61,6 +62,7 @@ public enum StatusType {
/** /**
* Returns the status type to show all torrents, represented as filter item to show in the navigation list. * Returns the status type to show all torrents, represented as filter item to show in the navigation list.
*
* @param context The Android UI context, to access translations * @param context The Android UI context, to access translations
* @return The show ShowAll status type filter item * @return The show ShowAll status type filter item
*/ */
@ -70,6 +72,7 @@ public enum StatusType {
/** /**
* Returns a list with all status types, represented as filter item that can be shown in the GUI. * Returns a list with all status types, represented as filter item that can be shown in the GUI.
*
* @param context The Android UI context, to access translations * @param context The Android UI context, to access translations
* @return A list of filter items for all available status types * @return A list of filter items for all available status types
*/ */
@ -81,6 +84,7 @@ public enum StatusType {
/** /**
* Every status type can return a filter item that represents it in the navigation * Every status type can return a filter item that represents it in the navigation
*
* @param context The Android UI context, to access translations * @param context The Android UI context, to access translations
* @return A filter item object to show in the GUI * @return A filter item object to show in the GUI
*/ */
@ -113,6 +117,7 @@ public enum StatusType {
/** /**
* Returns true if the torrent status matches this (selected) status type, false otherwise * Returns true if the torrent status matches this (selected) status type, false otherwise
*
* @param torrent The torrent to match against this status type * @param torrent The torrent to match against this status type
* @param dormantAsInactive If true, dormant (0KB/s, so no data transfer) torrents are never actively * @param dormantAsInactive If true, dormant (0KB/s, so no data transfer) torrents are never actively
* downloading or seeding * downloading or seeding

5
app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssFragment.java

@ -18,6 +18,7 @@ package org.transdroid.core.gui.remoterss;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import android.view.View; import android.view.View;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.ListView; import android.widget.ListView;
@ -44,6 +45,7 @@ import java.util.List;
/** /**
* Fragment that shows a list of RSS items from the server and allows the user * Fragment that shows a list of RSS items from the server and allows the user
* to download remotely, without having to set up RSS feeds on the Android device. * to download remotely, without having to set up RSS feeds on the Android device.
*
* @author Twig * @author Twig
*/ */
@EFragment(R.layout.fragment_remoterss) @EFragment(R.layout.fragment_remoterss)
@ -108,8 +110,7 @@ public class RemoteRssFragment extends Fragment {
// Show/hide a nice message if there are no items to show // Show/hide a nice message if there are no items to show
if (remoteRssItems.size() > 0) { if (remoteRssItems.size() > 0) {
remoteRssStatusMessage.setVisibility(View.GONE); remoteRssStatusMessage.setVisibility(View.GONE);
} } else {
else {
remoteRssStatusMessage.setVisibility(View.VISIBLE); remoteRssStatusMessage.setVisibility(View.VISIBLE);
remoteRssStatusMessage.setText(R.string.remoterss_no_files); remoteRssStatusMessage.setText(R.string.remoterss_no_files);
} }

1
app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssItemView.java

@ -28,6 +28,7 @@ import org.transdroid.core.gui.remoterss.data.RemoteRssItem;
/** /**
* View that represents some {@link RemoteRssItem} object. * View that represents some {@link RemoteRssItem} object.
*
* @author Twig * @author Twig
*/ */
@EViewGroup(R.layout.list_item_remoterssitem) @EViewGroup(R.layout.list_item_remoterssitem)

3
app/src/main/java/org/transdroid/core/gui/remoterss/RemoteRssItemsAdapter.java

@ -40,8 +40,7 @@ public class RemoteRssItemsAdapter extends BaseAdapter {
if (convertView == null) { if (convertView == null) {
itemView = RemoteRssItemView_.build(context); itemView = RemoteRssItemView_.build(context);
} } else {
else {
itemView = (RemoteRssItemView) convertView; itemView = (RemoteRssItemView) convertView;
} }

16
app/src/main/java/org/transdroid/core/gui/rss/RssFeedsActivity.java

@ -22,13 +22,17 @@ import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Parcel; import android.os.Parcel;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.material.tabs.TabLayout; import com.google.android.material.tabs.TabLayout;
import androidx.viewpager.widget.PagerAdapter; import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager; import androidx.viewpager.widget.ViewPager;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -130,8 +134,7 @@ public class RssFeedsActivity extends AppCompatActivity {
if (position == RSS_FEEDS_LOCAL) { if (position == RSS_FEEDS_LOCAL) {
resId = R.id.layout_rssfeeds_local; resId = R.id.layout_rssfeeds_local;
} } else if (position == RSS_FEEDS_REMOTE) {
else if (position == RSS_FEEDS_REMOTE) {
resId = R.id.layout_rss_feeds_remote; resId = R.id.layout_rss_feeds_remote;
} }
@ -196,7 +199,8 @@ public class RssFeedsActivity extends AppCompatActivity {
try { try {
hasRemoteFeeds = remoteConnection.getRemoteRssChannels(log).size() > 0; hasRemoteFeeds = remoteConnection.getRemoteRssChannels(log).size() > 0;
} catch (DaemonException e) {} } catch (DaemonException e) {
}
if (hasRemoteFeeds) { if (hasRemoteFeeds) {
defaultTab = RSS_FEEDS_REMOTE; defaultTab = RSS_FEEDS_REMOTE;
@ -234,6 +238,7 @@ public class RssFeedsActivity extends AppCompatActivity {
/** /**
* Performs the loading of the RSS feed content and parsing of items, in a background thread. * Performs the loading of the RSS feed content and parsing of items, in a background thread.
*
* @param loader The RSS feed loader for which to retrieve the contents * @param loader The RSS feed loader for which to retrieve the contents
*/ */
@Background @Background
@ -253,6 +258,7 @@ public class RssFeedsActivity extends AppCompatActivity {
/** /**
* Stores the retrieved RSS feed content channel into the loader and updates the RSS feed in the feeds list fragment. * Stores the retrieved RSS feed content channel into the loader and updates the RSS feed in the feeds list fragment.
*
* @param loader The RSS feed loader that was executed * @param loader The RSS feed loader that was executed
* @param channel The data that was retrieved, or null if it could not be parsed * @param channel The data that was retrieved, or null if it could not be parsed
* @param hasError True if a connection error occurred in the loading of the feed; false otherwise * @param hasError True if a connection error occurred in the loading of the feed; false otherwise
@ -267,6 +273,7 @@ public class RssFeedsActivity extends AppCompatActivity {
/** /**
* Opens an RSS feed in the dedicated fragment (if there was space in the UI) or a new {@link RssItemsActivity}. Optionally this also registers in * Opens an RSS feed in the dedicated fragment (if there was space in the UI) or a new {@link RssItemsActivity}. Optionally this also registers in
* the user preferences that the feed was now viewed, so that in the future the new items can be properly marked. * the user preferences that the feed was now viewed, so that in the future the new items can be properly marked.
*
* @param loader The RSS feed loader (with settings and the loaded content channel) to show * @param loader The RSS feed loader (with settings and the loaded content channel) to show
* @param markAsViewedNow True if the user settings should be updated to reflect this feed's last viewed date; false otherwise * @param markAsViewedNow True if the user settings should be updated to reflect this feed's last viewed date; false otherwise
*/ */
@ -386,8 +393,7 @@ public class RssFeedsActivity extends AppCompatActivity {
if (position == 0) { if (position == 0) {
fragmentRemoteFeeds.updateRemoteItems(recentItems, true); fragmentRemoteFeeds.updateRemoteItems(recentItems, true);
} } else {
else {
RemoteRssChannel channel = feeds.get(selectedFilter - 1); RemoteRssChannel channel = feeds.get(selectedFilter - 1);
fragmentRemoteFeeds.updateRemoteItems(channel.getItems(), true); fragmentRemoteFeeds.updateRemoteItems(channel.getItems(), true);
} }

2
app/src/main/java/org/transdroid/core/gui/rss/RssFeedsFragment.java

@ -17,6 +17,7 @@
package org.transdroid.core.gui.rss; package org.transdroid.core.gui.rss;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
@ -37,6 +38,7 @@ import java.util.List;
/** /**
* Fragment lists the RSS feeds the user wants to monitor and, if room, the list of items in a feed in a right pane. * Fragment lists the RSS feeds the user wants to monitor and, if room, the list of items in a feed in a right pane.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EFragment(R.layout.fragment_rssfeeds) @EFragment(R.layout.fragment_rssfeeds)

1
app/src/main/java/org/transdroid/core/gui/rss/RssItemsActivity.java

@ -20,6 +20,7 @@ import android.annotation.TargetApi;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;

4
app/src/main/java/org/transdroid/core/gui/rss/RssItemsFragment.java

@ -23,8 +23,10 @@ import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.ActionMode; import android.view.ActionMode;
import android.view.Menu; import android.view.Menu;
@ -57,6 +59,7 @@ import java.util.List;
/** /**
* Fragment that lists the items in a specific RSS feed * Fragment that lists the items in a specific RSS feed
*
* @author Eric Kok * @author Eric Kok
*/ */
@EFragment(R.layout.fragment_rssitems) @EFragment(R.layout.fragment_rssitems)
@ -197,6 +200,7 @@ public class RssItemsFragment extends Fragment {
/** /**
* Update the shown RSS items in the list. * Update the shown RSS items in the list.
*
* @param channel The loaded RSS content channel object * @param channel The loaded RSS content channel object
* @param hasError True if there were errors in loading the channel, in which case an error text is shown; false otherwise * @param hasError True if there were errors in loading the channel, in which case an error text is shown; false otherwise
* @param requiresExternalAuthentication Whether this RSS feed requires external authentication and should thus be redirected to a browser * @param requiresExternalAuthentication Whether this RSS feed requires external authentication and should thus be redirected to a browser

1
app/src/main/java/org/transdroid/core/gui/rss/RssfeedLoader.java

@ -28,6 +28,7 @@ import java.util.List;
/** /**
* A container class that holds RSS feed settings and, after they have been retrieved, the contents as {@link Channel}, the number of new items and an * A container class that holds RSS feed settings and, after they have been retrieved, the contents as {@link Channel}, the number of new items and an
* indication of a connection error. * indication of a connection error.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class RssfeedLoader { public class RssfeedLoader {

1
app/src/main/java/org/transdroid/core/gui/rss/RssfeedView.java

@ -33,6 +33,7 @@ import org.transdroid.core.gui.navigation.NavigationHelper;
/** /**
* View that represents some {@link RssfeedSetting} object and displays name as well as loads a favicon for the feed's site and can load how many new * View that represents some {@link RssfeedSetting} object and displays name as well as loads a favicon for the feed's site and can load how many new
* items are available. * items are available.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EViewGroup(R.layout.list_item_rssfeed) @EViewGroup(R.layout.list_item_rssfeed)

2
app/src/main/java/org/transdroid/core/gui/rss/RssfeedsAdapter.java

@ -29,6 +29,7 @@ import java.util.List;
/** /**
* Adapter that contains a list of {@link RssfeedSetting}s, each with associated loaded RSS feed {@link org.transdroid.core.rssparser.Channel}. * Adapter that contains a list of {@link RssfeedSetting}s, each with associated loaded RSS feed {@link org.transdroid.core.rssparser.Channel}.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EBean @EBean
@ -41,6 +42,7 @@ public class RssfeedsAdapter extends BaseAdapter {
/** /**
* Allows updating the full internal list of feed loaders at once, replacing the old list * Allows updating the full internal list of feed loaders at once, replacing the old list
*
* @param loaders The new list of RSS feed loader objects, which pair settings and a loaded channel * @param loaders The new list of RSS feed loader objects, which pair settings and a loaded channel
*/ */
public void update(List<RssfeedLoader> loaders) { public void update(List<RssfeedLoader> loaders) {

1
app/src/main/java/org/transdroid/core/gui/rss/RssitemStatusLayout.java

@ -28,6 +28,7 @@ import org.transdroid.R;
/** /**
* A relative layout that that is checkable (to be used in a contextual action bar) and shows a coloured bar in the far left indicating the view * A relative layout that that is checkable (to be used in a contextual action bar) and shows a coloured bar in the far left indicating the view
* status, that is, if the item is new to the user or was viewed earlier. * status, that is, if the item is new to the user or was viewed earlier.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class RssitemStatusLayout extends RelativeLayout { public class RssitemStatusLayout extends RelativeLayout {

1
app/src/main/java/org/transdroid/core/gui/rss/RssitemView.java

@ -27,6 +27,7 @@ import org.transdroid.core.rssparser.Item;
/** /**
* View that represents some {@link Item} object, which is a single item in some RSS feed. * View that represents some {@link Item} object, which is a single item in some RSS feed.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EViewGroup(R.layout.list_item_rssitem) @EViewGroup(R.layout.list_item_rssitem)

2
app/src/main/java/org/transdroid/core/gui/rss/RssitemsAdapter.java

@ -28,6 +28,7 @@ import org.transdroid.core.rssparser.Item;
/** /**
* Adapter that contains a list of {@link Item}s in an RSS feed. * Adapter that contains a list of {@link Item}s in an RSS feed.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EBean @EBean
@ -40,6 +41,7 @@ public class RssitemsAdapter extends BaseAdapter {
/** /**
* Allows updating the full RSS feed (channel and contained items), replacing the old data * Allows updating the full RSS feed (channel and contained items), replacing the old data
*
* @param rssfeed The new RSS feed contents * @param rssfeed The new RSS feed contents
*/ */
public void update(Channel rssfeed) { public void update(Channel rssfeed) {

2
app/src/main/java/org/transdroid/core/gui/search/BarcodeHelper.java

@ -38,6 +38,7 @@ public class BarcodeHelper {
/** /**
* Call this to start a bar code scanner intent. The calling activity will receive an Intent result with the given * Call this to start a bar code scanner intent. The calling activity will receive an Intent result with the given
* request code. * request code.
*
* @param activity The calling activity, to which the result is returned or a dialog is bound that asks to install * @param activity The calling activity, to which the result is returned or a dialog is bound that asks to install
* the bar code scanner * the bar code scanner
* @param requestCode {@link #ACTIVITY_BARCODE_QRSETTINGS} * @param requestCode {@link #ACTIVITY_BARCODE_QRSETTINGS}
@ -51,6 +52,7 @@ public class BarcodeHelper {
* Call this to share content encoded in a QR code, specially used to share settings. The calling activity will * Call this to share content encoded in a QR code, specially used to share settings. The calling activity will
* receive an Intent result with ID {@link #ACTIVITY_BARCODE_QRSETTINGS}. From there the returned intent will * receive an Intent result with ID {@link #ACTIVITY_BARCODE_QRSETTINGS}. From there the returned intent will
* contain the data as SCAN_RESULT String extra. * contain the data as SCAN_RESULT String extra.
*
* @param activity The calling activity, to which the result is returned or a dialog is bound that asks to install * @param activity The calling activity, to which the result is returned or a dialog is bound that asks to install
* the bar code scanner * the bar code scanner
* @param content The content to share, that is, the raw data (Transdroid settings encoded as JSON data structure) * @param content The content to share, that is, the raw data (Transdroid settings encoded as JSON data structure)

1
app/src/main/java/org/transdroid/core/gui/search/FilePickerHelper.java

@ -37,6 +37,7 @@ public class FilePickerHelper {
/** /**
* Call this to start a file picker intent. The calling activity will receive an Intent result with ID * Call this to start a file picker intent. The calling activity will receive an Intent result with ID
* {@link #ACTIVITY_FILEPICKER} with an Intent that contains the selected local file as data Intent. * {@link #ACTIVITY_FILEPICKER} with an Intent that contains the selected local file as data Intent.
*
* @param activity The calling activity, to which the result is returned or a dialog is bound that asks to install * @param activity The calling activity, to which the result is returned or a dialog is bound that asks to install
* the file picker * the file picker
*/ */

4
app/src/main/java/org/transdroid/core/gui/search/SearchActivity.java

@ -23,9 +23,11 @@ import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.provider.SearchRecentSuggestions; import android.provider.SearchRecentSuggestions;
import androidx.core.view.MenuItemCompat; import androidx.core.view.MenuItemCompat;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
@ -58,6 +60,7 @@ import java.util.List;
/** /**
* An activity that shows search results to the user (after a query was supplied by the standard Android search manager) and either shows the list of * An activity that shows search results to the user (after a query was supplied by the standard Android search manager) and either shows the list of
* search sites on the left (e.g. on tablets) or allows switching between search sites via the action bar spinner. * search sites on the left (e.g. on tablets) or allows switching between search sites via the action bar spinner.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EActivity(R.layout.activity_search) @EActivity(R.layout.activity_search)
@ -258,6 +261,7 @@ public class SearchActivity extends AppCompatActivity {
/** /**
* Extracts the query string from the search {@link Intent} * Extracts the query string from the search {@link Intent}
*
* @return The query string that was entered by the user * @return The query string that was entered by the user
*/ */
private String parseQuery(Intent intent) { private String parseQuery(Intent intent) {

1
app/src/main/java/org/transdroid/core/gui/search/SearchHistoryProvider.java

@ -24,6 +24,7 @@ import org.transdroid.BuildConfig;
/** /**
* Provides search suggestions by simply returning previous user entries. * Provides search suggestions by simply returning previous user entries.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class SearchHistoryProvider extends SearchRecentSuggestionsProvider { public class SearchHistoryProvider extends SearchRecentSuggestionsProvider {

1
app/src/main/java/org/transdroid/core/gui/search/SearchResultView.java

@ -28,6 +28,7 @@ import android.widget.TextView;
/** /**
* View that represents a {@link SearchResult} object from an in-app search * View that represents a {@link SearchResult} object from an in-app search
*
* @author Eric Kok * @author Eric Kok
*/ */
@EViewGroup(resName = "list_item_searchresult") @EViewGroup(resName = "list_item_searchresult")

2
app/src/main/java/org/transdroid/core/gui/search/SearchResultsAdapter.java

@ -29,6 +29,7 @@ import java.util.List;
/** /**
* Adapter that contains a list of {@link SearchResult}s. * Adapter that contains a list of {@link SearchResult}s.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EBean @EBean
@ -41,6 +42,7 @@ public class SearchResultsAdapter extends BaseAdapter {
/** /**
* Allows updating the search results, replacing the old data * Allows updating the search results, replacing the old data
*
* @param results The new list of search results * @param results The new list of search results
*/ */
public void update(List<SearchResult> results) { public void update(List<SearchResult> results) {

3
app/src/main/java/org/transdroid/core/gui/search/SearchResultsFragment.java

@ -20,7 +20,9 @@ import android.app.Fragment;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.ActionMode; import android.view.ActionMode;
import android.view.Menu; import android.view.Menu;
@ -58,6 +60,7 @@ import java.util.List;
/** /**
* Fragment that lists the items in a specific RSS feed * Fragment that lists the items in a specific RSS feed
*
* @author Eric Kok * @author Eric Kok
*/ */
@EFragment(R.layout.fragment_searchresults) @EFragment(R.layout.fragment_searchresults)

2
app/src/main/java/org/transdroid/core/gui/search/SearchSetting.java

@ -22,12 +22,14 @@ public interface SearchSetting extends SimpleListItem {
/** /**
* Should return a unique key for this search setting, so that it can be compared (using equals()) to other settings. * Should return a unique key for this search setting, so that it can be compared (using equals()) to other settings.
*
* @return A unique string identifying this search setting * @return A unique string identifying this search setting
*/ */
public String getKey(); public String getKey();
/** /**
* Should return an URL (which may still be abstract and not the actual search URL) specific to the search site * Should return an URL (which may still be abstract and not the actual search URL) specific to the search site
*
* @return A clean URL directing to the search site, to, for example, get the favicon of the site * @return A clean URL directing to the search site, to, for example, get the favicon of the site
*/ */
public String getBaseUrl(); public String getBaseUrl();

1
app/src/main/java/org/transdroid/core/gui/search/SearchSettingSelectionView.java

@ -26,6 +26,7 @@ import org.transdroid.R;
/** /**
* View that shows, as part of the action bar spinner, which {@link SearchSetting} is currently chosen. * View that shows, as part of the action bar spinner, which {@link SearchSetting} is currently chosen.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EViewGroup(R.layout.actionbar_searchsite) @EViewGroup(R.layout.actionbar_searchsite)

1
app/src/main/java/org/transdroid/core/gui/search/SearchSettingsDropDownAdapter.java

@ -27,6 +27,7 @@ import java.util.List;
/** /**
* List adapter that holds search settings, that is, web searches and in-app search sites, displayed as content to a Spinner instead of a ListView. * List adapter that holds search settings, that is, web searches and in-app search sites, displayed as content to a Spinner instead of a ListView.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class SearchSettingsDropDownAdapter extends FilterListItemAdapter { public class SearchSettingsDropDownAdapter extends FilterListItemAdapter {

1
app/src/main/java/org/transdroid/core/gui/search/SearchSiteView.java

@ -31,6 +31,7 @@ import org.transdroid.core.gui.navigation.NavigationHelper;
/** /**
* View that represents some {@link RssfeedSetting} object and displays name as well as loads a favicon for the feed's site and can load how many new * View that represents some {@link RssfeedSetting} object and displays name as well as loads a favicon for the feed's site and can load how many new
* items are available. * items are available.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EViewGroup(R.layout.list_item_searchsite) @EViewGroup(R.layout.list_item_searchsite)

2
app/src/main/java/org/transdroid/core/gui/search/SearchSitesAdapter.java

@ -30,6 +30,7 @@ import java.util.List;
/** /**
* Adapter that contains a list of {@link SearchSetting}s, either {@link SearchSite} or {@link WebsearchSetting}. * Adapter that contains a list of {@link SearchSetting}s, either {@link SearchSite} or {@link WebsearchSetting}.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EBean @EBean
@ -42,6 +43,7 @@ public class SearchSitesAdapter extends BaseAdapter {
/** /**
* Allows updating the full internal list of sites at once, replacing the old list * Allows updating the full internal list of sites at once, replacing the old list
*
* @param sites The new list of search sites, either in-app or web search settings * @param sites The new list of search sites, either in-app or web search settings
*/ */
public void update(List<SearchSetting> sites) { public void update(List<SearchSetting> sites) {

2
app/src/main/java/org/transdroid/core/gui/search/SendIntentHelper.java

@ -21,6 +21,7 @@ import android.content.Intent;
/** /**
* Used to clean up text as received from a generic ACTION_SEND intent. This class is highly custom-based for known * Used to clean up text as received from a generic ACTION_SEND intent. This class is highly custom-based for known
* applications, i.e. the EXTRA_TEXT send by some known applications. * applications, i.e. the EXTRA_TEXT send by some known applications.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class SendIntentHelper { public class SendIntentHelper {
@ -36,6 +37,7 @@ public class SendIntentHelper {
/** /**
* Cleans a SEND intent text string by removing irrelevant parts, so that the remaining text can be used as search * Cleans a SEND intent text string by removing irrelevant parts, so that the remaining text can be used as search
* string. Typically deals with specific known applications such as Shazam and YouTube's SEND intents. * string. Typically deals with specific known applications such as Shazam and YouTube's SEND intents.
*
* @param intent The original SEND intent that was received * @param intent The original SEND intent that was received
* @return A cleaned string to be used as search query * @return A cleaned string to be used as search query
*/ */

1
app/src/main/java/org/transdroid/core/gui/search/UrlEntryDialog.java

@ -36,6 +36,7 @@ public class UrlEntryDialog {
/** /**
* Opens a dialog that allows entry of a single URL string, which (on confirmation) will be supplied to the calling activity's {@link * Opens a dialog that allows entry of a single URL string, which (on confirmation) will be supplied to the calling activity's {@link
* TorrentsActivity#addTorrentByUrl(String, String) method}. * TorrentsActivity#addTorrentByUrl(String, String) method}.
*
* @param activity The activity that opens (and owns) this dialog * @param activity The activity that opens (and owns) this dialog
*/ */
public static void show(final TorrentsActivity activity) { public static void show(final TorrentsActivity activity) {

1
app/src/main/java/org/transdroid/core/gui/settings/AboutDialog.java

@ -25,6 +25,7 @@ import android.net.Uri;
/** /**
* Fragment that shows info about the application developer and used open source libraries. * Fragment that shows info about the application developer and used open source libraries.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class AboutDialog implements DialogHelper.DialogSpecification { public class AboutDialog implements DialogHelper.DialogSpecification {

1
app/src/main/java/org/transdroid/core/gui/settings/ChangelogDialog.java

@ -25,6 +25,7 @@ import android.net.Uri;
/** /**
* Fragment that shows recent app changes. * Fragment that shows recent app changes.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class ChangelogDialog implements DialogHelper.DialogSpecification { public class ChangelogDialog implements DialogHelper.DialogSpecification {

10
app/src/main/java/org/transdroid/core/gui/settings/KeyBoundPreferencesActivity.java

@ -40,6 +40,7 @@ import java.util.Map;
* and then call initXPreference for each contained preference. {@link #onPreferencesChanged()} can be overridden to * and then call initXPreference for each contained preference. {@link #onPreferencesChanged()} can be overridden to
* react to preference changes, e.g. when field availability should be updated (and where preference dependency isn't * react to preference changes, e.g. when field availability should be updated (and where preference dependency isn't
* enough). * enough).
*
* @author Eric Kok * @author Eric Kok
*/ */
@EActivity @EActivity
@ -54,6 +55,7 @@ public abstract class KeyBoundPreferencesActivity extends PreferenceCompatActivi
/** /**
* Should be called during the activity {@link #onCreate(android.os.Bundle)} (but after super.onCreate(Bundle)) to * Should be called during the activity {@link #onCreate(android.os.Bundle)} (but after super.onCreate(Bundle)) to
* load the preferences for this screen from an XML resource. * load the preferences for this screen from an XML resource.
*
* @param preferencesResId The XML resource to read preferences from, which may contain embedded * @param preferencesResId The XML resource to read preferences from, which may contain embedded
* {@link PreferenceScreen} objects * {@link PreferenceScreen} objects
* @param currentMaxKey The value of what is currently the last defined settings object, or -1 of no settings were * @param currentMaxKey The value of what is currently the last defined settings object, or -1 of no settings were
@ -103,6 +105,7 @@ public abstract class KeyBoundPreferencesActivity extends PreferenceCompatActivi
/** /**
* Updates a preference that allows for text entry via a dialog. This is used for both string and integer values. No * Updates a preference that allows for text entry via a dialog. This is used for both string and integer values. No
* default value will be shown. * default value will be shown.
*
* @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under * @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under
* item_name_[key] * item_name_[key]
* @return The concrete {@link EditTextPreference} that is bound to this preference * @return The concrete {@link EditTextPreference} that is bound to this preference
@ -113,6 +116,7 @@ public abstract class KeyBoundPreferencesActivity extends PreferenceCompatActivi
/** /**
* Updates a preference that allows for text entry via a dialog. This is used for both string and integer values. * Updates a preference that allows for text entry via a dialog. This is used for both string and integer values.
*
* @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under * @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under
* item_name_[key] * item_name_[key]
* @param defValue The default value for this preference, as shown when no value was yet stored * @param defValue The default value for this preference, as shown when no value was yet stored
@ -125,6 +129,7 @@ public abstract class KeyBoundPreferencesActivity extends PreferenceCompatActivi
/** /**
* Updates a preference (including dependency) that allows for text entry via a dialog. This is used for both string * Updates a preference (including dependency) that allows for text entry via a dialog. This is used for both string
* and integer values. * and integer values.
*
* @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under * @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under
* item_name_[key] * item_name_[key]
* @param defValue The default value for this preference, as shown when no value was yet stored * @param defValue The default value for this preference, as shown when no value was yet stored
@ -146,6 +151,7 @@ public abstract class KeyBoundPreferencesActivity extends PreferenceCompatActivi
/** /**
* Updates a preference that simply shows a check box. No default value will be shown. * Updates a preference that simply shows a check box. No default value will be shown.
*
* @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under * @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under
* item_name_[key] * item_name_[key]
* @return The concrete {@link CheckBoxPreference} that is bound to this preference * @return The concrete {@link CheckBoxPreference} that is bound to this preference
@ -156,6 +162,7 @@ public abstract class KeyBoundPreferencesActivity extends PreferenceCompatActivi
/** /**
* Updates a preference that simply shows a check box. * Updates a preference that simply shows a check box.
*
* @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under * @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under
* item_name_[key] * item_name_[key]
* @param defValue The default value for this preference, as shown when no value was yet stored * @param defValue The default value for this preference, as shown when no value was yet stored
@ -167,6 +174,7 @@ public abstract class KeyBoundPreferencesActivity extends PreferenceCompatActivi
/** /**
* Updates a preference (including dependency) that simply shows a check box. * Updates a preference (including dependency) that simply shows a check box.
*
* @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under * @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under
* item_name_[key] * item_name_[key]
* @param defValue The default value for this preference, as shown when no value was yet stored * @param defValue The default value for this preference, as shown when no value was yet stored
@ -185,6 +193,7 @@ public abstract class KeyBoundPreferencesActivity extends PreferenceCompatActivi
/** /**
* Updates a preference that allows picking an item from a list. No default value will be shown. * Updates a preference that allows picking an item from a list. No default value will be shown.
*
* @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under * @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under
* item_name_[key] * item_name_[key]
* @return The concrete {@link ListPreference} that is bound to this preference * @return The concrete {@link ListPreference} that is bound to this preference
@ -195,6 +204,7 @@ public abstract class KeyBoundPreferencesActivity extends PreferenceCompatActivi
/** /**
* Updates a preference that allows picking an item from a list. * Updates a preference that allows picking an item from a list.
*
* @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under * @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under
* item_name_[key] * item_name_[key]
* @param defValue The default value for this preference, as shown when no value was yet stored * @param defValue The default value for this preference, as shown when no value was yet stored

2
app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java

@ -26,6 +26,7 @@ import android.content.SharedPreferences;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import androidx.preference.ListPreference; import androidx.preference.ListPreference;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.Preference.OnPreferenceClickListener; import androidx.preference.Preference.OnPreferenceClickListener;
@ -55,6 +56,7 @@ import java.util.List;
/** /**
* The main activity that provides access to all application settings. It shows the configured serves, web search sites and RSS feeds along with other * The main activity that provides access to all application settings. It shows the configured serves, web search sites and RSS feeds along with other
* general settings. * general settings.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EActivity @EActivity

3
app/src/main/java/org/transdroid/core/gui/settings/RssfeedPreference.java

@ -24,6 +24,7 @@ import org.transdroid.core.app.settings.RssfeedSetting;
/** /**
* Represents a {@link RssfeedSetting} in a preferences screen. * Represents a {@link RssfeedSetting} in a preferences screen.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class RssfeedPreference extends Preference { public class RssfeedPreference extends Preference {
@ -41,6 +42,7 @@ public class RssfeedPreference extends Preference {
/** /**
* Set the RSS feed settings object that is bound to this preference item * Set the RSS feed settings object that is bound to this preference item
*
* @param rssfeedSetting The RSS feed settings * @param rssfeedSetting The RSS feed settings
* @return Itself, for method chaining * @return Itself, for method chaining
*/ */
@ -54,6 +56,7 @@ public class RssfeedPreference extends Preference {
/** /**
* Set a listener that will be notified of click events on this preference * Set a listener that will be notified of click events on this preference
*
* @param onRssfeedClickedListener The click listener to register * @param onRssfeedClickedListener The click listener to register
* @return Itself, for method chaining * @return Itself, for method chaining
*/ */

1
app/src/main/java/org/transdroid/core/gui/settings/RssfeedSettingsActivity.java

@ -34,6 +34,7 @@ import org.transdroid.core.app.settings.ApplicationSettings_;
/** /**
* Activity that allows for a configuration of some RSS feed. The key can be supplied to update an existing RSS feed setting instead of creating a new * Activity that allows for a configuration of some RSS feed. The key can be supplied to update an existing RSS feed setting instead of creating a new
* one. * one.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EActivity @EActivity

3
app/src/main/java/org/transdroid/core/gui/settings/ServerPreference.java

@ -24,6 +24,7 @@ import org.transdroid.core.app.settings.ServerSetting;
/** /**
* Represents a {@link ServerSetting} in a preferences screen. * Represents a {@link ServerSetting} in a preferences screen.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class ServerPreference extends Preference { public class ServerPreference extends Preference {
@ -41,6 +42,7 @@ public class ServerPreference extends Preference {
/** /**
* Set the server settings object that is bound to this preference item * Set the server settings object that is bound to this preference item
*
* @param serverSetting The server settings * @param serverSetting The server settings
* @return Itself, for method chaining * @return Itself, for method chaining
*/ */
@ -54,6 +56,7 @@ public class ServerPreference extends Preference {
/** /**
* Set a listener that will be notified of click events on this preference * Set a listener that will be notified of click events on this preference
*
* @param onServerClickedListener The click listener to register * @param onServerClickedListener The click listener to register
* @return Itself, for method chaining * @return Itself, for method chaining
*/ */

1
app/src/main/java/org/transdroid/core/gui/settings/ServerSettingsActivity.java

@ -42,6 +42,7 @@ import org.transdroid.daemon.Daemon;
/** /**
* Activity that allows for a configuration of a server. The key can be supplied to update an existing server setting instead of creating a new one. * Activity that allows for a configuration of a server. The key can be supplied to update an existing server setting instead of creating a new one.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EActivity @EActivity

3
app/src/main/java/org/transdroid/core/gui/settings/WebsearchPreference.java

@ -24,6 +24,7 @@ import org.transdroid.core.app.settings.WebsearchSetting;
/** /**
* Represents a {@link WebsearchSetting} in a preferences screen. * Represents a {@link WebsearchSetting} in a preferences screen.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class WebsearchPreference extends Preference { public class WebsearchPreference extends Preference {
@ -41,6 +42,7 @@ public class WebsearchPreference extends Preference {
/** /**
* Set the websearch settings object that is bound to this preference item * Set the websearch settings object that is bound to this preference item
*
* @param websearchSetting The websearch settings * @param websearchSetting The websearch settings
* @return Itself, for method chaining * @return Itself, for method chaining
*/ */
@ -54,6 +56,7 @@ public class WebsearchPreference extends Preference {
/** /**
* Set a listener that will be notified of click events on this preference * Set a listener that will be notified of click events on this preference
*
* @param onWebsearchClickedListener The click listener to register * @param onWebsearchClickedListener The click listener to register
* @return Itself, for method chaining * @return Itself, for method chaining
*/ */

1
app/src/main/java/org/transdroid/core/gui/settings/WebsearchSettingsActivity.java

@ -34,6 +34,7 @@ import android.os.Bundle;
/** /**
* Activity that allows for a configuration of a web search site. The key can be supplied to update an existing web * Activity that allows for a configuration of a web search site. The key can be supplied to update an existing web
* search site setting instead of creating a new one. * search site setting instead of creating a new one.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EActivity @EActivity

2
app/src/main/java/org/transdroid/core/rssparser/Item.java

@ -101,6 +101,7 @@ public class Item implements Parcelable {
/** /**
* Returns 'the' item link as string, which preferably is the enclosure URL, but otherwise the link (or null if that * Returns 'the' item link as string, which preferably is the enclosure URL, but otherwise the link (or null if that
* is empty too). * is empty too).
*
* @return A single link URL string to be used * @return A single link URL string to be used
*/ */
public String getTheLink() { public String getTheLink() {
@ -114,6 +115,7 @@ public class Item implements Parcelable {
/** /**
* Returns 'the' item link as URI, which preferably is the enclosure URL, but otherwise the link (or null if that is * Returns 'the' item link as URI, which preferably is the enclosure URL, but otherwise the link (or null if that is
* empty too). * empty too).
*
* @return A single link URI to be used * @return A single link URI to be used
*/ */
public Uri getTheLinkUri() { public Uri getTheLinkUri() {

5
app/src/main/java/org/transdroid/core/rssparser/RssParser.java

@ -47,6 +47,7 @@ public class RssParser extends DefaultHandler {
/** /**
* The constructor for the RSS parser; call {@link #parse()} to synchronously create an HTTP connection and parse * The constructor for the RSS parser; call {@link #parse()} to synchronously create an HTTP connection and parse
* the RSS feed contents. The results can be retrieved with {@link #getChannel()}. * the RSS feed contents. The results can be retrieved with {@link #getChannel()}.
*
* @param url The url of the feed to retrieve * @param url The url of the feed to retrieve
* @param excludeFilter A |-separated list of words that may not be included in the item title or they are excluded * @param excludeFilter A |-separated list of words that may not be included in the item title or they are excluded
* @param includeFilter A |-separated list of words that need to be included in the item title or they are excluded * @param includeFilter A |-separated list of words that need to be included in the item title or they are excluded
@ -74,6 +75,7 @@ public class RssParser extends DefaultHandler {
/** /**
* Returns the loaded RSS feed as channel which contains the individual {@link Item}s * Returns the loaded RSS feed as channel which contains the individual {@link Item}s
*
* @return A channel object that contains the feed details and individual items * @return A channel object that contains the feed details and individual items
*/ */
public Channel getChannel() { public Channel getChannel() {
@ -82,6 +84,7 @@ public class RssParser extends DefaultHandler {
/** /**
* Initialises an HTTP connection, retrieves the content and parses the RSS feed as standard XML. * Initialises an HTTP connection, retrieves the content and parses the RSS feed as standard XML.
*
* @throws ParserConfigurationException Thrown if the SX parser is not working corectly * @throws ParserConfigurationException Thrown if the SX parser is not working corectly
* @throws SAXException Thrown if the SAX parser can encounters non-standard XML content * @throws SAXException Thrown if the SAX parser can encounters non-standard XML content
* @throws IOException Thrown if the RSS feed content can not be retrieved, such as when no connection is available * @throws IOException Thrown if the RSS feed content can not be retrieved, such as when no connection is available
@ -152,6 +155,7 @@ public class RssParser extends DefaultHandler {
/** /**
* By default creates a standard Item (with title, description and links), which may to overridden to add more data * By default creates a standard Item (with title, description and links), which may to overridden to add more data
* (i.e. custom tags that a feed may supply). * (i.e. custom tags that a feed may supply).
*
* @return A possibly decorated Item instance * @return A possibly decorated Item instance
*/ */
protected Item createNewItem() { protected Item createNewItem() {
@ -282,6 +286,7 @@ public class RssParser extends DefaultHandler {
/** /**
* May be overridden to add additional data from tags that are not standard in RSS. Not used by this default RSS * May be overridden to add additional data from tags that are not standard in RSS. Not used by this default RSS
* style parser. Usually used in conjunction with {@link #createNewItem()}. * style parser. Usually used in conjunction with {@link #createNewItem()}.
*
* @param localName The tag name * @param localName The tag name
* @param item The Item we are currently parsing * @param item The Item we are currently parsing
* @param text The new text content * @param text The new text content

1
app/src/main/java/org/transdroid/core/seedbox/DediseedboxSettings.java

@ -26,6 +26,7 @@ import org.transdroid.daemon.OS;
/** /**
* Implementation of {@link SeedboxSettings} for Dediseedbox seedboxes. * Implementation of {@link SeedboxSettings} for Dediseedbox seedboxes.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class DediseedboxSettings extends SeedboxSettingsImpl implements SeedboxSettings { public class DediseedboxSettings extends SeedboxSettingsImpl implements SeedboxSettings {

1
app/src/main/java/org/transdroid/core/seedbox/DediseedboxSettingsActivity.java

@ -35,6 +35,7 @@ import org.transdroid.core.gui.settings.MainSettingsActivity_;
/** /**
* Activity that allows for the configuration of a Dediseedbox seedbox. The key can be supplied to update an * Activity that allows for the configuration of a Dediseedbox seedbox. The key can be supplied to update an
* existing server setting instead of creating a new one. * existing server setting instead of creating a new one.
*
* @author Eric Kok * @author Eric Kok
*/ */
@EActivity @EActivity

5
app/src/main/java/org/transdroid/core/seedbox/SeedboxPreference.java

@ -25,6 +25,7 @@ import org.transdroid.core.gui.settings.ServerPreference;
/** /**
* Represents a {@link ServerSetting} in a preferences screen, as constructed for a specific {@link SeedboxProvider}. * Represents a {@link ServerSetting} in a preferences screen, as constructed for a specific {@link SeedboxProvider}.
*
* @author Eric Kok * @author Eric Kok
*/ */
public class SeedboxPreference extends ServerPreference { public class SeedboxPreference extends ServerPreference {
@ -40,6 +41,7 @@ public class SeedboxPreference extends ServerPreference {
/** /**
* Set the seedbox provider that this server settings object is constructed for. * Set the seedbox provider that this server settings object is constructed for.
*
* @param provider The seedbox provider type * @param provider The seedbox provider type
* @return Itself, for method chaining * @return Itself, for method chaining
*/ */
@ -52,6 +54,7 @@ public class SeedboxPreference extends ServerPreference {
/** /**
* Set the server settings object that is bound to this preference item. This seedbox=specific implementation does * Set the server settings object that is bound to this preference item. This seedbox=specific implementation does
* not show the human readable server connection string, but the seedbox provider name. * not show the human readable server connection string, but the seedbox provider name.
*
* @param serverSetting The server settings * @param serverSetting The server settings
* @return Itself, for method chaining * @return Itself, for method chaining
*/ */
@ -64,6 +67,7 @@ public class SeedboxPreference extends ServerPreference {
/** /**
* Returns the seedbox provider for which this server is constructed. * Returns the seedbox provider for which this server is constructed.
*
* @return The seedbox provider type of this server * @return The seedbox provider type of this server
*/ */
public SeedboxProvider getSeedboxProvider() { public SeedboxProvider getSeedboxProvider() {
@ -81,6 +85,7 @@ public class SeedboxPreference extends ServerPreference {
/** /**
* Set a listener that will be notified of click events on this preference * Set a listener that will be notified of click events on this preference
*
* @param onSeedboxClickedListener The click listener to register * @param onSeedboxClickedListener The click listener to register
* @return Itself, for method chaining * @return Itself, for method chaining
*/ */

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save