Browse Source

Working contextual action modes, working menus.

material
Eric Kok 9 years ago
parent
commit
c91e79f9d3
  1. 2
      README.md
  2. 2
      app/build.gradle
  3. 16
      app/src/main/java/org/transdroid/core/gui/DetailsActivity.java
  4. 46
      app/src/main/java/org/transdroid/core/gui/DetailsFragment.java
  5. 7
      app/src/main/java/org/transdroid/core/gui/ServerStatusView.java
  6. 3
      app/src/main/java/org/transdroid/core/gui/TorrentTasksExecutor.java
  7. 92
      app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
  8. 45
      app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java
  9. 11
      app/src/main/java/org/transdroid/core/gui/navigation/NavigationHelper.java
  10. 14
      app/src/main/java/org/transdroid/core/gui/navigation/SelectionManagerMode.java
  11. 69
      app/src/main/java/org/transdroid/core/gui/navigation/SetLabelDialog.java
  12. 4
      app/src/main/java/org/transdroid/core/gui/rss/RssfeedView.java
  13. 9
      app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java
  14. 12
      app/src/main/java/org/transdroid/core/gui/rss/RssitemsFragment.java
  15. 8
      app/src/main/java/org/transdroid/core/gui/search/SearchActivity.java
  16. 2
      app/src/main/java/org/transdroid/core/gui/search/SearchHistoryProvider.java
  17. 13
      app/src/main/java/org/transdroid/core/gui/search/SearchResultsFragment.java
  18. 43
      app/src/main/java/org/transdroid/core/gui/settings/SystemSettingsActivity.java
  19. 46
      app/src/main/java/org/transdroid/core/seedbox/XirvikSharedSettingsActivity.java
  20. BIN
      app/src/main/res/drawable-hdpi/btn_cab_done_default_transdroid2.9.png
  21. BIN
      app/src/main/res/drawable-hdpi/btn_cab_done_focused_transdroid2.9.png
  22. BIN
      app/src/main/res/drawable-hdpi/btn_cab_done_pressed_transdroid2.9.png
  23. BIN
      app/src/main/res/drawable-hdpi/ic_action_copy.png
  24. BIN
      app/src/main/res/drawable-hdpi/ic_action_download.png
  25. BIN
      app/src/main/res/drawable-hdpi/ic_action_filter.png
  26. 0
      app/src/main/res/drawable-hdpi/ic_action_rss.png
  27. BIN
      app/src/main/res/drawable-hdpi/ic_action_turtle_disabled_light.png
  28. BIN
      app/src/main/res/drawable-hdpi/ic_btn_sort.png
  29. BIN
      app/src/main/res/drawable-xhdpi/btn_cab_done_default_transdroid2.9.png
  30. BIN
      app/src/main/res/drawable-xhdpi/btn_cab_done_focused_transdroid2.9.png
  31. BIN
      app/src/main/res/drawable-xhdpi/btn_cab_done_pressed_transdroid2.9.png
  32. BIN
      app/src/main/res/drawable-xhdpi/ic_action_copy.png
  33. BIN
      app/src/main/res/drawable-xhdpi/ic_action_download.png
  34. BIN
      app/src/main/res/drawable-xhdpi/ic_action_filter.png
  35. BIN
      app/src/main/res/drawable-xhdpi/ic_action_info_dark.png
  36. BIN
      app/src/main/res/drawable-xhdpi/ic_action_info_light.png
  37. BIN
      app/src/main/res/drawable-xhdpi/ic_btn_sort.png
  38. BIN
      app/src/main/res/drawable-xhdpi/ic_storage_white_24dp.png
  39. BIN
      app/src/main/res/drawable-xxhdpi/ic_action_copy.png
  40. BIN
      app/src/main/res/drawable-xxhdpi/ic_action_download.png
  41. BIN
      app/src/main/res/drawable-xxhdpi/ic_action_filter.png
  42. BIN
      app/src/main/res/drawable-xxhdpi/ic_action_forcerecheck_dark.png
  43. BIN
      app/src/main/res/drawable-xxhdpi/ic_action_forcerecheck_light.png
  44. BIN
      app/src/main/res/drawable-xxhdpi/ic_action_info_dark.png
  45. BIN
      app/src/main/res/drawable-xxhdpi/ic_action_info_light.png
  46. BIN
      app/src/main/res/drawable-xxhdpi/ic_action_save_dark.png
  47. BIN
      app/src/main/res/drawable-xxhdpi/ic_action_save_light.png
  48. 0
      app/src/main/res/drawable-xxhdpi/ic_action_sort.png
  49. BIN
      app/src/main/res/drawable-xxhdpi/ic_insert_link_white_24dp.png
  50. BIN
      app/src/main/res/drawable-xxxhdpi/ic_action_link.png
  51. BIN
      app/src/main/res/drawable-xxxhdpi/ic_action_search.png
  52. BIN
      app/src/main/res/drawable-xxxhdpi/ic_action_white.png
  53. BIN
      app/src/main/res/drawable-xxxhdpi/ic_btn_sort.png
  54. 27
      app/src/main/res/drawable/btn_cab_done_transdroid2.xml
  55. 84
      app/src/main/res/layout-w600dp/activity_search.xml
  56. 20
      app/src/main/res/layout-w600dp/activity_torrents.xml
  57. 22
      app/src/main/res/layout-w900dp/activity_torrents.xml
  58. 7
      app/src/main/res/layout/actionbar_searchsite.xml
  59. 58
      app/src/main/res/layout/activity_search.xml
  60. 25
      app/src/main/res/layout/activity_torrents.xml
  61. 16
      app/src/main/res/layout/fragment_details.xml
  62. 9
      app/src/main/res/layout/fragment_searchresults.xml
  63. 2
      app/src/main/res/layout/list_item_filter.xml
  64. 6
      app/src/main/res/layout/list_item_rssfeed.xml
  65. 35
      app/src/main/res/layout/list_item_searchresult.xml
  66. 6
      app/src/main/res/layout/list_item_searchsite.xml
  67. 2
      app/src/main/res/layout/list_item_separator.xml
  68. 6
      app/src/main/res/layout/list_item_simple.xml
  69. 32
      app/src/main/res/layout/list_item_torrent.xml
  70. 14
      app/src/main/res/layout/list_item_torrentfile.xml
  71. 15
      app/src/main/res/menu/fragment_details_cab_main.xml
  72. 26
      app/src/main/res/menu/fragment_details_cab_secondary.xml
  73. 12
      app/src/main/res/menu/fragment_torrents_cab.xml
  74. 2
      app/src/main/res/values-v21/styles.xml
  75. 1
      app/src/main/res/values/dimens.xml

2
README.md

@ -20,7 +20,7 @@ Please respect the coding standards for easier merging. master contains the curr @@ -20,7 +20,7 @@ Please respect the coding standards for easier merging. master contains the curr
Code structure
==============
Starting with version 2.3.0, Transdroid is developed in Android Studio, fully integrating with the Gradle build system. It is compiled against Android 4.4 (API level 19) and since version 2.2.0 supporting ICS (API level 15) and up only. To support lite (Transdrone, specially for the Play Store) and full (Transdroid) versions of the app, build flavours are defined in gradle, which contain version-specific resources. Dependencies are managed via Maven Central in the app's build.gradle file.
Starting with version 2.3.0, Transdroid is developed in Android Studio, fully integrating with the Gradle build system. It is (since version 2.5.0) compiled against Android 5.1 (API level 22) and (since version 2.2.0) supporting ICS (API level 15) and up only. To support lite (Transdrone, specially for the Play Store) and full (Transdroid) versions of the app, build flavours are defined in gradle, which contain version-specific resources. Dependencies are managed via JCentral in the app's build.gradle file.
Developed By
============

2
app/build.gradle

@ -36,12 +36,12 @@ dependencies { @@ -36,12 +36,12 @@ dependencies {
compile 'org.androidannotations:androidannotations-api:3.2'
compile 'com.j256.ormlite:ormlite-core:4.48'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'de.keyboardsurfer.android.widget:crouton:1.8.5@aar'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:support-annotations:20.0.0'
compile 'com.getbase:floatingactionbutton:1.8.0'
compile 'com.afollestad:material-dialogs:0.6.3.3'
compile 'com.nispok:snackbar:2.10.6'
apt 'org.androidannotations:androidannotations:3.2'
}

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

@ -24,6 +24,9 @@ import android.support.v7.app.ActionBarActivity; @@ -24,6 +24,9 @@ import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.widget.Toast;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Background;
import org.androidannotations.annotations.Bean;
@ -74,8 +77,6 @@ import org.transdroid.daemon.task.StopTask; @@ -74,8 +77,6 @@ import org.transdroid.daemon.task.StopTask;
import java.util.ArrayList;
import java.util.List;
import de.keyboardsurfer.android.widget.crouton.Crouton;
/**
* 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
@ -144,12 +145,6 @@ public class DetailsActivity extends ActionBarActivity implements TorrentTasksEx @@ -144,12 +145,6 @@ public class DetailsActivity extends ActionBarActivity implements TorrentTasksEx
}
@Override
protected void onDestroy() {
Crouton.cancelAllCroutons();
super.onDestroy();
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@OptionsItem(android.R.id.home)
protected void navigateUp() {
@ -333,7 +328,7 @@ public class DetailsActivity extends ActionBarActivity implements TorrentTasksEx @@ -333,7 +328,7 @@ public class DetailsActivity extends ActionBarActivity implements TorrentTasksEx
// Refresh the screen as well
refreshTorrent();
refreshTorrentDetails(torrent);
Crouton.showText(this, successMessage, NavigationHelper.CROUTON_INFO_STYLE);
SnackbarManager.show(Snackbar.with(this).text(successMessage));
}
@UiThread
@ -353,7 +348,8 @@ public class DetailsActivity extends ActionBarActivity implements TorrentTasksEx @@ -353,7 +348,8 @@ public class DetailsActivity extends ActionBarActivity implements TorrentTasksEx
log.i(this, result.getException().toString());
String error = getString(LocalTorrent.getResourceForDaemonException(result.getException()));
fragmentDetails.updateIsLoading(false, isCritical ? error : null);
Crouton.showText(this, getString(LocalTorrent.getResourceForDaemonException(result.getException())), NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(this).text(getString(LocalTorrent.getResourceForDaemonException(result.getException())))
.colorResource(R.color.crouton_error));
}
@UiThread

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

@ -24,6 +24,7 @@ import android.content.Context; @@ -24,6 +24,7 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.ActionMenuView;
import android.view.ActionMode;
import android.view.Menu;
@ -34,6 +35,9 @@ import android.widget.ListView; @@ -34,6 +35,9 @@ import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EFragment;
@ -47,7 +51,6 @@ import org.transdroid.core.app.settings.SystemSettings_; @@ -47,7 +51,6 @@ import org.transdroid.core.app.settings.SystemSettings_;
import org.transdroid.core.gui.lists.DetailsAdapter;
import org.transdroid.core.gui.lists.SimpleListItemAdapter;
import org.transdroid.core.gui.navigation.Label;
import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.gui.navigation.NavigationHelper_;
import org.transdroid.core.gui.navigation.RefreshableActivity;
import org.transdroid.core.gui.navigation.SelectionManagerMode;
@ -67,8 +70,6 @@ import java.util.ArrayList; @@ -67,8 +70,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import de.keyboardsurfer.android.widget.crouton.Crouton;
/**
* 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
@ -100,6 +101,8 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen @@ -100,6 +101,8 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
protected View detailsContainer;
@ViewById(R.id.details_menu)
protected ActionMenuView detailsMenu;
@ViewById(R.id.contextual_menu)
protected ActionMenuView contextualMenu;
@ViewById
protected SwipeRefreshLayout swipeRefreshLayout;
@ViewById
@ -415,7 +418,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen @@ -415,7 +418,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
@OptionsItem(R.id.action_updatetrackers)
protected void updateTrackers() {
if (torrentDetails == null) {
Crouton.showText(getActivity(), R.string.error_stillloadingdetails, NavigationHelper.CROUTON_INFO_STYLE);
SnackbarManager.show(Snackbar.with(getActivity()).text(R.string.error_stillloadingdetails));
return;
}
new SetTrackersDialog().setOnTrackersUpdated(this).setCurrentTrackers(torrentDetails.getTrackersText())
@ -473,10 +476,22 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen @@ -473,10 +476,22 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
SelectionManagerMode selectionManagerMode;
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
public boolean onCreateActionMode(final ActionMode mode, Menu menu) {
// Show contextual action bar to start/stop/remove/etc. torrents in batch mode
mode.getMenuInflater().inflate(R.menu.fragment_details_cab, menu);
selectionManagerMode = new SelectionManagerMode(detailsList, R.plurals.navigation_filesselected);
detailsMenu.setEnabled(false);
contextualMenu.setVisibility(View.VISIBLE);
contextualMenu.setOnMenuItemClickListener(new ActionMenuView.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem menuItem) {
return onActionItemClicked(mode, menuItem);
}
});
if (contextualMenu.getMenu().size() == 0) {
getActivity().getMenuInflater().inflate(R.menu.fragment_details_cab_main, contextualMenu.getMenu());
}
Context themedContext = ((ActionBarActivity) getActivity()).getSupportActionBar().getThemedContext();
mode.getMenuInflater().inflate(R.menu.fragment_details_cab_secondary, menu);
selectionManagerMode = new SelectionManagerMode(themedContext, detailsList, R.plurals.navigation_filesselected);
selectionManagerMode.setOnlyCheckClass(TorrentFile.class);
selectionManagerMode.onCreateActionMode(mode, menu);
return true;
@ -484,19 +499,20 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen @@ -484,19 +499,20 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
@Override
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
selectionManagerMode.onPrepareActionMode(mode, menu);
// Pause autorefresh
if (getActivity() != null && getActivity() instanceof TorrentsActivity) {
((TorrentsActivity) getActivity()).stopRefresh = true;
((TorrentsActivity) getActivity()).stopAutoRefresh();
}
boolean filePaths = currentServerSettings != null && Daemon.supportsFilePaths(currentServerSettings.getType());
menu.findItem(R.id.action_download).setVisible(filePaths);
contextualMenu.getMenu().findItem(R.id.action_download).setVisible(filePaths);
boolean filePriorities = currentServerSettings != null && Daemon.supportsFilePrioritySetting(currentServerSettings.getType());
menu.findItem(R.id.action_priority_off).setVisible(filePriorities);
menu.findItem(R.id.action_priority_low).setVisible(filePriorities);
menu.findItem(R.id.action_priority_normal).setVisible(filePriorities);
menu.findItem(R.id.action_priority_high).setVisible(filePriorities);
return selectionManagerMode.onPrepareActionMode(mode, menu);
contextualMenu.getMenu().findItem(R.id.action_priority_off).setVisible(filePriorities);
contextualMenu.getMenu().findItem(R.id.action_priority_low).setVisible(filePriorities);
contextualMenu.getMenu().findItem(R.id.action_priority_normal).setVisible(filePriorities);
contextualMenu.getMenu().findItem(R.id.action_priority_high).setVisible(filePriorities);
return true;
}
@SuppressLint("SdCardPath")
@ -569,7 +585,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen @@ -569,7 +585,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
}
// No app is available that can handle FTP downloads
Crouton.showText(getActivity(), getString(R.string.error_noftpapp, url), NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(getActivity()).text(R.string.error_noftpapp).colorResource(R.color.crouton_error));
mode.finish();
return true;
@ -617,6 +633,8 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen @@ -617,6 +633,8 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
((TorrentsActivity) getActivity()).startAutoRefresh();
}
selectionManagerMode.onDestroyActionMode(mode);
contextualMenu.setVisibility(View.GONE);
detailsMenu.setEnabled(true);
}
};

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

@ -21,6 +21,9 @@ import android.view.View; @@ -21,6 +21,9 @@ import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;
import org.transdroid.R;
@ -32,8 +35,6 @@ import org.transdroid.daemon.util.FileSizeConverter; @@ -32,8 +35,6 @@ import org.transdroid.daemon.util.FileSizeConverter;
import java.util.List;
import de.keyboardsurfer.android.widget.crouton.Crouton;
@EViewGroup(R.layout.actionbar_serverstatus)
public class ServerStatusView extends RelativeLayout implements OnRatesPickedListener {
@ -115,7 +116,7 @@ public class ServerStatusView extends RelativeLayout implements OnRatesPickedLis @@ -115,7 +116,7 @@ public class ServerStatusView extends RelativeLayout implements OnRatesPickedLis
@Override
public void onInvalidNumber() {
Crouton.showText(activity, R.string.error_notanumber, NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(activity).text(R.string.error_notanumber).colorResource(R.color.crouton_error));
}
}

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

@ -16,6 +16,9 @@ @@ -16,6 +16,9 @@
*/
package org.transdroid.core.gui;
import android.support.v7.widget.ActionMenuView;
import android.support.v7.widget.Toolbar;
import org.transdroid.daemon.Priority;
import org.transdroid.daemon.Torrent;
import org.transdroid.daemon.TorrentFile;

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

@ -26,9 +26,9 @@ import android.os.Build; @@ -26,9 +26,9 @@ import android.os.Build;
import android.os.Bundle;
import android.support.v4.view.MenuItemCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.ActionMenuView;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
@ -43,6 +43,8 @@ import android.widget.ListView; @@ -43,6 +43,8 @@ import android.widget.ListView;
import com.getbase.floatingactionbutton.FloatingActionButton;
import com.getbase.floatingactionbutton.FloatingActionsMenu;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Background;
@ -135,8 +137,6 @@ import java.util.List; @@ -135,8 +137,6 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import de.keyboardsurfer.android.widget.crouton.Crouton;
/**
* 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
@ -166,6 +166,8 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE @@ -166,6 +166,8 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
protected Toolbar torrentsToolbar;
@ViewById
protected Toolbar actionsToolbar;
@ViewById(R.id.contextual_menu)
protected ActionMenuView contextualMenu;
@ViewById
protected FloatingActionsMenu addmenuButton;
@ViewById
@ -404,12 +406,6 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE @@ -404,12 +406,6 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
autoRefreshTask = null;
}
@Override
protected void onDestroy() {
Crouton.cancelAllCroutons();
super.onDestroy();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
@ -418,35 +414,35 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE @@ -418,35 +414,35 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
if (actionsToolbar.getMenu().size() == 0) {
actionsToolbar.inflateMenu(R.menu.activity_torrents_secondary);
}
if (navigationHelper.enableSearchUi()) {
// Add an expandable SearchView to the action bar
MenuItem item = menu.findItem(R.id.action_search);
SearchView searchView = new SearchView(this);
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
searchView.setQueryRefinementEnabled(true);
searchView.setOnSearchClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// Pause autorefresh
stopRefresh = true;
stopAutoRefresh();
}
});
MenuItemCompat.setOnActionExpandListener(item, new MenuItemCompat.OnActionExpandListener() {
@Override
public boolean onMenuItemActionExpand(MenuItem item) {
return true;
}
if (navigationHelper.enableSearchUi()) {
// Add an expandable SearchView to the action bar
MenuItem item = menu.findItem(R.id.action_search);
SearchView searchView = new SearchView(torrentsToolbar.getContext());
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
searchView.setQueryRefinementEnabled(true);
searchView.setOnSearchClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// Pause autorefresh
stopRefresh = true;
stopAutoRefresh();
}
});
MenuItemCompat.setOnActionExpandListener(item, new MenuItemCompat.OnActionExpandListener() {
@Override
public boolean onMenuItemActionExpand(MenuItem item) {
return true;
}
@Override
public boolean onMenuItemActionCollapse(MenuItem item) {
stopRefresh = false;
startAutoRefresh();
return true;
}
});
MenuItemCompat.setActionView(item, searchView);
searchMenu = item;
@Override
public boolean onMenuItemActionCollapse(MenuItem item) {
stopRefresh = false;
startAutoRefresh();
return true;
}
});
MenuItemCompat.setActionView(item, searchView);
searchMenu = item;
}
return true;
}
@ -652,7 +648,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE @@ -652,7 +648,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
return;
}
if (dataUri.getScheme() == null) {
Crouton.showText(this, R.string.error_invalid_url_form, NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(this).text(R.string.error_invalid_url_form).colorResource(R.color.crouton_error));
return;
}
@ -768,7 +764,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE @@ -768,7 +764,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
protected void onBarcodeScanHandled(String barcode, String result) {
log.d(this, "Scanned barcode " + barcode + " and got " + result);
if (TextUtils.isEmpty(result)) {
Crouton.showText(this, R.string.error_noproductforcode, NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(this).text(R.string.error_noproductforcode).colorResource(R.color.crouton_error));
} else if (result.startsWith("http") || result.startsWith("https")) {
addTorrentByUrl(result, "QR code result"); // No torrent title known
} else if (navigationHelper.enableSearchUi()) {
@ -1030,10 +1026,10 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE @@ -1030,10 +1026,10 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
} catch (SecurityException e) {
// No longer access to this file
log.e(this, "No access given to " + contentUri.toString() + ": " + e.toString());
Crouton.showText(this, R.string.error_torrentfile, NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.crouton_error));
} catch (FileNotFoundException e) {
log.e(this, contentUri.toString() + " does not exist: " + e.toString());
Crouton.showText(this, R.string.error_torrentfile, NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.crouton_error));
}
}
@ -1045,7 +1041,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE @@ -1045,7 +1041,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
addTorrentFromStream(input, title);
} catch (Exception e) {
log.e(this, "Can't download private site torrent " + url + " from " + source + ": " + e.toString());
Crouton.showText(this, R.string.error_torrentfile, NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.crouton_error));
}
}
@ -1073,14 +1069,14 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE @@ -1073,14 +1069,14 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
response.getStatusLine().getStatusCode() == HttpStatus.SC_NOT_FOUND) {
log.e(this, "Can't retrieve web torrent " + url + ": Unexpected HTTP response status code " +
response.getStatusLine().toString());
Crouton.showText(this, R.string.error_401, NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(this).text(R.string.error_401).colorResource(R.color.crouton_error));
return;
}
InputStream input = response.getEntity().getContent();
addTorrentFromStream(input, title);
} catch (Exception e) {
log.e(this, "Can't retrieve web torrent " + url + ": " + e.toString());
Crouton.showText(this, R.string.error_torrentfile, NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.crouton_error));
}
}
@ -1106,7 +1102,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE @@ -1106,7 +1102,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
}
} catch (IOException e) {
log.e(this, "Can't write input stream to " + tempFile.toString() + ": " + e.toString());
Crouton.showText(this, R.string.error_torrentfile, NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.crouton_error));
} finally {
try {
if (input != null) {
@ -1114,7 +1110,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE @@ -1114,7 +1110,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
}
} catch (IOException e) {
log.e(this, "Error closing the input stream " + tempFile.toString() + ": " + e.toString());
Crouton.showText(this, R.string.error_torrentfile, NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.crouton_error));
}
}
}
@ -1251,7 +1247,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE @@ -1251,7 +1247,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
protected void onTaskSucceeded(DaemonTaskSuccessResult result, String successMessage) {
// Refresh the screen as well
refreshScreen();
Crouton.showText(this, successMessage, NavigationHelper.CROUTON_INFO_STYLE);
SnackbarManager.show(Snackbar.with(this).text(successMessage));
}
@UiThread
@ -1259,7 +1255,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE @@ -1259,7 +1255,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
//noinspection ThrowableResultOfMethodCallIgnored
log.i(this, result.getException().toString());
String error = getString(LocalTorrent.getResourceForDaemonException(result.getException()));
Crouton.showText(this, error, NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(this).text(error).colorResource(R.color.crouton_error));
fragmentTorrents.updateIsLoading(false);
if (isCritical) {
fragmentTorrents.updateError(error);

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

@ -17,7 +17,11 @@ @@ -17,7 +17,11 @@
package org.transdroid.core.gui;
import android.app.Fragment;
import android.content.Context;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.ActionMenuView;
import android.support.v7.widget.Toolbar;
import android.view.ActionMode;
import android.view.Menu;
import android.view.MenuItem;
@ -27,6 +31,8 @@ import android.widget.ListView; @@ -27,6 +31,8 @@ import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.getbase.floatingactionbutton.FloatingActionsMenu;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.Click;
@ -251,13 +257,33 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener @@ -251,13 +257,33 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
private MultiChoiceModeListener onTorrentsSelected = new MultiChoiceModeListener() {
SelectionManagerMode selectionManagerMode;
private SelectionManagerMode selectionManagerMode;
private ActionMenuView actionsMenu;
private Toolbar actionsToolbar;
private FloatingActionsMenu addmenuButton;
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
// Show contextual action bar to start/stop/remove/etc. torrents in batch mode
mode.getMenuInflater().inflate(R.menu.fragment_torrents_cab, menu);
selectionManagerMode = new SelectionManagerMode(torrentsList, R.plurals.navigation_torrentsselected);
public boolean onCreateActionMode(final ActionMode mode, Menu menu) {
// Show contextual action bars to start/stop/remove/etc. torrents in batch mode
if (actionsMenu == null) {
actionsMenu = ((TorrentsActivity) getActivity()).contextualMenu;
actionsToolbar = ((TorrentsActivity) getActivity()).actionsToolbar;
addmenuButton = ((TorrentsActivity) getActivity()).addmenuButton;
}
actionsToolbar.setEnabled(false);
actionsMenu.setVisibility(View.VISIBLE);
addmenuButton.setVisibility(View.GONE);
actionsMenu.setOnMenuItemClickListener(new ActionMenuView.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem menuItem) {
return onActionItemClicked(mode, menuItem);
}
});
if (actionsMenu.getMenu().size() == 0) {
getActivity().getMenuInflater().inflate(R.menu.fragment_torrents_cab, actionsMenu.getMenu());
}
Context themedContext = ((ActionBarActivity) getActivity()).getSupportActionBar().getThemedContext();
selectionManagerMode = new SelectionManagerMode(themedContext, torrentsList, R.plurals.navigation_torrentsselected);
selectionManagerMode.onCreateActionMode(mode, menu);
return true;
}
@ -267,9 +293,9 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener @@ -267,9 +293,9 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
selectionManagerMode.onPrepareActionMode(mode, menu);
// Hide/show options depending on the type of server we are connected to
if (daemonType != null) {
menu.findItem(R.id.action_start).setVisible(Daemon.supportsStoppingStarting(daemonType));
menu.findItem(R.id.action_stop).setVisible(Daemon.supportsStoppingStarting(daemonType));
menu.findItem(R.id.action_setlabel).setVisible(Daemon.supportsSetLabel(daemonType));
actionsMenu.getMenu().findItem(R.id.action_start).setVisible(Daemon.supportsStoppingStarting(daemonType));
actionsMenu.getMenu().findItem(R.id.action_stop).setVisible(Daemon.supportsStoppingStarting(daemonType));
actionsMenu.getMenu().findItem(R.id.action_setlabel).setVisible(Daemon.supportsSetLabel(daemonType));
}
// Pause autorefresh
if (getActivity() != null && getActivity() instanceof TorrentsActivity) {
@ -352,6 +378,9 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener @@ -352,6 +378,9 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
((TorrentsActivity) getActivity()).startAutoRefresh();
}
selectionManagerMode.onDestroyActionMode(mode);
actionsMenu.setVisibility(View.GONE);
actionsToolbar.setEnabled(true);
addmenuButton.setVisibility(View.VISIBLE);
}
};

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

@ -38,9 +38,6 @@ import org.transdroid.R; @@ -38,9 +38,6 @@ import org.transdroid.R;
import java.io.IOException;
import de.keyboardsurfer.android.widget.crouton.Crouton;
import de.keyboardsurfer.android.widget.crouton.Style;
/**
* 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.
@ -50,14 +47,6 @@ import de.keyboardsurfer.android.widget.crouton.Style; @@ -50,14 +47,6 @@ import de.keyboardsurfer.android.widget.crouton.Style;
@EBean
public class NavigationHelper {
/**
* Use with {@link Crouton#showText(android.app.Activity, int, Style)} (and variants) to display error messages.
*/
public static Style CROUTON_ERROR_STYLE = new Style.Builder().setBackgroundColor(R.color.crouton_error).setTextSize(13).build();
/**
* Use with {@link Crouton#showText(android.app.Activity, int, Style)} (and variants) to display info messages.
*/
public static Style CROUTON_INFO_STYLE = new Style.Builder().setBackgroundColor(R.color.crouton_info).setTextSize(13).build();
private static ImageLoader imageCache;
@RootContext
protected Context context;

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

@ -19,6 +19,7 @@ package org.transdroid.core.gui.navigation; @@ -19,6 +19,7 @@ package org.transdroid.core.gui.navigation;
import org.transdroid.core.gui.navigation.SelectionModificationSpinner.OnModificationActionSelectedListener;
import org.transdroid.daemon.Finishable;
import android.content.Context;
import android.util.SparseBooleanArray;
import android.view.ActionMode;
import android.view.Menu;
@ -35,18 +36,21 @@ import android.widget.ListView; @@ -35,18 +36,21 @@ import android.widget.ListView;
*/
public class SelectionManagerMode implements MultiChoiceModeListener, OnModificationActionSelectedListener {
private ListView managedList;
private int titleTemplateResource;
private final Context themedContext;
private final ListView managedList;
private final int titleTemplateResource;
private Class<?> onlyCheckClass = null;
/**
* Instantiates the helper by binding it to a specific {@link ListView} and providing the text resource to display
* 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 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
* will be supplied as numeric formatting argument
*/
public SelectionManagerMode(ListView managedList, int titleTemplateResource) {
public SelectionManagerMode(Context themedContext, ListView managedList, int titleTemplateResource) {
this.themedContext = themedContext;
this.managedList = managedList;
this.titleTemplateResource = titleTemplateResource;
}
@ -63,7 +67,7 @@ public class SelectionManagerMode implements MultiChoiceModeListener, OnModifica @@ -63,7 +67,7 @@ public class SelectionManagerMode implements MultiChoiceModeListener, OnModifica
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
// Allow modification of selection through a spinner
SelectionModificationSpinner selectionSpinner = new SelectionModificationSpinner(managedList.getContext());
SelectionModificationSpinner selectionSpinner = new SelectionModificationSpinner(themedContext);
selectionSpinner.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.MATCH_PARENT));
selectionSpinner.setOnModificationActionSelectedListener(this);
@ -85,7 +89,7 @@ public class SelectionManagerMode implements MultiChoiceModeListener, OnModifica @@ -85,7 +89,7 @@ public class SelectionManagerMode implements MultiChoiceModeListener, OnModifica
.getCheckedItemPositions().keyAt(i)))))
checkedCount++;
}
((SelectionModificationSpinner) mode.getCustomView()).updateTitle(managedList.getContext().getResources()
((SelectionModificationSpinner) mode.getCustomView()).updateTitle(themedContext.getResources()
.getQuantityString(titleTemplateResource, checkedCount, checkedCount));
}

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

@ -16,13 +16,6 @@ @@ -16,13 +16,6 @@
*/
package org.transdroid.core.gui.navigation;
import java.security.InvalidParameterException;
import java.util.Iterator;
import java.util.List;
import org.transdroid.R;
import org.transdroid.core.gui.lists.SimpleListItem;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
@ -34,7 +27,16 @@ import android.widget.AdapterView; @@ -34,7 +27,16 @@ import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.EditText;
import android.widget.ListView;
import de.keyboardsurfer.android.widget.crouton.Crouton;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;
import org.transdroid.R;
import org.transdroid.core.gui.lists.SimpleListItem;
import java.security.InvalidParameterException;
import java.util.Iterator;
import java.util.List;
/**
* A dialog fragment that allows picking a label or entering a new label to set this new label to the torrent.
@ -60,16 +62,17 @@ public class SetLabelDialog extends DialogFragment { @@ -60,16 +62,17 @@ public class SetLabelDialog extends DialogFragment {
}
/**
* Sets the list of currently known labels as are active on the server. These are offered to the user to pick a new
* label for the target torrents.
* Sets the list of currently known labels as are active on the server. These are offered to the user to pick a new label for the target
* torrents.
* @param currentLabels The list of torrent labels
* @return This dialog, for method chaining
*/
public SetLabelDialog setCurrentLabels(List<Label> currentLabels) {
// Discard the empty label in this list before storing it locally
for (Iterator<Label> iter = currentLabels.iterator(); iter.hasNext();) {
if (iter.next().isEmptyLabel())
for (Iterator<Label> iter = currentLabels.iterator(); iter.hasNext(); ) {
if (iter.next().isEmptyLabel()) {
iter.remove();
}
}
this.currentLabels = currentLabels;
return this;
@ -77,12 +80,13 @@ public class SetLabelDialog extends DialogFragment { @@ -77,12 +80,13 @@ public class SetLabelDialog extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
if (onLabelPickedListener == null)
throw new InvalidParameterException(
"Please first set the callback listener using setOnLabelPickedListener before opening the dialog.");
if (currentLabels == null)
if (onLabelPickedListener == null) {
throw new InvalidParameterException("Please first set the callback listener using setOnLabelPickedListener before opening the dialog.");
}
if (currentLabels == null) {
throw new InvalidParameterException(
"Please first set the list of currently known labels before opening the dialog, even if the list is empty.");
}
final View setlabelFrame = getActivity().getLayoutInflater().inflate(R.layout.dialog_setlabel, null, false);
final ListView labelsList = (ListView) setlabelFrame.findViewById(R.id.labels_list);
final EditText newlabelEdit = (EditText) setlabelFrame.findViewById(R.id.newlabel_edit);
@ -102,23 +106,22 @@ public class SetLabelDialog extends DialogFragment { @@ -102,23 +106,22 @@ public class SetLabelDialog extends DialogFragment {
}
});
}
return new AlertDialog.Builder(getActivity()).setView(setlabelFrame)
.setPositiveButton(R.string.status_update, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// User should have provided a new label
if (newlabelEdit.getText().toString().equals("")) {
Crouton.showText(getActivity(), R.string.error_notalabel,
NavigationHelper.CROUTON_ERROR_STYLE);
}
onLabelPickedListener.onLabelPicked(newlabelEdit.getText().toString());
}
}).setNeutralButton(R.string.status_label_remove, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
onLabelPickedListener.onLabelPicked(null);
}
}).setNegativeButton(android.R.string.cancel, null).show();
return new AlertDialog.Builder(getActivity()).setView(setlabelFrame).setPositiveButton(R.string.status_update, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// User should have provided a new label
if (newlabelEdit.getText().toString().equals("")) {
SnackbarManager.show(Snackbar.with(getActivity()).text(R.string.error_notalabel).colorResource(R.color.crouton_error));
return;
}
onLabelPickedListener.onLabelPicked(newlabelEdit.getText().toString());
}
}).setNeutralButton(R.string.status_label_remove, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
onLabelPickedListener.onLabelPicked(null);
}
}).setNegativeButton(android.R.string.cancel, null).show();
}
public interface OnLabelPickedListener {

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

@ -38,7 +38,7 @@ import org.transdroid.core.gui.navigation.NavigationHelper; @@ -38,7 +38,7 @@ import org.transdroid.core.gui.navigation.NavigationHelper;
@EViewGroup(R.layout.list_item_rssfeed)
public class RssfeedView extends LinearLayout {
private static final String GETFVO_URL = "http://g.etfv.co/%1$s";
private static final String GRABICON_URL = "http://grabicon.com/icon?origin=www.transdroid.org&domain=%1$s";
@Bean
protected NavigationHelper navigationHelper;
@ -71,7 +71,7 @@ public class RssfeedView extends LinearLayout { @@ -71,7 +71,7 @@ public class RssfeedView extends LinearLayout {
// Clear and then asynchronously load the RSS feed site' favicon
// Uses the g.etfv.co service to resolve the favicon of any feed URL
faviconImage.setImageDrawable(null);
navigationHelper.getImageCache().displayImage(String.format(GETFVO_URL, rssfeedLoader.getSetting().getUrl()), faviconImage);
navigationHelper.getImageCache().displayImage(String.format(GRABICON_URL, rssfeedLoader.getSetting().getUrl()), faviconImage);
}

9
app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java

@ -25,6 +25,9 @@ import android.support.v7.app.ActionBarActivity; @@ -25,6 +25,9 @@ import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Background;
import org.androidannotations.annotations.Bean;
@ -47,8 +50,6 @@ import java.util.ArrayList; @@ -47,8 +50,6 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import de.keyboardsurfer.android.widget.crouton.Crouton;
@EActivity(R.layout.activity_rssfeeds)
public class RssfeedsActivity extends ActionBarActivity {
@ -167,11 +168,11 @@ public class RssfeedsActivity extends ActionBarActivity { @@ -167,11 +168,11 @@ public class RssfeedsActivity extends ActionBarActivity {
// Error message or not yet loaded? Show a toast message instead of opening the items activity
if (loader.hasError()) {
Crouton.showText(this, R.string.rss_error, NavigationHelper.CROUTON_INFO_STYLE);
SnackbarManager.show(Snackbar.with(this).text(R.string.rss_error).colorResource(R.color.crouton_error));
return;
}
if (loader.getChannel() == null || loader.getChannel().getItems().size() == 0) {
Crouton.showText(this, R.string.rss_notloaded, NavigationHelper.CROUTON_INFO_STYLE);
SnackbarManager.show(Snackbar.with(this).text(R.string.rss_notloaded).colorResource(R.color.crouton_error));
return;
}

12
app/src/main/java/org/transdroid/core/gui/rss/RssitemsFragment.java

@ -27,6 +27,7 @@ import android.content.Context; @@ -27,6 +27,7 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.text.TextUtils;
import android.view.ActionMode;
import android.view.Menu;
@ -37,6 +38,9 @@ import android.widget.ListView; @@ -37,6 +38,9 @@ import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EFragment;
@ -45,7 +49,6 @@ import org.androidannotations.annotations.ItemClick; @@ -45,7 +49,6 @@ import org.androidannotations.annotations.ItemClick;
import org.androidannotations.annotations.ViewById;
import org.transdroid.R;
import org.transdroid.core.gui.TorrentsActivity_;
import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.gui.navigation.SelectionManagerMode;
import org.transdroid.core.gui.search.SearchActivity_;
import org.transdroid.core.rssparser.Channel;
@ -54,8 +57,6 @@ import org.transdroid.core.rssparser.Item; @@ -54,8 +57,6 @@ import org.transdroid.core.rssparser.Item;
import java.util.ArrayList;
import java.util.List;
import de.keyboardsurfer.android.widget.crouton.Crouton;
/**
* Fragment that lists the items in a specific RSS feed
* @author Eric Kok
@ -79,7 +80,8 @@ public class RssitemsFragment extends Fragment { @@ -79,7 +80,8 @@ public class RssitemsFragment extends Fragment {
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
// Show contextual action bar to add items in batch mode
mode.getMenuInflater().inflate(R.menu.fragment_rssitems_cab, menu);
selectionManagerMode = new SelectionManagerMode(rssitemsList, R.plurals.rss_itemsselected);
Context themedContext = ((ActionBarActivity) getActivity()).getSupportActionBar().getThemedContext();
selectionManagerMode = new SelectionManagerMode(themedContext, rssitemsList, R.plurals.rss_itemsselected);
selectionManagerMode.onCreateActionMode(mode, menu);
return true;
}
@ -153,7 +155,7 @@ public class RssitemsFragment extends Fragment { @@ -153,7 +155,7 @@ public class RssitemsFragment extends Fragment {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(first.getLink())));
} else {
// No URL was specified in the RSS feed item link tag (or no link tag was present)
Crouton.showText(getActivity(), R.string.error_no_link, NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(getActivity()).text(R.string.error_no_link).colorResource(R.color.crouton_error));
}
} else if (itemId == R.id.action_useassearch) {
// Use the RSS item title to start a new search (mimicking the search manager style)

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

@ -25,6 +25,7 @@ import android.os.Bundle; @@ -25,6 +25,7 @@ import android.os.Bundle;
import android.provider.SearchRecentSuggestions;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@ -62,6 +63,8 @@ import java.util.List; @@ -62,6 +63,8 @@ import java.util.List;
@OptionsMenu(R.menu.activity_search)
public class SearchActivity extends ActionBarActivity implements ActionBar.OnNavigationListener {
@ViewById
protected Toolbar searchToolbar;
@FragmentById(R.id.searchresults_fragment)
protected SearchResultsFragment fragmentResults;
@ViewById
@ -125,6 +128,7 @@ public class SearchActivity extends ActionBarActivity implements ActionBar.OnNav @@ -125,6 +128,7 @@ public class SearchActivity extends ActionBarActivity implements ActionBar.OnNav
}
// Allow site selection via list (on large screens) or action bar spinner
setSupportActionBar(searchToolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
if (searchsitesList != null) {
// The current layout has a dedicated list view to select the search site
@ -140,7 +144,7 @@ public class SearchActivity extends ActionBarActivity implements ActionBar.OnNav @@ -140,7 +144,7 @@ public class SearchActivity extends ActionBarActivity implements ActionBar.OnNav
// Use the action bar spinner to select sites
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
getSupportActionBar().setDisplayShowTitleEnabled(false);
getSupportActionBar().setListNavigationCallbacks(new SearchSettingsDropDownAdapter(this, searchSites), this);
getSupportActionBar().setListNavigationCallbacks(new SearchSettingsDropDownAdapter(searchToolbar.getContext(), searchSites), this);
// Select the last used site; this also starts the search!
if (lastUsedPosition >= 0) {
getSupportActionBar().setSelectedNavigationItem(lastUsedPosition);
@ -155,7 +159,7 @@ public class SearchActivity extends ActionBarActivity implements ActionBar.OnNav @@ -155,7 +159,7 @@ public class SearchActivity extends ActionBarActivity implements ActionBar.OnNav
if (navigationHelper.enableSearchUi()) {
// Add an expandable SearchView to the action bar
MenuItem item = menu.findItem(R.id.action_search);
final SearchView searchView = new SearchView(this);
final SearchView searchView = new SearchView(searchToolbar.getContext());
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
searchView.setQueryRefinementEnabled(true);
item.setActionView(searchView);

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

@ -28,7 +28,7 @@ import org.transdroid.BuildConfig; @@ -28,7 +28,7 @@ import org.transdroid.BuildConfig;
*/
public class SearchHistoryProvider extends SearchRecentSuggestionsProvider {
public final static String AUTHORITY = BuildConfig.PACKAGE_NAME + ".search.SearchHistoryProvider";
public final static String AUTHORITY = BuildConfig.APPLICATION_ID + ".search.SearchHistoryProvider";
public final static int MODE = DATABASE_MODE_QUERIES;
public SearchHistoryProvider() {

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

@ -17,8 +17,10 @@ @@ -17,8 +17,10 @@
package org.transdroid.core.gui.search;
import android.app.Fragment;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.ActionBarActivity;
import android.view.ActionMode;
import android.view.Menu;
import android.view.MenuItem;
@ -29,6 +31,9 @@ import android.widget.ProgressBar; @@ -29,6 +31,9 @@ import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Background;
import org.androidannotations.annotations.Bean;
@ -44,15 +49,12 @@ import org.transdroid.core.app.search.SearchResult; @@ -44,15 +49,12 @@ import org.transdroid.core.app.search.SearchResult;
import org.transdroid.core.app.search.SearchSite;
import org.transdroid.core.app.settings.SystemSettings_;
import org.transdroid.core.gui.TorrentsActivity_;
import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.gui.navigation.NavigationHelper_;
import org.transdroid.core.gui.navigation.SelectionManagerMode;
import java.util.ArrayList;
import java.util.List;
import de.keyboardsurfer.android.widget.crouton.Crouton;
/**
* Fragment that lists the items in a specific RSS feed
* @author Eric Kok
@ -129,7 +131,7 @@ public class SearchResultsFragment extends Fragment { @@ -129,7 +131,7 @@ public class SearchResultsFragment extends Fragment {
@ItemClick(R.id.searchresults_list)
protected void onItemClicked(SearchResult item) {
if (item.getTorrentUrl() == null) {
Crouton.showText(getActivity(), R.string.error_notorrentfile, NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(getActivity()).text(R.string.error_notorrentfile).colorResource(R.color.crouton_error));
return;
}
// Don't broadcast this intent; we can safely assume this is intended for Transdroid only
@ -150,7 +152,8 @@ public class SearchResultsFragment extends Fragment { @@ -150,7 +152,8 @@ public class SearchResultsFragment extends Fragment {
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
// Show contextual action bar to add items in batch mode
mode.getMenuInflater().inflate(R.menu.fragment_searchresults_cab, menu);
selectionManagerMode = new SelectionManagerMode(resultsList, R.plurals.search_resutlsselected);
Context themedContext = ((ActionBarActivity) getActivity()).getSupportActionBar().getThemedContext();
selectionManagerMode = new SelectionManagerMode(themedContext, resultsList, R.plurals.search_resutlsselected);
selectionManagerMode.onCreateActionMode(mode, menu);
return true;
}

43
app/src/main/java/org/transdroid/core/gui/settings/SystemSettingsActivity.java

@ -32,6 +32,9 @@ import android.preference.PreferenceActivity; @@ -32,6 +32,9 @@ import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.OnActivityResult;
@ -49,8 +52,6 @@ import org.transdroid.core.service.BootReceiver; @@ -49,8 +52,6 @@ import org.transdroid.core.service.BootReceiver;
import java.io.FileNotFoundException;
import java.io.IOException;
import de.keyboardsurfer.android.widget.crouton.Crouton;
@EActivity
public class SystemSettingsActivity extends PreferenceActivity {
@ -95,8 +96,7 @@ public class SystemSettingsActivity extends PreferenceActivity { @@ -95,8 +96,7 @@ public class SystemSettingsActivity extends PreferenceActivity {
@Override
public boolean onPreferenceClick(Preference preference) {
SearchHistoryProvider.clearHistory(getApplicationContext());
Crouton.showText(SystemSettingsActivity.this, R.string.pref_clearsearch_success,
NavigationHelper.CROUTON_INFO_STYLE);
SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.pref_clearsearch_success));
return true;
}
};
@ -106,15 +106,13 @@ public class SystemSettingsActivity extends PreferenceActivity { @@ -106,15 +106,13 @@ public class SystemSettingsActivity extends PreferenceActivity {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(SystemSettingsActivity.this);
try {
settingsPersistence.importSettingsFromFile(prefs, SettingsPersistence.DEFAULT_SETTINGS_FILE);
Crouton.showText(SystemSettingsActivity.this, R.string.pref_import_success,
NavigationHelper.CROUTON_INFO_STYLE);
SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.pref_import_success));
} catch (FileNotFoundException e) {
Crouton.showText(SystemSettingsActivity.this, R.string.error_file_not_found,
NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager
.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.error_file_not_found).colorResource(R.color.crouton_error));
} catch (JSONException e) {
Crouton.showText(SystemSettingsActivity.this,
getString(R.string.error_no_valid_settings_file, getString(R.string.app_name)),
NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this)
.text(getString(R.string.error_no_valid_settings_file, getString(R.string.app_name))).colorResource(R.color.crouton_error));
}
}
};
@ -130,14 +128,10 @@ public class SystemSettingsActivity extends PreferenceActivity { @@ -130,14 +128,10 @@ public class SystemSettingsActivity extends PreferenceActivity {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(SystemSettingsActivity.this);
try {
settingsPersistence.exportSettingsToFile(prefs, SettingsPersistence.DEFAULT_SETTINGS_FILE);
Crouton.showText(SystemSettingsActivity.this, R.string.pref_export_success,
NavigationHelper.CROUTON_INFO_STYLE);
} catch (JSONException e) {
Crouton.showText(SystemSettingsActivity.this, R.string.error_cant_write_settings_file,
NavigationHelper.CROUTON_ERROR_STYLE);
} catch (IOException e) {
Crouton.showText(SystemSettingsActivity.this, R.string.error_cant_write_settings_file,
NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.pref_export_success));
} catch (JSONException | IOException e) {
SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.error_cant_write_settings_file)
.colorResource(R.color.crouton_error));
}
}
};
@ -149,8 +143,8 @@ public class SystemSettingsActivity extends PreferenceActivity { @@ -149,8 +143,8 @@ public class SystemSettingsActivity extends PreferenceActivity {
String settings = settingsPersistence.exportSettingsAsString(prefs);
BarcodeHelper.shareContentBarcode(SystemSettingsActivity.this, settings);
} catch (JSONException e) {
Crouton.showText(SystemSettingsActivity.this, R.string.error_cant_write_settings_file,
NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.error_cant_write_settings_file)
.colorResource(R.color.crouton_error));
}
}
};
@ -191,11 +185,10 @@ public class SystemSettingsActivity extends PreferenceActivity { @@ -191,11 +185,10 @@ public class SystemSettingsActivity extends PreferenceActivity {
if (formatName != null && formatName.equals("QR_CODE") && !TextUtils.isEmpty(contents)) {
try {
settingsPersistence.importSettingsAsString(prefs, contents);
Crouton.showText(SystemSettingsActivity.this, R.string.pref_import_success,
NavigationHelper.CROUTON_INFO_STYLE);
SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.pref_import_success));
} catch (JSONException e) {
Crouton.showText(SystemSettingsActivity.this, R.string.error_file_not_found,
NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager
.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.error_file_not_found).colorResource(R.color.crouton_error));
}
}
}

46
app/src/main/java/org/transdroid/core/seedbox/XirvikSharedSettingsActivity.java

@ -16,7 +16,18 @@ @@ -16,7 +16,18 @@
*/
package org.transdroid.core.seedbox;
import java.io.InputStream;
import android.annotation.TargetApi;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.preference.EditTextPreference;
import android.preference.PreferenceManager;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EActivity;
@ -27,25 +38,15 @@ import org.apache.http.client.methods.HttpGet; @@ -27,25 +38,15 @@ import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.transdroid.R;
import org.transdroid.core.gui.log.Log;
import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.gui.settings.KeyBoundPreferencesActivity;
import org.transdroid.core.gui.settings.*;
import org.transdroid.core.gui.settings.MainSettingsActivity_;
import org.transdroid.daemon.util.HttpHelper;
import android.annotation.TargetApi;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.preference.EditTextPreference;
import android.preference.PreferenceManager;
import de.keyboardsurfer.android.widget.crouton.Crouton;
import java.io.InputStream;
/**
* Activity that allows for the configuration of a Xirvik shared seedbox. The key can be supplied to update an existing
* server setting instead of creating a new one.
* Activity that allows for the configuration of a Xirvik shared seedbox. The key can be supplied to update an existing server setting instead of
* creating a new one.
* @author Eric Kok
*/
@EActivity
@ -63,8 +64,7 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity { @@ -63,8 +64,7 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity {
// Load the raw preferences to show in this screen
init(R.xml.pref_seedbox_xirvikshared,
SeedboxProvider.XirvikShared.getSettings().getMaxSeedboxOrder(
PreferenceManager.getDefaultSharedPreferences(this)));
SeedboxProvider.XirvikShared.getSettings().getMaxSeedboxOrder(PreferenceManager.getDefaultSharedPreferences(this)));
initTextPreference("seedbox_xirvikshared_name");
initTextPreference("seedbox_xirvikshared_server");
initTextPreference("seedbox_xirvikshared_user");
@ -82,15 +82,14 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity { @@ -82,15 +82,14 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity {
try {
// When the shared server settings change, we also have to update the RPC mount point to use
SharedPreferences prefs = PreferenceManager
.getDefaultSharedPreferences(XirvikSharedSettingsActivity.this);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(XirvikSharedSettingsActivity.this);
String server = prefs.getString("seedbox_xirvikshared_server_" + key, null);
String user = prefs.getString("seedbox_xirvikshared_user_" + key, null);
String pass = prefs.getString("seedbox_xirvikshared_pass_" + key, null);
// Retrieve the RPC mount point setting from the server itself
DefaultHttpClient httpclient = HttpHelper.createStandardHttpClient(true, user, pass, true, null,
HttpHelper.DEFAULT_CONNECTION_TIMEOUT, server, 443);
DefaultHttpClient httpclient =
HttpHelper.createStandardHttpClient(true, user, pass, true, null, HttpHelper.DEFAULT_CONNECTION_TIMEOUT, server, 443);
String url = "https://" + server + ":443/browsers_addons/transdroid_autoconf.txt";
HttpResponse request = httpclient.execute(new HttpGet(url));
InputStream stream = request.getEntity().getContent();
@ -103,8 +102,7 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity { @@ -103,8 +102,7 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity {
} catch (Exception e) {
log.d(XirvikSharedSettingsActivity.this,
"Could not retrieve the Xirvik shared seedbox RPC mount point setting: " + e.toString());
log.d(XirvikSharedSettingsActivity.this, "Could not retrieve the Xirvik shared seedbox RPC mount point setting: " + e.toString());
return null;
}
@ -123,7 +121,7 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity { @@ -123,7 +121,7 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity {
Editor edit = PreferenceManager.getDefaultSharedPreferences(XirvikSharedSettingsActivity.this).edit();
EditTextPreference pref = (EditTextPreference) findPreference("seedbox_xirvikshared_rpc_" + key);
if (result == null) {
Crouton.showText(this, R.string.pref_seedbox_xirviknofolder, NavigationHelper.CROUTON_ERROR_STYLE);
SnackbarManager.show(Snackbar.with(this).text(R.string.pref_seedbox_xirviknofolder).colorResource(R.color.crouton_error));
edit.remove("seedbox_xirvikshared_rpc_" + key);
pref.setSummary("");
} else {

BIN
app/src/main/res/drawable-hdpi/btn_cab_done_default_transdroid2.9.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 B

BIN
app/src/main/res/drawable-hdpi/btn_cab_done_focused_transdroid2.9.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 B

BIN
app/src/main/res/drawable-hdpi/btn_cab_done_pressed_transdroid2.9.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 B

BIN
app/src/main/res/drawable-hdpi/ic_action_copy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

BIN
app/src/main/res/drawable-hdpi/ic_action_download.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

BIN
app/src/main/res/drawable-hdpi/ic_action_filter.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

0
app/src/main/res/drawable-hdpi/ic_action_rss.png.png → app/src/main/res/drawable-hdpi/ic_action_rss.png

Before

Width:  |  Height:  |  Size: 759 B

After

Width:  |  Height:  |  Size: 759 B

BIN
app/src/main/res/drawable-hdpi/ic_action_turtle_disabled_light.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
app/src/main/res/drawable-hdpi/ic_btn_sort.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

BIN
app/src/main/res/drawable-xhdpi/btn_cab_done_default_transdroid2.9.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 B

BIN
app/src/main/res/drawable-xhdpi/btn_cab_done_focused_transdroid2.9.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

BIN
app/src/main/res/drawable-xhdpi/btn_cab_done_pressed_transdroid2.9.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

BIN
app/src/main/res/drawable-xhdpi/ic_action_copy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

BIN
app/src/main/res/drawable-xhdpi/ic_action_download.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

BIN
app/src/main/res/drawable-xhdpi/ic_action_filter.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

BIN
app/src/main/res/drawable-xhdpi/ic_action_info_dark.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

BIN
app/src/main/res/drawable-xhdpi/ic_action_info_light.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

BIN
app/src/main/res/drawable-xhdpi/ic_btn_sort.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 B

BIN
app/src/main/res/drawable-xhdpi/ic_storage_white_24dp.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

BIN
app/src/main/res/drawable-xxhdpi/ic_action_copy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

BIN
app/src/main/res/drawable-xxhdpi/ic_action_download.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

BIN
app/src/main/res/drawable-xxhdpi/ic_action_filter.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

BIN
app/src/main/res/drawable-xxhdpi/ic_action_forcerecheck_dark.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

BIN
app/src/main/res/drawable-xxhdpi/ic_action_forcerecheck_light.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

BIN
app/src/main/res/drawable-xxhdpi/ic_action_info_dark.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

BIN
app/src/main/res/drawable-xxhdpi/ic_action_info_light.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

BIN
app/src/main/res/drawable-xxhdpi/ic_action_save_dark.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 495 B

BIN
app/src/main/res/drawable-xxhdpi/ic_action_save_light.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

0
app/src/main/res/drawable-xxhdpi/ic_btn_sort.png → app/src/main/res/drawable-xxhdpi/ic_action_sort.png

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 218 B

BIN
app/src/main/res/drawable-xxhdpi/ic_insert_link_white_24dp.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 670 B

BIN
app/src/main/res/drawable-xxxhdpi/ic_action_link.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 865 B

BIN
app/src/main/res/drawable-xxxhdpi/ic_action_search.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
app/src/main/res/drawable-xxxhdpi/ic_action_white.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

BIN
app/src/main/res/drawable-xxxhdpi/ic_btn_sort.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 B

27
app/src/main/res/drawable/btn_cab_done_transdroid2.xml

@ -1,27 +0,0 @@ @@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- File created by the Android Action Bar Style Generator
Copyright (C) 2011 The Android Open Source Project
Copyright (C) 2012 readyState Software Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/btn_cab_done_pressed_transdroid2" />
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/btn_cab_done_focused_transdroid2" />
<item android:state_enabled="true"
android:drawable="@drawable/btn_cab_done_default_transdroid2" />
</selector>

84
app/src/main/res/layout-w600dp/activity_search.xml

@ -15,42 +15,62 @@ @@ -15,42 +15,62 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:baselineAligned="false"
tools:context=".SearchActivity" >
android:orientation="horizontal"
tools:context=".core.gui.search.SearchActivity_">
<ListView
android:id="@+id/searchsites_list"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:choiceMode="singleChoice"
android:listSelector="?attr/activatable_background" />
<fragment
android:id="@+id/searchresults_fragment"
android:layout_width="0dip"
<android.support.v7.widget.Toolbar
android:id="@+id/search_toolbar"
style="@style/DefaultToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
class="org.transdroid.core.gui.search.SearchResultsFragment_"
tools:layout="@layout/fragment_searchresults" />
android:layout_below="@id/search_toolbar"
android:orientation="horizontal">
<TextView
android:id="@+id/installmodule_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawablePadding="8dip"
android:drawableTop="?attr/loading_progress"
android:gravity="center"
android:maxWidth="400dip"
android:padding="@dimen/margin_default"
android:text="@string/search_installsearch"
android:textIsSelectable="false"
android:visibility="gone" />
</LinearLayout>
<ListView
android:id="@+id/searchsites_list"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:choiceMode="singleChoice"
android:listSelector="?attr/activatable_background"
tools:listitem="@layout/list_item_searchsite" />
<fragment
android:id="@+id/searchresults_fragment"
class="org.transdroid.core.gui.search.SearchResultsFragment_"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="2"
tools:layout="@layout/fragment_searchresults" />
<TextView
android:id="@+id/installmodule_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawablePadding="8dip"
android:drawableTop="?attr/loading_progress"
android:gravity="center"
android:maxWidth="400dip"
android:padding="@dimen/margin_default"
android:text="@string/search_installsearch"
android:textIsSelectable="false"
android:visibility="gone" />
</LinearLayout>
<View
style="@style/DefaultToolbarShadow"
android:layout_below="@id/search_toolbar" />
</RelativeLayout>

20
app/src/main/res/layout-w600dp/activity_torrents.xml

@ -37,7 +37,19 @@ @@ -37,7 +37,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:minHeight="?attr/actionBarSize" />
android:minHeight="?attr/actionBarSize"
android:paddingEnd="@dimen/ui_actions_padding"
android:paddingRight="@dimen/ui_actions_padding" />
<android.support.v7.widget.ActionMenuView
android:id="@+id/contextual_menu"
style="@style/SplitToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:minHeight="?attr/actionBarSize"
android:visibility="gone"
tools:visibility="visible" />
<android.support.v7.widget.SearchView
android:id="@+id/filter_search"
@ -46,7 +58,11 @@ @@ -46,7 +58,11 @@
android:layout_above="@id/actions_toolbar"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_margin="5dp"
android:layout_marginBottom="5dp"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
app:searchIcon="@drawable/ic_action_filter"
app:queryHint="@string/action_filter"
app:iconifiedByDefault="false" />

22
app/src/main/res/layout-w900dp/activity_torrents.xml

@ -17,8 +17,8 @@ @@ -17,8 +17,8 @@
-->
<!-- This layout is for 7" and 10" tablets in landscape shows torrents, filters and details. -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".core.gui.TorrentsActivity_">
@ -41,9 +41,13 @@ @@ -41,9 +41,13 @@
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_margin="5dp"
android:layout_marginBottom="5dp"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
app:iconifiedByDefault="false"
app:queryHint="@string/action_filter"
app:iconifiedByDefault="false" />
app:searchIcon="@drawable/ic_action_filter" />
<ListView
android:id="@+id/filters_list"
@ -78,6 +82,18 @@ @@ -78,6 +82,18 @@
android:layout_toStartOf="@id/fragments_divider"
android:minHeight="?attr/actionBarSize" />
<android.support.v7.widget.ActionMenuView
android:id="@+id/contextual_toolbar"
style="@style/SplitToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/fragments_divider"
android:layout_toStartOf="@id/fragments_divider"
android:layout_alignParentBottom="true"
android:minHeight="?attr/actionBarSize"
android:visibility="gone"
tools:visibility="visible" />
<android.support.v7.widget.Toolbar
android:id="@+id/torrents_toolbar"
style="@style/DefaultToolbar"

7
app/src/main/res/layout/actionbar_searchsite.xml

@ -19,15 +19,16 @@ @@ -19,15 +19,16 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingRight="@dimen/margin_half" >
android:paddingEnd="@dimen/margin_half"
android:paddingRight="@dimen/margin_half">
<TextView
android:id="@+id/searchsite_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-condensed"
android:textColor="?attr/text_actionbar"
android:textIsSelectable="false"
android:textSize="18sp"
android:fontFamily="sans-serif-condensed" />
android:textSize="18sp" />
</FrameLayout>

58
app/src/main/res/layout/activity_search.xml

@ -15,31 +15,49 @@ @@ -15,31 +15,49 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SearchActivity" >
tools:context=".core.gui.search.SearchActivity_">
<fragment
android:id="@+id/searchresults_fragment"
<android.support.v7.widget.Toolbar
android:id="@+id/search_toolbar"
style="@style/DefaultToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
class="org.transdroid.core.gui.search.SearchResultsFragment_"
tools:layout="@layout/fragment_searchresults" />
android:layout_below="@id/search_toolbar">
<TextView
android:id="@+id/installmodule_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawablePadding="8dip"
android:drawableTop="?attr/loading_progress"
android:gravity="center"
android:maxWidth="400dip"
android:padding="@dimen/margin_default"
android:text="@string/search_installsearch"
android:textIsSelectable="false"
android:visibility="gone" />
<fragment
android:id="@+id/searchresults_fragment"
class="org.transdroid.core.gui.search.SearchResultsFragment_"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_searchresults" />
<TextView
android:id="@+id/installmodule_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawablePadding="8dip"
android:drawableTop="?attr/loading_progress"
android:gravity="center"
android:maxWidth="400dip"
android:padding="@dimen/margin_default"
android:text="@string/search_installsearch"
android:textIsSelectable="false"
android:visibility="gone" />
</FrameLayout>
<View
style="@style/DefaultToolbarShadow"
android:layout_below="@id/search_toolbar" />
</FrameLayout>
</RelativeLayout>

25
app/src/main/res/layout/activity_torrents.xml

@ -19,11 +19,11 @@ @@ -19,11 +19,11 @@
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".core.gui.TorrentsActivity_"
xmlns:app="http://schemas.android.com/apk/res-auto">
tools:context=".core.gui.TorrentsActivity_">
<!-- The main content view -->
<RelativeLayout
@ -45,8 +45,18 @@ @@ -45,8 +45,18 @@
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:minHeight="?attr/actionBarSize"
android:paddingRight="85dp"
android:paddingEnd="85dp" />
android:paddingEnd="@dimen/ui_actions_padding"
android:paddingRight="@dimen/ui_actions_padding" />
<android.support.v7.widget.ActionMenuView
android:id="@+id/contextual_menu"
style="@style/SplitToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:minHeight="?attr/actionBarSize"
android:visibility="gone"
tools:visibility="visible"/>
<fragment
android:id="@+id/torrents_fragment"
@ -101,12 +111,13 @@ @@ -101,12 +111,13 @@
android:id="@+id/filter_search"
android:layout_width="@dimen/ui_filters_list"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_marginEnd="5dp"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="5dp"
app:iconifiedByDefault="false"
app:queryHint="@string/action_filter"
app:iconifiedByDefault="false" />
app:searchIcon="@drawable/ic_action_filter" />
</LinearLayout>

16
app/src/main/res/layout/fragment_details.xml

@ -31,6 +31,16 @@ @@ -31,6 +31,16 @@
android:layout_alignParentBottom="true"
android:minHeight="?attr/actionBarSize" />
<android.support.v7.widget.ActionMenuView
android:id="@+id/contextual_menu"
style="@style/SplitToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:minHeight="?attr/actionBarSize"
android:visibility="gone"
tools:visibility="visible"/>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout"
android:layout_width="match_parent"
@ -52,12 +62,12 @@ @@ -52,12 +62,12 @@
android:id="@+id/loading_progress"
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_gravity="center"
android:layout_above="@id/details_menu"
android:layout_centerInParent="true"
android:indeterminate="true"
android:indeterminateDrawable="?attr/loading_progress"
android:indeterminateOnly="true"
android:visibility="gone" />
android:visibility="gone"
tools:visibility="visible" />
<TextView
android:id="@+id/empty_text"

9
app/src/main/res/layout/fragment_searchresults.xml

@ -16,15 +16,18 @@ @@ -16,15 +16,18 @@
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:layout_height="match_parent">
<ListView
android:id="@+id/searchresults_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:choiceMode="multipleChoiceModal"
android:visibility="gone" />
android:visibility="gone"
tools:listitem="@layout/list_item_searchresult"
tools:visibility="visible" />
<ProgressBar
android:id="@+id/loading_progress"
@ -34,7 +37,7 @@ @@ -34,7 +37,7 @@
android:indeterminate="true"
android:indeterminateDrawable="?attr/loading_progress"
android:indeterminateOnly="true" />
<TextView
android:id="@+id/empty_text"
android:layout_width="wrap_content"

2
app/src/main/res/layout/list_item_filter.xml

@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
android:paddingBottom="@dimen/margin_half"
android:paddingLeft="@dimen/margin_default"
android:paddingRight="@dimen/margin_default"
android:paddingTop="@dimen/margin_half" >
android:paddingTop="@dimen/margin_half">
<TextView
android:id="@+id/item_text"

6
app/src/main/res/layout/list_item_rssfeed.xml

@ -21,16 +21,14 @@ @@ -21,16 +21,14 @@
android:layout_height="wrap_content"
android:background="?attr/activatable_background"
android:orientation="horizontal"
android:paddingBottom="@dimen/margin_default"
android:paddingLeft="@dimen/margin_default"
android:paddingRight="@dimen/margin_default"
android:paddingTop="@dimen/margin_default" >
android:padding="@dimen/margin_default" >
<ImageView
android:id="@+id/favicon_image"
android:layout_width="24dip"
android:layout_height="24dip"
android:layout_marginRight="@dimen/margin_default"
android:layout_marginEnd="@dimen/margin_default"
android:scaleType="centerCrop"
tools:src="@drawable/ic_launcher"
tools:ignore="contentDescription" />

35
app/src/main/res/layout/list_item_searchresult.xml

@ -16,13 +16,14 @@ @@ -16,13 +16,14 @@
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<org.transdroid.core.gui.rss.RssitemStatusLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/activatable_background"
android:paddingBottom="@dimen/margin_half"
android:paddingLeft="@dimen/margin_default"
android:paddingRight="@dimen/margin_default"
android:paddingTop="@dimen/margin_half" >
android:paddingTop="@dimen/margin_half">
<TextView
android:id="@+id/name_text"
@ -31,44 +32,54 @@ @@ -31,44 +32,54 @@
android:fontFamily="sans-serif-condensed"
android:textColor="?attr/text_bright"
android:textIsSelectable="false"
android:textSize="@dimen/text_enlarged" />
android:textSize="@dimen/text_enlarged"
tools:text="Torrent.Title.2016.1080p.mkv" />
<TextView
android:id="@+id/leechers_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/name_text"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="@id/name_text"
android:layout_marginTop="4dip"
android:textIsSelectable="false"
android:textSize="@dimen/text_small" />
android:textSize="@dimen/text_small"
tools:text="@string/search_seeders" />
<TextView
android:id="@+id/seeders_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/leechers_text"
android:layout_toLeftOf="@id/leechers_text"
android:layout_marginEnd="@dimen/margin_default"
android:layout_marginRight="@dimen/margin_default"
android:layout_toLeftOf="@id/leechers_text"
android:layout_toStartOf="@id/leechers_text"
android:textIsSelectable="false"
android:textSize="@dimen/text_small" />
android:textSize="@dimen/text_small"
tools:text="@string/search_leechers" />
<TextView
android:id="@+id/size_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/leechers_text"
android:textIsSelectable="false"
android:textSize="@dimen/text_small" />
android:textSize="@dimen/text_small"
tools:text="1.5GB" />
<TextView
android:id="@+id/date_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/leechers_text"
android:layout_toRightOf="@id/size_text"
android:layout_marginLeft="@dimen/margin_default"
android:layout_marginStart="@dimen/margin_default"
android:layout_toEndOf="@id/size_text"
android:layout_toRightOf="@id/size_text"
android:textIsSelectable="false"
android:textSize="@dimen/text_small" />
android:textSize="@dimen/text_small"
tools:text="0 weeks ago" />
</org.transdroid.core.gui.rss.RssitemStatusLayout>

6
app/src/main/res/layout/list_item_searchsite.xml

@ -24,12 +24,13 @@ @@ -24,12 +24,13 @@
android:paddingBottom="@dimen/margin_half"
android:paddingLeft="@dimen/margin_default"
android:paddingRight="@dimen/margin_default"
android:paddingTop="@dimen/margin_half" >
android:paddingTop="@dimen/margin_half">
<ImageView
android:id="@+id/favicon_image"
android:layout_width="24dip"
android:layout_height="24dip"
android:layout_marginEnd="@dimen/margin_half"
android:layout_marginRight="@dimen/margin_half"
android:scaleType="centerCrop"
tools:ignore="contentDescription" />
@ -40,6 +41,7 @@ @@ -40,6 +41,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="1dip"
android:layout_weight="1"
android:textIsSelectable="false" />
android:textIsSelectable="false"
tools:text="Mininova" />
</LinearLayout>

2
app/src/main/res/layout/list_item_separator.xml

@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/margin_default"
android:paddingRight="@dimen/margin_default" >
android:paddingRight="@dimen/margin_default">
<TextView
android:id="@+id/separator_text"

6
app/src/main/res/layout/list_item_simple.xml

@ -21,13 +21,13 @@ @@ -21,13 +21,13 @@
android:paddingBottom="4dip"
android:paddingLeft="@dimen/margin_default"
android:paddingRight="@dimen/margin_default"
android:paddingTop="4dip" >
android:paddingTop="4dip">
<TextView
android:id="@+id/item_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_default"
android:textIsSelectable="false" />
android:textIsSelectable="false"
android:textSize="@dimen/text_default" />
</FrameLayout>

32
app/src/main/res/layout/list_item_torrent.xml

@ -16,34 +16,41 @@ @@ -16,34 +16,41 @@
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<org.transdroid.core.gui.lists.TorrentStatusLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/activatable_background"
android:orientation="vertical"
android:paddingRight="@dimen/margin_default"
android:paddingBottom="@dimen/margin_half" >
android:paddingEnd="@dimen/margin_default"
android:paddingBottom="@dimen/margin_half">
<TextView
android:id="@+id/name_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_torrentlistleft"
android:layout_marginStart="@dimen/margin_torrentlistleft"
android:fontFamily="sans-serif-condensed"
android:paddingTop="@dimen/margin_half"
android:textColor="?attr/text_bright"
android:textIsSelectable="false"
android:textSize="@dimen/text_enlarged" />
android:textSize="@dimen/text_enlarged"
tools:text="Torrent.Title.That.Can-Be.Long.2015.1080p.Group.Release.mkv" />
<TextView
android:id="@+id/ratio_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_below="@id/name_text"
android:layout_marginLeft="@dimen/margin_half"
android:layout_marginStart="@dimen/margin_half"
android:layout_marginTop="4.0dip"
android:textIsSelectable="false"
android:textSize="@dimen/text_small" />
android:textSize="@dimen/text_small"
tools:text="RATIO 2.3" />
<ImageView
android:id="@+id/priority_image"
@ -51,7 +58,9 @@ @@ -51,7 +58,9 @@
android:layout_height="wrap_content"
android:layout_alignBottom="@id/ratio_text"
android:layout_marginLeft="@dimen/margin_half"
android:layout_marginStart="@dimen/margin_half"
android:layout_toLeftOf="@id/ratio_text"
android:layout_toStartOf="@id/ratio_text"
android:contentDescription="@string/status_priority_normal" />
<TextView
@ -60,10 +69,14 @@ @@ -60,10 +69,14 @@
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/ratio_text"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="@dimen/margin_torrentlistleft"
android:layout_marginStart="@dimen/margin_torrentlistleft"
android:layout_toLeftOf="@id/priority_image"
android:layout_toStartOf="@id/priority_image"
android:textIsSelectable="false"
android:textSize="@dimen/text_small" />
android:textSize="@dimen/text_small"
tools:text="6.6GB, UPLOADED 15GB"/>
<org.transdroid.core.gui.lists.TorrentProgressBar
android:id="@+id/torrent_progressbar"
@ -78,11 +91,14 @@ @@ -78,11 +91,14 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_below="@id/torrent_progressbar"
android:layout_marginLeft="@dimen/margin_half"
android:layout_marginStart="@dimen/margin_half"
android:paddingTop="@dimen/margin_half"
android:textIsSelectable="false"
android:textSize="@dimen/text_small" />
android:textSize="@dimen/text_small"
tools:text="280 KB/s" />
<TextView
android:id="@+id/peers_text"
@ -90,10 +106,14 @@ @@ -90,10 +106,14 @@
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/speed_text"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="@dimen/margin_torrentlistleft"
android:layout_marginStart="@dimen/margin_torrentlistleft"
android:layout_toLeftOf="@id/speed_text"
android:layout_toStartOf="@id/speed_text"
android:paddingTop="@dimen/margin_half"
android:textIsSelectable="false"
android:textSize="@dimen/text_small" />
android:textSize="@dimen/text_small"
tools:text="28 OF 102 SEEDERS" />
</org.transdroid.core.gui.lists.TorrentStatusLayout>

14
app/src/main/res/layout/list_item_torrentfile.xml

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<org.transdroid.core.gui.lists.TorrentFilePriorityLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/activatable_background"
@ -23,7 +24,7 @@ @@ -23,7 +24,7 @@
android:paddingBottom="@dimen/margin_half"
android:paddingLeft="@dimen/margin_default"
android:paddingRight="@dimen/margin_default"
android:paddingTop="@dimen/margin_half" >
android:paddingTop="@dimen/margin_half">
<TextView
android:id="@+id/name_text"
@ -32,18 +33,22 @@ @@ -32,18 +33,22 @@
android:fontFamily="sans-serif-condensed"
android:textColor="?attr/text_bright"
android:textIsSelectable="false"
android:textSize="@dimen/text_enlarged" />
android:textSize="@dimen/text_enlarged"
tools:text="File.In.Torrent.Title.Which.Can.Be.Long.2016.1080p.Release.mkv" />
<TextView
android:id="@+id/progress_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="@id/name_text"
android:layout_marginLeft="@dimen/margin_half"
android:layout_marginStart="@dimen/margin_half"
android:layout_marginTop="4dip"
android:textIsSelectable="false"
android:textSize="@dimen/text_small" />
android:textSize="@dimen/text_small"
tools:text="41%" />
<TextView
android:id="@+id/sizes_text"
@ -51,6 +56,7 @@ @@ -51,6 +56,7 @@
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/progress_text"
android:textIsSelectable="false"
android:textSize="@dimen/text_small" />
android:textSize="@dimen/text_small"
tools:text="3.4GB / 8.2GB" />
</org.transdroid.core.gui.lists.TorrentFilePriorityLayout>

15
app/src/main/res/menu/fragment_details_cab.xml → app/src/main/res/menu/fragment_details_cab_main.xml

@ -21,29 +21,26 @@ @@ -21,29 +21,26 @@
android:id="@+id/action_priority_off"
android:icon="@drawable/ic_action_priority_off"
android:title="@string/action_priority_off"
app:showAsAction="ifRoom" />
app:showAsAction="always" />
<item
android:id="@+id/action_priority_low"
android:icon="@drawable/ic_action_priority_low"
android:title="@string/action_priority_low"
app:showAsAction="ifRoom" />
app:showAsAction="always" />
<item
android:id="@+id/action_priority_normal"
android:icon="@drawable/ic_action_priority_medium"
android:title="@string/action_priority_normal"
app:showAsAction="ifRoom" />
app:showAsAction="always" />
<item
android:id="@+id/action_priority_high"
android:icon="@drawable/ic_action_priority_high"
android:title="@string/action_priority_high"
app:showAsAction="ifRoom" />
app:showAsAction="always" />
<item
android:id="@+id/action_download"
android:icon="@drawable/ic_action_download"
android:title="@string/action_download"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_copytoclipboard"
android:title="@string/action_copytoclipboard"
app:showAsAction="never" />
app:showAsAction="always" />
</menu>

26
app/src/main/res/menu/fragment_details_cab_secondary.xml

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
<!--
Copyright 2010-2013 Eric Kok et al.
Transdroid is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Transdroid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_copytoclipboard"
android:icon="@drawable/ic_action_copy"
android:title="@string/action_copytoclipboard"
app:showAsAction="always" />
</menu>

12
app/src/main/res/menu/fragment_torrents_cab.xml

@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
android:id="@+id/action_resume"
android:icon="@drawable/ic_action_resume"
android:title="@string/action_resume"
app:showAsAction="ifRoom" />
app:showAsAction="always" />
<item
android:id="@+id/action_pause"
android:icon="@drawable/ic_action_pause"
android:title="@string/action_pause"
app:showAsAction="ifRoom" />
app:showAsAction="always" />
<item
android:id="@+id/action_start"
android:icon="@drawable/ic_action_start"
android:title="@string/action_start"
app:showAsAction="ifRoom" />
app:showAsAction="always" />
<item
android:id="@+id/action_stop"
android:icon="@drawable/ic_action_stop"
android:title="@string/action_stop"
app:showAsAction="ifRoom" />
app:showAsAction="always" />
<item
android:id="@+id/action_remove"
android:icon="@drawable/ic_action_remove"
android:title="@string/action_remove"
app:showAsAction="ifRoom">
app:showAsAction="always">
<menu>
<item
android:id="@+id/action_remove_default"
@ -55,6 +55,6 @@ @@ -55,6 +55,6 @@
android:id="@+id/action_setlabel"
android:icon="@drawable/ic_action_labels"
android:title="@string/action_setlabel"
app:showAsAction="ifRoom" />
app:showAsAction="always" />
</menu>

2
app/src/main/res/values-v21/styles.xml

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="TransdroidTheme" parent="Theme.Transdroid.Light">
<item name="activatable_background">?android:attr/selectableItemBackground</item>
<item name="activatable_background">?android:attr/activatedBackgroundIndicator</item>
</style>
<style name="TransdroidTheme.Dark" parent="Theme.Transdroid.Dark">

1
app/src/main/res/values/dimens.xml

@ -34,6 +34,7 @@ @@ -34,6 +34,7 @@
<dimen name="ui_filters_list">220dp</dimen>
<dimen name="ui_navigation_filter">17sp</dimen>
<dimen name="ui_navigation_server">14sp</dimen>
<dimen name="ui_actions_padding">75dp</dimen>
<dimen name="ui_details_seperator">105dp</dimen>
<dimen name="ui_serverstatus_margin">2dp</dimen>
<dimen name="ui_serverstatus_signmargin">3dp</dimen>

Loading…
Cancel
Save