Browse Source

Fixing indent, improving delete logic

pull/222/head
Kumaresan Rajeswaran 9 years ago
parent
commit
91552322be
  1. 7
      app/src/main/java/org/transdroid/core/gui/ConfirmRemoveDialog.java
  2. 14
      app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
  3. 2
      app/src/main/java/org/transdroid/core/gui/navigation/NavigationHelper.java

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

@ -6,6 +6,7 @@ import android.content.DialogInterface; @@ -6,6 +6,7 @@ import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import org.transdroid.R;
import org.transdroid.daemon.Daemon;
import org.transdroid.daemon.Torrent;
import java.util.List;
@ -13,7 +14,7 @@ import java.util.List; @@ -13,7 +14,7 @@ import java.util.List;
public class ConfirmRemoveDialog {
/**
* Opens a dialog that confirms the removal of a torrent, along with an option for with deleting downloaded files
* Opens a dialog that confirms the removal of a torrent, along with an option for deleting downloaded files
* @param activity The torrents activity from which the dialog is started (and which received the callback)
* @param torrents List of torrents to be removed
*/
@ -34,7 +35,9 @@ public class ConfirmRemoveDialog { @@ -34,7 +35,9 @@ public class ConfirmRemoveDialog {
@Override
public void onClick(DialogInterface dialog, int which) {
for (Torrent torrent : torrents) {
activity.removeTorrent(torrent, isRemoveDataChecked[0]);
boolean shouldRemoveData = isRemoveDataChecked[0] &&
Daemon.supportsRemoveWithData(torrent.getDaemon());
activity.removeTorrent(torrent, shouldRemoveData);
}
dialog.dismiss();
}

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

@ -238,13 +238,13 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE @@ -238,13 +238,13 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
torrentsToolbar.addView(serverSelectionView);
}
actionsToolbar.addView(serverStatusView);
// actionsToolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
// @Override
// public boolean onMenuItemClick(MenuItem menuItem) {
// // Redirect to the classic activity implementation so we can use @OptionsItem methods
// return onOptionsItemSelected(menuItem);
// }
// });
actionsToolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem menuItem) {
// Redirect to the classic activity implementation so we can use @OptionsItem methods
return onOptionsItemSelected(menuItem);
}
});
setSupportActionBar(torrentsToolbar); // For direct menu item inflation by the contained fragments
getSupportActionBar().setDisplayShowTitleEnabled(false);

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

@ -123,8 +123,6 @@ public class NavigationHelper { @@ -123,8 +123,6 @@ public class NavigationHelper {
if (imageCache == null) {
imageCache = ImageLoader.getInstance();
try {
// LruDiskCache diskCache =
// new LruDiskCache(context.getCacheDir(), null, new Md5FileNameGenerator(), 640000, 25);
LruDiscCache diskCache = new LruDiscCache(context.getCacheDir(), null, new Md5FileNameGenerator(), 640000, 25);
// @formatter:off
Builder imageCacheBuilder = new Builder(context)

Loading…
Cancel
Save