diff --git a/android/res/drawable-hdpi/icon_showactive.png b/android/res/drawable-hdpi/icon_showactive.png new file mode 100644 index 00000000..f5e6e9a3 Binary files /dev/null and b/android/res/drawable-hdpi/icon_showactive.png differ diff --git a/android/res/layout/part_quickaction.xml b/android/res/layout/part_quickaction.xml index 95c0a69f..f7d0f629 100644 --- a/android/res/layout/part_quickaction.xml +++ b/android/res/layout/part_quickaction.xml @@ -54,6 +54,15 @@ android:layout_gravity="center" android:layout_weight="1" /> + + Connected, but no downloading torrents on the server. Connected, but no seeding torrents on the server. Connected, but no inactive torrents on the server. +Connected, but no active torrents on the server. Your torrent client does not support .torrent file uploads or this is not yet implemented. Your torrent client does not support .magnet links or this is not yet implemented. Save @@ -27,6 +28,7 @@ All torrents Downloading torrents Seeding torrents +Active torrents Inactive torrents Add diff --git a/android/src/org/transdroid/gui/MainViewType.java b/android/src/org/transdroid/gui/MainViewType.java index 7c3c342d..7de3d1fe 100644 --- a/android/src/org/transdroid/gui/MainViewType.java +++ b/android/src/org/transdroid/gui/MainViewType.java @@ -25,7 +25,8 @@ public enum MainViewType { ShowAll (1), OnlyDownloading (2), OnlyUploading (3), - OnlyInactive (4); + OnlyInactive (4), + OnlyActive (5); private int code; private static final Map lookup = new HashMap(); diff --git a/android/src/org/transdroid/gui/TorrentViewSelectorWindow.java b/android/src/org/transdroid/gui/TorrentViewSelectorWindow.java index aac72db2..1b9f6416 100644 --- a/android/src/org/transdroid/gui/TorrentViewSelectorWindow.java +++ b/android/src/org/transdroid/gui/TorrentViewSelectorWindow.java @@ -45,6 +45,7 @@ public class TorrentViewSelectorWindow extends BetterPopupWindow { ((ImageButton)rootView.findViewById(R.id.showall)).setOnClickListener(getOnMainViewTypeClickListener(MainViewType.ShowAll)); ((ImageButton)rootView.findViewById(R.id.showdl)).setOnClickListener(getOnMainViewTypeClickListener(MainViewType.OnlyDownloading)); ((ImageButton)rootView.findViewById(R.id.showup)).setOnClickListener(getOnMainViewTypeClickListener(MainViewType.OnlyUploading)); + ((ImageButton)rootView.findViewById(R.id.showactive)).setOnClickListener(getOnMainViewTypeClickListener(MainViewType.OnlyActive)); ((ImageButton)rootView.findViewById(R.id.showinactive)).setOnClickListener(getOnMainViewTypeClickListener(MainViewType.OnlyInactive)); labelsListView = (ListView) rootView.findViewById(R.id.labelsList); labelsListView.setOnItemClickListener(onLabelClickListener); diff --git a/android/src/org/transdroid/gui/TorrentsFragment.java b/android/src/org/transdroid/gui/TorrentsFragment.java index d8d42887..e423b27a 100644 --- a/android/src/org/transdroid/gui/TorrentsFragment.java +++ b/android/src/org/transdroid/gui/TorrentsFragment.java @@ -1778,6 +1778,8 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou emptyText.setText(R.string.no_uploading_torrents); } else if (activeMainView == MainViewType.OnlyInactive) { emptyText.setText(R.string.no_inactive_torrents); + } else if (activeMainView == MainViewType.OnlyActive) { + emptyText.setText(R.string.no_active_torrents); } else { emptyText.setText(R.string.no_torrents); } @@ -1978,10 +1980,12 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou // Update the torrents view type text int mainViewTextID = activeMainView == MainViewType.OnlyDownloading? R.string.view_showdl: (activeMainView == MainViewType.OnlyUploading? R.string.view_showul: - (activeMainView == MainViewType.OnlyInactive? R.string.view_showinactive: R.string.view_showall)); + (activeMainView == MainViewType.OnlyInactive? R.string.view_showinactive: + (activeMainView == MainViewType.OnlyActive? R.string.view_showactive: R.string.view_showall))); int mainViewDrawableID = activeMainView == MainViewType.OnlyDownloading? R.drawable.icon_showdl: (activeMainView == MainViewType.OnlyUploading? R.drawable.icon_showup: - (activeMainView == MainViewType.OnlyInactive? R.drawable.icon_showinactive: R.drawable.icon_showall)); + (activeMainView == MainViewType.OnlyInactive? R.drawable.icon_showinactive: + (activeMainView == MainViewType.OnlyActive? R.drawable.icon_showactive: R.drawable.icon_showall))); viewtype.setText(getText(mainViewTextID).toString() + (Daemon.supportsLabels(getActiveDaemonType())? "\n" + useLabel: "")); viewtypeselector.setImageResource(mainViewDrawableID); @@ -2000,7 +2004,8 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou boolean isActivelySeeding = torrent.getStatusCode() == TorrentStatus.Seeding && (!onlyShowTransferring || torrent.getRateUpload() > 0); return (matchViewType == MainViewType.ShowAll || (matchViewType == MainViewType.OnlyDownloading && isActivelyDownloading) || - (matchViewType == MainViewType.OnlyUploading && isActivelySeeding)|| + (matchViewType == MainViewType.OnlyUploading && isActivelySeeding)|| + (matchViewType == MainViewType.OnlyActive && (isActivelySeeding || isActivelyDownloading))|| (matchViewType == MainViewType.OnlyInactive && !isActivelyDownloading && !isActivelySeeding)); }