Browse Source

Fixes #496 with missing sort order names in widget config

pull/506/head
Eric Kok 6 years ago
parent
commit
d1a4a7060e
  1. 48
      app/src/main/java/org/transdroid/core/gui/lists/SortByListItem.java

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

@ -16,11 +16,10 @@
*/ */
package org.transdroid.core.gui.lists; package org.transdroid.core.gui.lists;
import android.content.Context;
import org.transdroid.R; import org.transdroid.R;
import org.transdroid.daemon.TorrentsSortBy; import org.transdroid.daemon.TorrentsSortBy;
import android.content.Context;
/** /**
* 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
@ -33,24 +32,33 @@ public class SortByListItem implements SimpleListItem {
public SortByListItem(Context context, TorrentsSortBy sortBy) { public SortByListItem(Context context, TorrentsSortBy sortBy) {
this.sortBy = sortBy; this.sortBy = sortBy;
switch (sortBy) { switch (sortBy) {
case DateAdded: case DateAdded:
this.name = context.getString(R.string.action_sort_added); this.name = context.getString(R.string.action_sort_added);
break; break;
case DateDone: case DateDone:
this.name = context.getString(R.string.action_sort_done); this.name = context.getString(R.string.action_sort_done);
break; break;
case Ratio: case Ratio:
this.name = context.getString(R.string.action_sort_ratio); this.name = context.getString(R.string.action_sort_ratio);
break; break;
case Status: case Status:
this.name = context.getString(R.string.action_sort_status); this.name = context.getString(R.string.action_sort_status);
break; break;
case UploadSpeed: case UploadSpeed:
this.name = context.getString(R.string.action_sort_upspeed); this.name = context.getString(R.string.action_sort_upspeed);
break; break;
default: case DownloadSpeed:
this.name = context.getString(R.string.action_sort_alpha); this.name = context.getString(R.string.action_sort_downspeed);
break; break;
case Percent:
this.name = context.getString(R.string.action_sort_percent);
break;
case Size:
this.name = context.getString(R.string.action_sort_size);
break;
default:
this.name = context.getString(R.string.action_sort_alpha);
break;
} }
} }

Loading…
Cancel
Save