diff --git a/app/build.gradle b/app/build.gradle
index e0dfa9f6..c46f4a88 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 28
- versionCode 234
- versionName '2.5.14'
+ versionCode 235
+ versionName '2.5.15'
javaCompileOptions {
annotationProcessorOptions {
@@ -36,9 +36,14 @@ android {
}
}
buildTypes {
+ debug {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
release {
signingConfig signingConfigs.releaseConfig
- minifyEnabled false
+ minifyEnabled true
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
flavorDimensions "version"
@@ -60,12 +65,13 @@ android {
}
dependencies {
- implementation 'org.androidannotations:androidannotations-api:4.5.2'
- implementation 'org.androidannotations:ormlite-api:4.5.2'
+ implementation 'org.androidannotations:androidannotations-api:4.6.0'
+ implementation 'org.androidannotations:ormlite-api:4.6.0'
implementation 'com.j256.ormlite:ormlite-core:4.48'
implementation 'com.j256.ormlite:ormlite-android:4.48'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.android.support:appcompat-v7:28.0.0'
+ implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'com.getbase:floatingactionbutton:1.10.1'
implementation 'com.nispok:snackbar:2.11.0'
@@ -74,7 +80,7 @@ dependencies {
transitive = true
}
implementation 'com.evernote:android-job:1.2.6'
- annotationProcessor 'org.androidannotations:androidannotations:4.5.2'
- annotationProcessor 'org.androidannotations:ormlite:4.5.2'
+ annotationProcessor 'org.androidannotations:androidannotations:4.6.0'
+ annotationProcessor 'org.androidannotations:ormlite:4.6.0'
}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 00000000..e9caf635
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1 @@
+-dontobfuscate
diff --git a/app/src/lite/res/values/strings.xml b/app/src/lite/res/values/strings.xml
index d0af0753..36912a08 100644
--- a/app/src/lite/res/values/strings.xml
+++ b/app/src/lite/res/values/strings.xml
@@ -18,7 +18,7 @@
Transdrone
- Donate via transdroid.org
- https://transdroid.org
+
+
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 50554d15..31d29570 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -29,10 +29,15 @@
android:xlargeScreens="true" />
+
+
+
+
+
torrentFiles) {
// Update the details fragment with the newly retrieved list of files
- if (fragmentDetails.isAdded())
+ if (fragmentDetails.isResumed())
fragmentDetails.updateTorrentFiles(torrent, new ArrayList<>(torrentFiles));
}
@@ -348,7 +351,7 @@ public class DetailsActivity extends AppCompatActivity implements TorrentTasksEx
protected void onCommunicationError(DaemonTaskFailureResult result, boolean isCritical) {
log.i(this, result.getException().toString());
String error = getString(LocalTorrent.getResourceForDaemonException(result.getException()));
- if (fragmentDetails.isAdded())
+ if (fragmentDetails.isResumed())
fragmentDetails.updateIsLoading(false, isCritical ? error : null);
SnackbarManager.show(Snackbar.with(this).text(getString(LocalTorrent.getResourceForDaemonException(result.getException())))
.colorResource(R.color.red));
@@ -357,7 +360,7 @@ public class DetailsActivity extends AppCompatActivity implements TorrentTasksEx
@UiThread
protected void onTorrentsRetrieved(List torrents, List labels) {
// Update the details fragment accordingly
- if (fragmentDetails.isAdded()) {
+ if (fragmentDetails.isResumed()) {
fragmentDetails.updateIsLoading(false, null);
fragmentDetails.perhapsUpdateTorrent(torrents);
fragmentDetails.updateLabels(Label.convertToNavigationLabels(labels, getResources().getString(R.string.labels_unlabeled)));
diff --git a/app/src/main/java/org/transdroid/core/gui/DetailsFragment.java b/app/src/main/java/org/transdroid/core/gui/DetailsFragment.java
index 456e297e..79843c00 100644
--- a/app/src/main/java/org/transdroid/core/gui/DetailsFragment.java
+++ b/app/src/main/java/org/transdroid/core/gui/DetailsFragment.java
@@ -150,10 +150,10 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
if (torrent != null) {
updateTorrent(torrent);
}
- if (torrentDetails != null) {
+ if (torrent != null && torrentDetails != null) {
updateTorrentDetails(torrent, torrentDetails);
}
- if (torrentFiles != null) {
+ if (torrent != null && torrentFiles != null) {
updateTorrentFiles(torrent, torrentFiles);
}
diff --git a/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java b/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
index df0627af..2956cf2b 100644
--- a/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
+++ b/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
@@ -566,7 +566,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE
// Clear the currently shown list of torrents and perhaps the details
fragmentTorrents.clear(true, true);
- if (fragmentDetails != null && fragmentDetails.isAdded() && fragmentDetails.getActivity() != null) {
+ if (fragmentDetails != null && fragmentDetails.isResumed() && fragmentDetails.getActivity() != null) {
fragmentDetails.updateIsLoading(false, null);
fragmentDetails.clear();
fragmentDetails.setCurrentServerSettings(server);
@@ -586,7 +586,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE
// Remember that the user last selected this
applicationSettings.setLastUsedNavigationFilter(currentFilter);
// Clear the details view
- if (fragmentDetails != null && fragmentDetails.isAdded()) {
+ if (fragmentDetails != null && fragmentDetails.isResumed()) {
fragmentDetails.updateIsLoading(false, null);
fragmentDetails.clear();
}
@@ -599,7 +599,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE
* @param hasServerSettings Whether there are server settings available, so we can continue to connect
*/
private void updateFragmentVisibility(boolean hasServerSettings) {
- if (fragmentDetails != null && fragmentDetails.isAdded()) {
+ if (fragmentDetails != null && fragmentDetails.isResumed()) {
if (hasServerSettings) {
getFragmentManager().beginTransaction().show(fragmentDetails).commit();
} else {
@@ -905,7 +905,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE
* @param torrent The torrent to show detailed statistics for
*/
public void openDetails(Torrent torrent) {
- if (fragmentDetails != null && fragmentDetails.isAdded()) {
+ if (fragmentDetails != null && fragmentDetails.isResumed()) {
fragmentDetails.updateTorrent(torrent);
} else {
DetailsActivity_.intent(this).torrent(torrent).currentLabels(lastNavigationLabels).startForResult(RESULT_DETAILS);
@@ -1296,7 +1296,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE
fragmentTorrents.updateIsLoading(false);
if (isCritical) {
fragmentTorrents.updateError(error);
- if (fragmentDetails != null && fragmentDetails.isAdded()) {
+ if (fragmentDetails != null && fragmentDetails.isResumed()) {
fragmentDetails.updateIsLoading(false, error);
}
}
@@ -1312,13 +1312,13 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE
fragmentTorrents.updateTorrents(new ArrayList<>(torrents), lastNavigationLabels);
// Update the details fragment if the currently shown torrent is in the newly retrieved list
- if (fragmentDetails != null && fragmentDetails.isAdded()) {
+ if (fragmentDetails != null && fragmentDetails.isResumed()) {
fragmentDetails.perhapsUpdateTorrent(torrents);
}
// Update local list of labels in the navigation
navigationListAdapter.updateLabels(lastNavigationLabels);
- if (fragmentDetails != null && fragmentDetails.isAdded()) {
+ if (fragmentDetails != null && fragmentDetails.isResumed()) {
fragmentDetails.updateLabels(lastNavigationLabels);
}
@@ -1347,7 +1347,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE
@UiThread
protected void onTorrentDetailsRetrieved(Torrent torrent, TorrentDetails torrentDetails) {
// Update the details fragment with the new fine details for the shown torrent
- if (fragmentDetails != null && fragmentDetails.isAdded()) {
+ if (fragmentDetails != null && fragmentDetails.isResumed()) {
fragmentDetails.updateTorrentDetails(torrent, torrentDetails);
}
}
@@ -1355,7 +1355,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE
@UiThread
protected void onTorrentFilesRetrieved(Torrent torrent, List torrentFiles) {
// Update the details fragment with the newly retrieved list of files
- if (fragmentDetails != null && fragmentDetails.isAdded()) {
+ if (fragmentDetails != null && fragmentDetails.isResumed()) {
fragmentDetails.updateTorrentFiles(torrent, new ArrayList<>(torrentFiles));
}
}
diff --git a/app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java b/app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java
index 7b2c48a5..fd9257a7 100644
--- a/app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java
+++ b/app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java
@@ -74,8 +74,8 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
protected ApplicationSettings applicationSettings;
@Bean
protected SystemSettings systemSettings;
- @InstanceState
- protected ArrayList torrents = null;
+ // HACK Working around #391 while hopefully we rework the UI in the future to persist the list in db or something
+ protected static ArrayList torrents = null;
@InstanceState
protected ArrayList lastMultiSelectedTorrents;
@InstanceState
@@ -144,7 +144,8 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
* @param newTorrents The new, updated list of torrents
*/
public void updateTorrents(ArrayList newTorrents, ArrayList