diff --git a/README.md b/README.md
index f22712a4..f61b3336 100644
--- a/README.md
+++ b/README.md
@@ -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
============
diff --git a/app/build.gradle b/app/build.gradle
index 695d67fe..043473d8 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,29 +1,19 @@
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
-apply from: '../signing.gradle'
android {
- compileSdkVersion 19
- buildToolsVersion '20.0.0'
+ compileSdkVersion 22
+ buildToolsVersion '21.1.2'
defaultConfig {
minSdkVersion 15
- targetSdkVersion 19
- versionCode 217
- versionName '2.3.0'
- }
- signingConfigs {
- release {
- storeFile STORE_FILE
- storePassword STORE_PASSWORD
- keyAlias KEY_ALIAS
- keyPassword KEY_PASSWORD
- }
+ targetSdkVersion 22
+ versionCode 218
+ versionName '2.5.0-SNAPSHOT'
}
buildTypes {
release {
- runProguard false
- signingConfig signingConfigs.release
+ minifyEnabled false
}
}
productFlavors {
@@ -43,19 +33,21 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
- compile 'org.androidannotations:androidannotations-api:3.1'
+ compile 'org.androidannotations:androidannotations-api:3.2'
compile 'com.j256.ormlite:ormlite-core:4.48'
compile 'com.j256.ormlite:ormlite-android:4.48'
- compile 'com.github.chrisbanes.actionbarpulltorefresh:library:0.8'
- compile 'de.keyboardsurfer.android.widget:crouton:1.8.+'
- compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.+'
+ compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
+ compile 'com.android.support:appcompat-v7:22.1.0'
compile 'com.android.support:support-annotations:20.0.0'
- apt "org.androidannotations:androidannotations:3.1"
+ 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'
}
apt {
arguments {
- androidManifestFile variant.processResources.manifestFile
+ androidManifestFile variant.outputs[0].processResources.manifestFile
resourcePackageName 'org.transdroid'
//logLevel 'INFO'
//logFile '/Users/erickok/Dev/transdroid/transdroid/app/build/aa-log.txt'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 2f24b2c4..4499a430 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -44,7 +44,7 @@
android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
- android:theme="@android:style/Theme.Holo" >
+ android:theme="@style/Theme.AppCompat" >
-
+
files, Priority priority) {
- DaemonTaskResult result = SetFilePriorityTask.create(currentConnection, torrent, priority,
- new ArrayList(files)).execute(log);
+ DaemonTaskResult result = SetFilePriorityTask.create(currentConnection, torrent, priority, new ArrayList<>(files)).execute(log);
if (result instanceof DaemonTaskSuccessResult) {
onTaskSucceeded((DaemonTaskSuccessResult) result, getString(R.string.result_priotitiesset));
} else {
@@ -353,12 +323,11 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@UiThread
protected void onTaskSucceeded(DaemonTaskSuccessResult result, String successMessage) {
// Set the activity result so the calling activity knows it needs to update its view
- setResult(RESULT_OK,
- new Intent().putExtra("torrent_updated", true).putExtra("affected_torrent", torrent));
+ setResult(RESULT_OK, new Intent().putExtra("torrent_updated", true).putExtra("affected_torrent", torrent));
// Refresh the screen as well
refreshTorrent();
refreshTorrentDetails(torrent);
- Crouton.showText(this, successMessage, NavigationHelper.CROUTON_INFO_STYLE);
+ SnackbarManager.show(Snackbar.with(this).text(successMessage));
}
@UiThread
@@ -370,7 +339,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@UiThread
protected void onTorrentFilesRetrieved(Torrent torrent, List torrentFiles) {
// Update the details fragment with the newly retrieved list of files
- fragmentDetails.updateTorrentFiles(torrent, new ArrayList(torrentFiles));
+ fragmentDetails.updateTorrentFiles(torrent, new ArrayList<>(torrentFiles));
}
@UiThread
@@ -378,8 +347,8 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
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.red));
}
@UiThread
@@ -387,8 +356,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
// Update the details fragment accordingly
fragmentDetails.updateIsLoading(false, null);
fragmentDetails.perhapsUpdateTorrent(torrents);
- fragmentDetails.updateLabels(Label.convertToNavigationLabels(labels,
- getResources().getString(R.string.labels_unlabeled)));
+ fragmentDetails.updateLabels(Label.convertToNavigationLabels(labels, getResources().getString(R.string.labels_unlabeled)));
}
}
diff --git a/app/src/main/java/org/transdroid/core/gui/DetailsFragment.java b/app/src/main/java/org/transdroid/core/gui/DetailsFragment.java
index 013bbbab..5e2db024 100644
--- a/app/src/main/java/org/transdroid/core/gui/DetailsFragment.java
+++ b/app/src/main/java/org/transdroid/core/gui/DetailsFragment.java
@@ -16,9 +16,28 @@
*/
package org.transdroid.core.gui;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
+import android.annotation.SuppressLint;
+import android.app.Fragment;
+import android.content.ClipData;
+import android.content.ClipboardManager;
+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;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.AbsListView.MultiChoiceModeListener;
+import android.widget.ListView;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+
+import com.nispok.snackbar.Snackbar;
+import com.nispok.snackbar.SnackbarManager;
+import com.nispok.snackbar.enums.SnackbarType;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Click;
@@ -26,13 +45,17 @@ import org.androidannotations.annotations.EFragment;
import org.androidannotations.annotations.InstanceState;
import org.androidannotations.annotations.ItemClick;
import org.androidannotations.annotations.OptionsItem;
-import org.androidannotations.annotations.OptionsMenu;
import org.androidannotations.annotations.ViewById;
import org.transdroid.R;
-import org.transdroid.core.app.settings.*;
+import org.transdroid.core.app.settings.ServerSetting;
+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.*;
+import org.transdroid.core.gui.navigation.Label;
+import org.transdroid.core.gui.navigation.NavigationHelper_;
+import org.transdroid.core.gui.navigation.RefreshableActivity;
+import org.transdroid.core.gui.navigation.SelectionManagerMode;
+import org.transdroid.core.gui.navigation.SetLabelDialog;
import org.transdroid.core.gui.navigation.SetLabelDialog.OnLabelPickedListener;
import org.transdroid.core.gui.navigation.SetStorageLocationDialog;
import org.transdroid.core.gui.navigation.SetStorageLocationDialog.OnStorageLocationUpdatedListener;
@@ -44,33 +67,18 @@ import org.transdroid.daemon.Torrent;
import org.transdroid.daemon.TorrentDetails;
import org.transdroid.daemon.TorrentFile;
-import android.annotation.SuppressLint;
-import android.app.Fragment;
-import android.content.ClipData;
-import android.content.ClipboardManager;
-import android.content.Context;
-import android.content.Intent;
-import android.net.Uri;
-import android.view.ActionMode;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.widget.AbsListView.MultiChoiceModeListener;
-import android.widget.ListView;
-import android.widget.ProgressBar;
-import android.widget.TextView;
-import de.keyboardsurfer.android.widget.crouton.Crouton;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
/**
- * 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 TorrentTasksExecutor} interface.
+ * 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
+ * TorrentTasksExecutor} interface.
* @author Eric Kok
*/
-@EFragment(resName = "fragment_details")
-@OptionsMenu(resName = "fragment_details")
-public class DetailsFragment extends Fragment implements OnTrackersUpdatedListener, OnLabelPickedListener,
- OnStorageLocationUpdatedListener {
+@EFragment(R.layout.fragment_details)
+public class DetailsFragment extends Fragment implements OnTrackersUpdatedListener, OnLabelPickedListener, OnStorageLocationUpdatedListener {
// Local data
@InstanceState
@@ -90,9 +98,15 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
private ServerSetting currentServerSettings = null;
// Views
- @ViewById(resName = "details_container")
+ @ViewById
protected View detailsContainer;
- @ViewById(resName = "details_list")
+ @ViewById(R.id.details_menu)
+ protected ActionMenuView detailsMenu;
+ @ViewById(R.id.contextual_menu)
+ protected ActionMenuView contextualMenu;
+ @ViewById
+ protected SwipeRefreshLayout swipeRefreshLayout;
+ @ViewById
protected ListView detailsList;
@ViewById
protected TextView emptyText, errorText;
@@ -102,6 +116,9 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
@AfterViews
protected void init() {
+ // Inject menu options in the actions toolbar
+ setHasOptionsMenu(true);
+
// On large screens where this fragment is shown next to the torrents list, we show a continues grey vertical
// line to separate the lists visually
if (!NavigationHelper_.getInstance_(getActivity()).isSmallScreen()) {
@@ -112,22 +129,33 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
}
}
+ createMenuOptions();
+
// Set up details adapter (itself containing the actual lists to show), which allows multi-select and fast
// scrolling
detailsList.setAdapter(new DetailsAdapter(getActivity()));
detailsList.setMultiChoiceModeListener(onDetailsSelected);
detailsList.setFastScrollEnabled(true);
if (getActivity() != null && getActivity() instanceof RefreshableActivity) {
- ((RefreshableActivity) getActivity()).addRefreshableView(detailsList);
+ swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
+ @Override
+ public void onRefresh() {
+ ((RefreshableActivity) getActivity()).refreshScreen();
+ swipeRefreshLayout.setRefreshing(false); // Use our custom indicator
+ }
+ });
}
// Restore the fragment state (on orientation changes et al.)
- if (torrent != null)
+ if (torrent != null) {
updateTorrent(torrent);
- if (torrentDetails != null)
+ }
+ if (torrentDetails != null) {
updateTorrentDetails(torrent, torrentDetails);
- if (torrentFiles != null)
+ }
+ if (torrentFiles != null) {
updateTorrentFiles(torrent, torrentFiles);
+ }
}
@@ -150,7 +178,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
errorText.setVisibility(View.GONE);
loadingProgress.setVisibility(View.GONE);
// Also update the available actions in the action bar
- getActivity().invalidateOptionsMenu();
+ updateMenuOptions();
// Refresh the detailed statistics (errors) and list of files
torrentDetails = null;
torrentFiles = null;
@@ -165,13 +193,14 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
*/
public void updateTorrentDetails(Torrent checkTorrent, TorrentDetails newTorrentDetails) {
// Check if these are actually the details of the torrent we are now showing
- if (torrentId == null || !torrentId.equals(checkTorrent.getUniqueID()))
+ if (torrentId == null || !torrentId.equals(checkTorrent.getUniqueID())) {
return;
+ }
this.torrentDetails = newTorrentDetails;
- ((DetailsAdapter) detailsList.getAdapter()).updateTrackers(
- SimpleListItemAdapter.SimpleStringItem.wrapStringsList(newTorrentDetails.getTrackers()));
- ((DetailsAdapter) detailsList.getAdapter()).updateErrors(
- SimpleListItemAdapter.SimpleStringItem.wrapStringsList(newTorrentDetails.getErrors()));
+ ((DetailsAdapter) detailsList.getAdapter())
+ .updateTrackers(SimpleListItemAdapter.SimpleStringItem.wrapStringsList(newTorrentDetails.getTrackers()));
+ ((DetailsAdapter) detailsList.getAdapter())
+ .updateErrors(SimpleListItemAdapter.SimpleStringItem.wrapStringsList(newTorrentDetails.getErrors()));
}
/**
@@ -181,22 +210,23 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
*/
public void updateTorrentFiles(Torrent checkTorrent, ArrayList newTorrentFiles) {
// Check if these are actually the details of the torrent we are now showing
- if (torrentId == null || !torrentId.equals(checkTorrent.getUniqueID()))
+ if (torrentId == null || !torrentId.equals(checkTorrent.getUniqueID())) {
return;
+ }
Collections.sort(newTorrentFiles);
this.torrentFiles = newTorrentFiles;
((DetailsAdapter) detailsList.getAdapter()).updateTorrentFiles(newTorrentFiles);
}
/**
- * Can be called if some outside activity returned new torrents, so we can perhaps piggyback on this by update our
- * data as well.
+ * Can be called if some outside activity returned new torrents, so we can perhaps piggyback on this by update our data as well.
* @param torrents The last of retrieved torrents
*/
public void perhapsUpdateTorrent(List torrents) {
// Only try to update if we actually were showing a torrent
- if (this.torrentId == null || torrents == null)
+ if (this.torrentId == null || torrents == null) {
return;
+ }
for (Torrent newTorrent : torrents) {
if (newTorrent.getUniqueID().equals(torrentId)) {
// Found, so we can update our data as well
@@ -207,12 +237,12 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
}
/**
- * Updates the locally maintained list of labels that are active on the server. Used in the label picking dialog and
- * should be updated every time after the list of torrents was retrieved to keep it updated.
+ * Updates the locally maintained list of labels that are active on the server. Used in the label picking dialog and should be updated every time
+ * after the list of torrents was retrieved to keep it updated.
* @param currentLabels The list of known server labels
*/
public void updateLabels(ArrayList currentLabels) {
- this.currentLabels = currentLabels == null ? null : new ArrayList(currentLabels);
+ this.currentLabels = currentLabels == null ? null : new ArrayList<>(currentLabels);
}
/**
@@ -238,8 +268,9 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
this.isLoadingTorrent = isLoading;
this.hasCriticalError = connectionErrorMessage != null;
errorText.setText(connectionErrorMessage);
- if (isLoading || hasCriticalError)
+ if (isLoading || hasCriticalError) {
clear();
+ }
}
@ItemClick(resName = "details_list")
@@ -247,132 +278,179 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
detailsList.setItemChecked(position, false);
}
- @Override
- public void onPrepareOptionsMenu(Menu menu) {
- super.onPrepareOptionsMenu(menu);
+ public void createMenuOptions() {
+ getActivity().getMenuInflater().inflate(R.menu.fragment_details, detailsMenu.getMenu());
+ detailsMenu.setOnMenuItemClickListener(new ActionMenuView.OnMenuItemClickListener() {
+ @Override
+ public boolean onMenuItemClick(MenuItem menuItem) {
+ switch (menuItem.getItemId()) {
+ case R.id.action_pause:
+ pauseTorrent();
+ return true;
+ case R.id.action_updatetrackers:
+ updateTrackers();
+ return true;
+ case R.id.action_start_forced:
+ startTorrentForced();
+ return true;
+ case R.id.action_remove_withdata:
+ removeTorrentWithData();
+ return true;
+ case R.id.action_stop:
+ stopTorrent();
+ return true;
+ case R.id.action_forcerecheck:
+ setForceRecheck();
+ return true;
+ case R.id.action_changelocation:
+ changeStorageLocation();
+ return true;
+ case R.id.action_start_default:
+ startTorrentDefault();
+ return true;
+ case R.id.action_remove_default:
+ removeTorrentDefault();
+ return true;
+ case R.id.action_start_direct:
+ startTorrentDirect();
+ return true;
+ case R.id.action_setlabel:
+ setLabel();
+ return true;
+ case R.id.action_resume:
+ resumeTorrent();
+ return true;
+ }
+ return false;
+ }
+ });
+ }
+
+ private void updateMenuOptions() {
if (torrent == null) {
- menu.findItem(R.id.action_resume).setVisible(false);
- menu.findItem(R.id.action_pause).setVisible(false);
- menu.findItem(R.id.action_start).setVisible(false);
- menu.findItem(R.id.action_start_direct).setVisible(false);
- menu.findItem(R.id.action_stop).setVisible(false);
- menu.findItem(R.id.action_remove).setVisible(false);
- menu.findItem(R.id.action_remove_withdata).setVisible(false);
- menu.findItem(R.id.action_setlabel).setVisible(false);
- menu.findItem(R.id.action_forcerecheck).setVisible(false);
- menu.findItem(R.id.action_updatetrackers).setVisible(false);
- menu.findItem(R.id.action_changelocation).setVisible(false);
+ detailsMenu.getMenu().findItem(R.id.action_resume).setVisible(false);
+ detailsMenu.getMenu().findItem(R.id.action_pause).setVisible(false);
+ detailsMenu.getMenu().findItem(R.id.action_start).setVisible(false);
+ detailsMenu.getMenu().findItem(R.id.action_start_direct).setVisible(false);
+ detailsMenu.getMenu().findItem(R.id.action_stop).setVisible(false);
+ detailsMenu.getMenu().findItem(R.id.action_remove).setVisible(false);
+ detailsMenu.getMenu().findItem(R.id.action_remove_withdata).setVisible(false);
+ detailsMenu.getMenu().findItem(R.id.action_setlabel).setVisible(false);
+ detailsMenu.getMenu().findItem(R.id.action_forcerecheck).setVisible(false);
+ detailsMenu.getMenu().findItem(R.id.action_updatetrackers).setVisible(false);
+ detailsMenu.getMenu().findItem(R.id.action_changelocation).setVisible(false);
return;
}
// Update action availability
boolean startStop = Daemon.supportsStoppingStarting(torrent.getDaemon());
- menu.findItem(R.id.action_resume).setVisible(torrent.canResume());
- menu.findItem(R.id.action_pause).setVisible(torrent.canPause());
+ detailsMenu.getMenu().findItem(R.id.action_resume).setVisible(torrent.canResume());
+ detailsMenu.getMenu().findItem(R.id.action_pause).setVisible(torrent.canPause());
boolean forcedStart = Daemon.supportsForcedStarting(torrent.getDaemon());
- menu.findItem(R.id.action_start).setVisible(startStop && forcedStart && torrent.canStart());
- menu.findItem(R.id.action_start_direct).setVisible(startStop && !forcedStart && torrent.canStart());
- menu.findItem(R.id.action_stop).setVisible(startStop && torrent.canStop());
- menu.findItem(R.id.action_remove).setVisible(true);
+ detailsMenu.getMenu().findItem(R.id.action_start).setVisible(startStop && forcedStart && torrent.canStart());
+ detailsMenu.getMenu().findItem(R.id.action_start_direct).setVisible(startStop && !forcedStart && torrent.canStart());
+ detailsMenu.getMenu().findItem(R.id.action_stop).setVisible(startStop && torrent.canStop());
+ detailsMenu.getMenu().findItem(R.id.action_remove).setVisible(true);
boolean removeWithData = Daemon.supportsRemoveWithData(torrent.getDaemon());
- menu.findItem(R.id.action_remove_withdata).setVisible(removeWithData);
+ detailsMenu.getMenu().findItem(R.id.action_remove_withdata).setVisible(removeWithData);
boolean setLabel = Daemon.supportsSetLabel(torrent.getDaemon());
- menu.findItem(R.id.action_setlabel).setVisible(setLabel);
+ detailsMenu.getMenu().findItem(R.id.action_setlabel).setVisible(setLabel);
boolean forceRecheck = Daemon.supportsForceRecheck(torrent.getDaemon());
- menu.findItem(R.id.action_forcerecheck).setVisible(forceRecheck);
+ detailsMenu.getMenu().findItem(R.id.action_forcerecheck).setVisible(forceRecheck);
boolean setTrackers = Daemon.supportsSetTrackers(torrent.getDaemon());
- menu.findItem(R.id.action_updatetrackers).setVisible(setTrackers);
+ detailsMenu.getMenu().findItem(R.id.action_updatetrackers).setVisible(setTrackers);
boolean setLocation = Daemon.supportsSetDownloadLocation(torrent.getDaemon());
- menu.findItem(R.id.action_changelocation).setVisible(setLocation);
+ detailsMenu.getMenu().findItem(R.id.action_changelocation).setVisible(setLocation);
}
- @OptionsItem(resName = "action_resume")
+ @OptionsItem(R.id.action_resume)
protected void resumeTorrent() {
getTasksExecutor().resumeTorrent(torrent);
}
- @OptionsItem(resName = "action_pause")
+ @OptionsItem(R.id.action_pause)
protected void pauseTorrent() {
getTasksExecutor().pauseTorrent(torrent);
}
- @OptionsItem(resName = "action_start_direct")
+ @OptionsItem(R.id.action_start_direct)
protected void startTorrentDirect() {
getTasksExecutor().startTorrent(torrent, false);
}
- @OptionsItem(resName = "action_start_default")
+ @OptionsItem(R.id.action_start_default)
protected void startTorrentDefault() {
getTasksExecutor().startTorrent(torrent, false);
}
- @OptionsItem(resName = "action_start_forced")
+ @OptionsItem(R.id.action_start_forced)
protected void startTorrentForced() {
getTasksExecutor().startTorrent(torrent, true);
}
- @OptionsItem(resName = "action_stop")
+ @OptionsItem(R.id.action_stop)
protected void stopTorrent() {
getTasksExecutor().stopTorrent(torrent);
}
- @OptionsItem(resName = "action_remove_default")
+ @OptionsItem(R.id.action_remove_default)
protected void removeTorrentDefault() {
getTasksExecutor().removeTorrent(torrent, false);
}
- @OptionsItem(resName = "action_remove_withdata")
+ @OptionsItem(R.id.action_remove_withdata)
protected void removeTorrentWithData() {
getTasksExecutor().removeTorrent(torrent, true);
}
- @OptionsItem(resName = "action_setlabel")
+ @OptionsItem(R.id.action_setlabel)
protected void setLabel() {
- if (currentLabels != null)
- new SetLabelDialog().setOnLabelPickedListener(this).setCurrentLabels(currentLabels)
- .show(getFragmentManager(), "SetLabelDialog");
+ if (currentLabels != null) {
+ SetLabelDialog.show(getActivity(), this, currentLabels);
+ }
}
- @OptionsItem(resName = "action_forcerecheck")
+ @OptionsItem(R.id.action_forcerecheck)
protected void setForceRecheck() {
getTasksExecutor().forceRecheckTorrent(torrent);
}
- @OptionsItem(resName = "action_updatetrackers")
+ @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())
- .show(getFragmentManager(), "SetTrackersDialog");
+ SetTrackersDialog.show(getActivity(), this, torrentDetails.getTrackersText());
}
- @OptionsItem(resName = "action_changelocation")
+ @OptionsItem(R.id.action_changelocation)
protected void changeStorageLocation() {
- new SetStorageLocationDialog().setOnStorageLocationUpdated(this).setCurrentLocation(torrent.getLocationDir())
- .show(getFragmentManager(), "SetStorageLocationDialog");
+ SetStorageLocationDialog.show(getActivity(), this, torrent.getLocationDir());
}
@Override
public void onLabelPicked(String newLabel) {
- if (torrent == null)
+ if (torrent == null) {
return;
+ }
getTasksExecutor().updateLabel(torrent, newLabel);
}
@Override
public void onTrackersUpdated(List updatedTrackers) {
- if (torrent == null)
+ if (torrent == null) {
return;
+ }
getTasksExecutor().updateTrackers(torrent, updatedTrackers);
}
@Override
public void onStorageLocationUpdated(String newLocation) {
- if (torrent == null)
+ if (torrent == null) {
return;
+ }
getTasksExecutor().updateLocation(torrent, newLocation);
}
@@ -397,10 +475,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;
@@ -408,21 +498,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);
- 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);
+ boolean filePaths = currentServerSettings != null && Daemon.supportsFilePaths(currentServerSettings.getType());
+ contextualMenu.getMenu().findItem(R.id.action_download).setVisible(filePaths);
+ boolean filePriorities = currentServerSettings != null && Daemon.supportsFilePrioritySetting(currentServerSettings.getType());
+ 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")
@@ -430,35 +519,36 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
// Get checked torrents
- List checked = new ArrayList();
+ List checked = new ArrayList<>();
for (int i = 0; i < detailsList.getCheckedItemPositions().size(); i++) {
- if (detailsList.getCheckedItemPositions().valueAt(i)
- && i < detailsList.getAdapter().getCount()
- && detailsList.getAdapter().getItem(detailsList.getCheckedItemPositions().keyAt(i)) instanceof TorrentFile)
- checked.add((TorrentFile) detailsList.getAdapter().getItem(
- detailsList.getCheckedItemPositions().keyAt(i)));
+ if (detailsList.getCheckedItemPositions().valueAt(i) && i < detailsList.getAdapter().getCount() &&
+ detailsList.getAdapter().getItem(detailsList.getCheckedItemPositions().keyAt(i)) instanceof TorrentFile) {
+ checked.add((TorrentFile) detailsList.getAdapter().getItem(detailsList.getCheckedItemPositions().keyAt(i)));
+ }
}
int itemId = item.getItemId();
if (itemId == R.id.action_download) {
- if (checked.size() < 1 || currentServerSettings == null)
+ if (checked.size() < 1 || currentServerSettings == null) {
return true;
+ }
String urlBase = currentServerSettings.getFtpUrl();
- if (urlBase == null || urlBase.equals(""))
+ if (urlBase == null || urlBase.equals("")) {
urlBase = "ftp://" + currentServerSettings.getAddress();
+ }
// Try using AndFTP intents
Intent andftpStart = new Intent(Intent.ACTION_PICK);
andftpStart.setDataAndType(Uri.parse(urlBase), "vnd.android.cursor.dir/lysesoft.andftp.uri");
andftpStart.putExtra("command_type", "download");
andftpStart.putExtra("ftp_pasv", "true");
- if (Uri.parse(urlBase).getUserInfo() != null)
+ if (Uri.parse(urlBase).getUserInfo() != null) {
andftpStart.putExtra("ftp_username", Uri.parse(urlBase).getUserInfo());
- else
+ } else {
andftpStart.putExtra("ftp_username", currentServerSettings.getUsername());
- if (currentServerSettings.getFtpPassword() != null
- && !currentServerSettings.getFtpPassword().equals("")) {
+ }
+ if (currentServerSettings.getFtpPassword() != null && !currentServerSettings.getFtpPassword().equals("")) {
andftpStart.putExtra("ftp_password", currentServerSettings.getFtpPassword());
} else {
andftpStart.putExtra("ftp_password", currentServerSettings.getPassword());
@@ -472,8 +562,9 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
// If the file is directly in the root, AndFTP fails if we supply the proper path (like
// /file.pdf)
// Work around this bug by removing the leading / if no further directories are used in the path
- if (file.startsWith("/") && file.indexOf("/", 1) < 0)
+ if (file.startsWith("/") && file.indexOf("/", 1) < 0) {
file = file.substring(1);
+ }
andftpStart.putExtra("remote_file" + (f + 1), file);
}
}
@@ -485,8 +576,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
// Try using a VIEW intent given an ftp:// scheme URI
String url = urlBase + checked.get(0).getFullPath();
- Intent simpleStart = new Intent(Intent.ACTION_VIEW, Uri.parse(url))
- .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ Intent simpleStart = new Intent(Intent.ACTION_VIEW, Uri.parse(url)).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (simpleStart.resolveActivity(getActivity().getPackageManager()) != null) {
startActivity(simpleStart);
mode.finish();
@@ -494,8 +584,8 @@ 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(getString(R.string.error_noftpapp, url)).type(SnackbarType.MULTI_LINE)
+ .colorResource(R.color.red));
mode.finish();
return true;
@@ -503,24 +593,27 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
StringBuilder names = new StringBuilder();
for (int f = 0; f < checked.size(); f++) {
- if (f != 0)
+ if (f != 0) {
names.append("\n");
+ }
names.append(checked.get(f).getName());
}
- ClipboardManager clipboardManager = (ClipboardManager) getActivity().getSystemService(
- Context.CLIPBOARD_SERVICE);
+ ClipboardManager clipboardManager = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
clipboardManager.setPrimaryClip(ClipData.newPlainText("Transdroid", names.toString()));
mode.finish();
return true;
} else {
Priority priority = Priority.Off;
- if (itemId == R.id.action_priority_low)
+ if (itemId == R.id.action_priority_low) {
priority = Priority.Low;
- if (itemId == R.id.action_priority_normal)
+ }
+ if (itemId == R.id.action_priority_normal) {
priority = Priority.Normal;
- if (itemId == R.id.action_priority_high)
+ }
+ if (itemId == R.id.action_priority_high) {
priority = Priority.High;
+ }
getTasksExecutor().updatePriority(torrent, checked, priority);
mode.finish();
return true;
@@ -540,6 +633,8 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
((TorrentsActivity) getActivity()).startAutoRefresh();
}
selectionManagerMode.onDestroyActionMode(mode);
+ contextualMenu.setVisibility(View.GONE);
+ detailsMenu.setEnabled(true);
}
};
diff --git a/app/src/main/java/org/transdroid/core/gui/ServerSelectionView.java b/app/src/main/java/org/transdroid/core/gui/ServerSelectionView.java
new file mode 100644
index 00000000..73ee8359
--- /dev/null
+++ b/app/src/main/java/org/transdroid/core/gui/ServerSelectionView.java
@@ -0,0 +1,59 @@
+/*
+ * 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 .
+ */
+package org.transdroid.core.gui;
+
+import android.content.Context;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import org.androidannotations.annotations.EViewGroup;
+import org.androidannotations.annotations.ViewById;
+import org.transdroid.R;
+import org.transdroid.core.gui.navigation.NavigationFilter;
+import org.transdroid.daemon.IDaemonAdapter;
+
+@EViewGroup(R.layout.actionbar_serverselection)
+public class ServerSelectionView extends RelativeLayout {
+
+ @ViewById
+ protected TextView filterText, serverText;
+
+ public ServerSelectionView(Context context) {
+ super(context);
+ }
+
+ public ServerSelectionView(TorrentsActivity activity) {
+ super(activity.torrentsToolbar.getContext());
+ }
+
+ /**
+ * Updates the name of the current connected server.
+ * @param currentServer The server currently connected to
+ */
+ public void updateCurrentServer(IDaemonAdapter currentServer) {
+ serverText.setText(currentServer.getSettings().getName());
+ }
+
+ /**
+ * Updates the name of the selected filter.
+ * @param currentFilter The filter that is currently selected
+ */
+ public void updateCurrentFilter(NavigationFilter currentFilter) {
+ filterText.setText(currentFilter.getName());
+ }
+
+}
diff --git a/app/src/main/java/org/transdroid/core/gui/ServerStatusView.java b/app/src/main/java/org/transdroid/core/gui/ServerStatusView.java
index 41ff0ee0..cad06b90 100644
--- a/app/src/main/java/org/transdroid/core/gui/ServerStatusView.java
+++ b/app/src/main/java/org/transdroid/core/gui/ServerStatusView.java
@@ -16,24 +16,25 @@
*/
package org.transdroid.core.gui;
-import java.util.List;
+import android.content.Context;
+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;
-import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.gui.navigation.SetTransferRatesDialog;
import org.transdroid.core.gui.navigation.SetTransferRatesDialog.OnRatesPickedListener;
import org.transdroid.daemon.Torrent;
import org.transdroid.daemon.util.FileSizeConverter;
-import android.content.Context;
-import android.view.View;
-import android.widget.RelativeLayout;
-import android.widget.TextView;
-import de.keyboardsurfer.android.widget.crouton.Crouton;
+import java.util.List;
-@EViewGroup(resName = "actionbar_serverstatus")
+@EViewGroup(R.layout.actionbar_serverstatus)
public class ServerStatusView extends RelativeLayout implements OnRatesPickedListener {
@ViewById
@@ -57,7 +58,7 @@ public class ServerStatusView extends RelativeLayout implements OnRatesPickedLis
* @param dormantAsInactive Whether to treat dormant (0KB/s) torrent as inactive state torrents
* @param supportsSetTransferRates Whether the connected torrent client supports setting of max transfer speeds
*/
- public void update(List torrents, boolean dormantAsInactive, boolean supportsSetTransferRates) {
+ public void updateStatus(List torrents, boolean dormantAsInactive, boolean supportsSetTransferRates) {
if (torrents == null) {
downcountText.setText(null);
@@ -91,14 +92,16 @@ public class ServerStatusView extends RelativeLayout implements OnRatesPickedLis
upspeedText.setText(FileSizeConverter.getSize(upspeed) + "/s");
downcountSign.setVisibility(View.VISIBLE);
upcountSign.setVisibility(View.VISIBLE);
- speedswrapperLayout.setOnClickListener(supportsSetTransferRates ? onStartDownPickerClicked : null);
+ if (supportsSetTransferRates)
+ speedswrapperLayout.setOnClickListener(onStartDownPickerClicked);
+ else
+ speedswrapperLayout.setBackgroundDrawable(null);
}
private OnClickListener onStartDownPickerClicked = new OnClickListener() {
public void onClick(View v) {
- new SetTransferRatesDialog().setOnRatesPickedListener(ServerStatusView.this).show(
- activity.getFragmentManager(), "SetTransferRatesDialog");
+ SetTransferRatesDialog.show(getContext(), ServerStatusView.this);
}
};
@@ -114,7 +117,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.red));
}
}
diff --git a/app/src/main/java/org/transdroid/core/gui/TorrentTasksExecutor.java b/app/src/main/java/org/transdroid/core/gui/TorrentTasksExecutor.java
index 4d5f3b9f..cc70e3a3 100644
--- a/app/src/main/java/org/transdroid/core/gui/TorrentTasksExecutor.java
+++ b/app/src/main/java/org/transdroid/core/gui/TorrentTasksExecutor.java
@@ -16,28 +16,41 @@
*/
package org.transdroid.core.gui;
-import java.util.List;
+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;
+import java.util.List;
+
/**
- * Interface to be implemented by any activity that wants containing fragments to be able to load data and execute
- * commands against a torrent server.
+ * Interface to be implemented by any activity that wants containing fragments to be able to load data and execute commands against a torrent server.
* @author Eric Kok
*/
public interface TorrentTasksExecutor {
void resumeTorrent(Torrent torrent);
+
void pauseTorrent(Torrent torrent);
+
void startTorrent(Torrent torrent, boolean forced);
+
void stopTorrent(Torrent torrent);
+
void removeTorrent(Torrent torrent, boolean withData);
+
void forceRecheckTorrent(Torrent torrent);
+
void updateLabel(Torrent torrent, String newLabel);
+
void updateTrackers(Torrent torrent, List newTrackers);
+
void updateLocation(Torrent torrent, String newLocation);
+
void refreshTorrentDetails(Torrent torrent);
+
void refreshTorrentFiles(Torrent torrent);
+
void updatePriority(Torrent torrent, List files, Priority priority);
}
diff --git a/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java b/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
index 177ab15b..65c257e6 100644
--- a/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
+++ b/app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
@@ -16,27 +16,46 @@
*/
package org.transdroid.core.gui;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
+import android.annotation.TargetApi;
+import android.app.SearchManager;
+import android.content.ContentResolver;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.os.Build;
+import android.os.Bundle;
+import android.support.v4.view.MenuItemCompat;
+import android.support.v4.widget.DrawerLayout;
+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;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+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 com.nispok.snackbar.enums.SnackbarType;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Background;
import org.androidannotations.annotations.Bean;
+import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.FragmentById;
import org.androidannotations.annotations.InstanceState;
import org.androidannotations.annotations.OnActivityResult;
import org.androidannotations.annotations.OptionsItem;
-import org.androidannotations.annotations.OptionsMenu;
import org.androidannotations.annotations.SystemService;
import org.androidannotations.annotations.UiThread;
import org.androidannotations.annotations.ViewById;
@@ -46,18 +65,28 @@ import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.cookie.BasicClientCookie;
import org.transdroid.R;
-import org.transdroid.core.app.search.*;
-import org.transdroid.core.app.settings.*;
+import org.transdroid.core.app.search.SearchHelper_;
+import org.transdroid.core.app.settings.ApplicationSettings;
+import org.transdroid.core.app.settings.ServerSetting;
+import org.transdroid.core.app.settings.SystemSettings;
+import org.transdroid.core.app.settings.SystemSettings_;
+import org.transdroid.core.app.settings.WebsearchSetting;
import org.transdroid.core.gui.lists.LocalTorrent;
-import org.transdroid.core.gui.lists.NoProgressHeaderTransformer;
import org.transdroid.core.gui.lists.SimpleListItem;
-import org.transdroid.core.gui.log.*;
-import org.transdroid.core.gui.navigation.*;
-import org.transdroid.core.gui.rss.*;
+import org.transdroid.core.gui.log.Log;
+import org.transdroid.core.gui.log.LogUncaughtExceptionHandler;
+import org.transdroid.core.gui.navigation.FilterListAdapter;
+import org.transdroid.core.gui.navigation.FilterListAdapter_;
+import org.transdroid.core.gui.navigation.Label;
+import org.transdroid.core.gui.navigation.NavigationFilter;
+import org.transdroid.core.gui.navigation.NavigationHelper;
+import org.transdroid.core.gui.navigation.RefreshableActivity;
+import org.transdroid.core.gui.navigation.StatusType;
+import org.transdroid.core.gui.rss.RssfeedsActivity_;
import org.transdroid.core.gui.search.BarcodeHelper;
import org.transdroid.core.gui.search.FilePickerHelper;
import org.transdroid.core.gui.search.UrlEntryDialog;
-import org.transdroid.core.gui.settings.*;
+import org.transdroid.core.gui.settings.MainSettingsActivity_;
import org.transdroid.core.service.BootReceiver;
import org.transdroid.core.service.ConnectivityHelper;
import org.transdroid.core.widget.ListWidgetProvider;
@@ -97,48 +126,35 @@ import org.transdroid.daemon.task.StartTask;
import org.transdroid.daemon.task.StopTask;
import org.transdroid.daemon.util.HttpHelper;
-import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher;
-import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.OnRefreshListener;
-import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.Options;
-import android.annotation.TargetApi;
-import android.app.ActionBar;
-import android.app.ActionBar.OnNavigationListener;
-import android.app.Activity;
-import android.app.SearchManager;
-import android.content.ContentResolver;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.AsyncTask;
-import android.os.Build;
-import android.os.Bundle;
-import android.text.TextUtils;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.MenuItem.OnActionExpandListener;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.widget.AdapterView;
-import android.widget.AdapterView.OnItemClickListener;
-import android.widget.ListView;
-import android.widget.SearchView;
-import de.keyboardsurfer.android.widget.crouton.Crouton;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
/**
- * 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 activity, using background methods. Finally, the activity
- * offers navigation elements such as access to settings and showing connection issues.
+ * 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
+ * activity, using background methods. Finally, the activity offers navigation elements such as access to settings and showing connection issues.
* @author Eric Kok
*/
-@EActivity(resName = "activity_torrents")
-@OptionsMenu(resName = "activity_torrents")
-public class TorrentsActivity extends Activity implements OnNavigationListener, TorrentTasksExecutor,
- RefreshableActivity {
+@EActivity(R.layout.activity_torrents)
+public class TorrentsActivity extends ActionBarActivity implements TorrentTasksExecutor, RefreshableActivity {
private static final int RESULT_DETAILS = 0;
+
// Fragment uses this to pause the refresh across restarts
public boolean stopRefresh = false;
+
// Navigation components
+ @SystemService
+ protected SearchManager searchManager;
@Bean
protected Log log;
@Bean
@@ -146,12 +162,33 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
@Bean
protected ConnectivityHelper connectivityHelper;
@ViewById
+ protected Toolbar selectionToolbar;
+ @ViewById
+ protected Toolbar torrentsToolbar;
+ @ViewById
+ protected Toolbar actionsToolbar;
+ @ViewById(R.id.contextual_menu)
+ protected ActionMenuView contextualMenu;
+ @ViewById
+ protected FloatingActionsMenu addmenuButton;
+ @ViewById
+ protected FloatingActionButton addmenuFileButton;
+ @ViewById
+ protected DrawerLayout drawerLayout;
+ @ViewById(R.id.drawer_container)
+ protected ViewGroup drawerContainer;
+ @ViewById
+ protected ListView drawerList;
+ @ViewById
protected ListView filtersList;
- protected FilterListAdapter navigationListAdapter = null;
- protected FilterListDropDownAdapter navigationSpinnerAdapter = null;
- protected ServerStatusView serverStatusView;
- @SystemService
- protected SearchManager searchManager;
+ @ViewById
+ protected SearchView filterSearch;
+ private ListView navigationList;
+ private FilterListAdapter navigationListAdapter;
+ private ServerSelectionView serverSelectionView;
+ private ServerStatusView serverStatusView;
+ private ActionBarDrawerToggle drawerToggle;
+
// Settings
@Bean
protected ApplicationSettings applicationSettings;
@@ -162,85 +199,80 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
@InstanceState
protected String preselectNavigationFilter = null;
@InstanceState
- protected boolean turleModeEnabled = false;
+ protected boolean turtleModeEnabled = false;
@InstanceState
protected ArrayList lastNavigationLabels;
// Contained torrent and details fragments
- @FragmentById(resName = "torrents_fragment")
+ @FragmentById(R.id.torrents_fragment)
protected TorrentsFragment fragmentTorrents;
- @FragmentById(resName = "torrentdetails_fragment")
+ @FragmentById(R.id.torrentdetails_fragment)
protected DetailsFragment fragmentDetails;
@InstanceState
boolean firstStart = true;
- int skipNextOnNavigationItemSelectedCalls = 2;
private MenuItem searchMenu = null;
- private PullToRefreshAttacher pullToRefreshAttacher = null;
private IDaemonAdapter currentConnection = null;
+
// Auto refresh task
private AsyncTask autoRefreshTask;
- // Handles item selections on the dedicated list of filter items
- private OnItemClickListener onFilterListItemClicked = new OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView> parent, View view, int position, long id) {
- filtersList.setItemChecked(position, true);
- Object item = filtersList.getAdapter().getItem(position);
- if (item instanceof SimpleListItem)
- filterSelected((SimpleListItem) item, false);
- }
- };
@Override
public void onCreate(Bundle savedInstanceState) {
// Set the theme according to the user preference
if (SystemSettings_.getInstance_(this).useDarkTheme()) {
setTheme(R.style.TransdroidTheme_Dark);
- getActionBar().setIcon(R.drawable.ic_activity_torrents);
}
// Catch any uncaught exception to log it
- Thread.setDefaultUncaughtExceptionHandler(new LogUncaughtExceptionHandler(this,
- Thread.getDefaultUncaughtExceptionHandler()));
+ Thread.setDefaultUncaughtExceptionHandler(new LogUncaughtExceptionHandler(this, Thread.getDefaultUncaughtExceptionHandler()));
super.onCreate(savedInstanceState);
}
@AfterViews
protected void init() {
- // Set up navigation, with an action bar spinner, server status indicator and possibly (if room) with a filter
- // list
+ // Use custom views as action bar content, showing filter selection and current torrent counts/speeds
+ serverSelectionView = ServerSelectionView_.build(this);
serverStatusView = ServerStatusView_.build(this);
- ActionBar actionBar = getActionBar();
- actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
- actionBar.setHomeButtonEnabled(false);
- actionBar.setDisplayShowTitleEnabled(false);
- actionBar.setDisplayShowCustomEnabled(true);
- actionBar.setCustomView(serverStatusView);
- navigationSpinnerAdapter = FilterListDropDownAdapter_.getInstance_(this);
- // Servers are always added to the action bar spinner
- navigationSpinnerAdapter.updateServers(applicationSettings.getAllServerSettings());
-
- // Check if there was room for a dedicated filter list (i.e. on tablets)
+ if (selectionToolbar != null) {
+ selectionToolbar.addView(serverSelectionView);
+ } else {
+ torrentsToolbar.addView(serverSelectionView);
+ }
+ actionsToolbar.addView(serverStatusView);
+ actionsToolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
+ @Override
+ public boolean onMenuItemClick(MenuItem menuItem) {
+ // Redirect to the classic activity implementation so we can use @OptionsItem methods
+ return onOptionsItemSelected(menuItem);
+ }
+ });
+ setSupportActionBar(torrentsToolbar); // For direct menu item inflation by the contained fragments
+ getSupportActionBar().setDisplayShowTitleEnabled(false);
+
+ // Construct the filters list, i.e. the list of servers, status types and labels
+ navigationListAdapter = FilterListAdapter_.getInstance_(this);
+ navigationListAdapter.updateServers(applicationSettings.getAllServerSettings());
+ navigationListAdapter.updateStatusTypes(StatusType.getAllStatusTypes(this));
+ // Add an empty labels list (which will be updated later, but the adapter needs to be created now)
+ navigationListAdapter.updateLabels(new ArrayList());
+
+ // Apply the filters list to the navigation drawer (on phones) or the dedicated side bar (i.e. on tablets)
if (filtersList != null) {
- // The action bar spinner doesn't have to show the 'servers' label, as it will only contain servers
- navigationSpinnerAdapter.hideServersLabel();
- // Create dedicated side list adapter and add the status types
- navigationListAdapter = FilterListAdapter_.getInstance_(this);
- navigationListAdapter.updateStatusTypes(StatusType.getAllStatusTypes(this));
- // Add an empty labels list (which will be updated later, but the adapter needs to be created now)
- navigationListAdapter.updateLabels(new ArrayList());
- filtersList.setAdapter(navigationListAdapter);
- filtersList.setOnItemClickListener(onFilterListItemClicked);
+ navigationList = filtersList;
} else {
- // Add status types directly to the action bar spinner
- navigationSpinnerAdapter.updateStatusTypes(StatusType.getAllStatusTypes(this));
- // Add an empty labels list (which will be updated later, but the adapter needs to be created now)
- navigationSpinnerAdapter.updateLabels(new ArrayList());
+ navigationList = drawerList;
+ drawerToggle =
+ new ActionBarDrawerToggle(this, drawerLayout, torrentsToolbar, R.string.navigation_opendrawer, R.string.navigation_closedrawer);
+ drawerToggle.setDrawerIndicatorEnabled(true);
+ drawerLayout.setDrawerListener(drawerToggle);
}
+ navigationList.setAdapter(navigationListAdapter);
+ navigationList.setOnItemClickListener(onFilterListItemClicked);
// Now that all items (or at least their adapters) have been added, ensure a filter is selected
- // NOTE When this is a fresh start, it might override the filter later (based on the last user selection)
+ // NOTE When this is a fresh start, we might override the filter later (based on the last user selection)
if (currentFilter == null) {
currentFilter = StatusType.getShowAllType(this);
}
- actionBar.setListNavigationCallbacks(navigationSpinnerAdapter, this);
+ filterSearch.setOnQueryTextListener(filterQueryTextChanged);
// Load the default server or a server that was explicitly supplied in the starting intent
ServerSetting defaultServer = applicationSettings.getDefaultServer();
@@ -249,24 +281,21 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
return;
}
Torrent openTorrent = null;
- if (getIntent().getAction() != null && getIntent().getAction().equals(ListWidgetProvider.INTENT_STARTSERVER)
- && getIntent().getExtras() == null && getIntent().hasExtra(ListWidgetProvider.EXTRA_SERVER)) {
+ if (getIntent().getAction() != null && getIntent().getAction().equals(ListWidgetProvider.INTENT_STARTSERVER) &&
+ getIntent().getExtras() == null && getIntent().hasExtra(ListWidgetProvider.EXTRA_SERVER)) {
// A server settings order ID was provided in this org.transdroid.START_SERVER action intent
int serverId = getIntent().getExtras().getInt(ListWidgetProvider.EXTRA_SERVER);
if (serverId < 0 || serverId > applicationSettings.getMaxOfAllServers()) {
- log.e(this, "Tried to start with " + ListWidgetProvider.EXTRA_SERVER + " intent but " + serverId
- + " is not an existing server order id");
+ log.e(this, "Tried to start with " + ListWidgetProvider.EXTRA_SERVER + " intent but " + serverId +
+ " is not an existing server order id");
} else {
defaultServer = applicationSettings.getServerSetting(serverId);
- if (getIntent().hasExtra(ListWidgetProvider.EXTRA_TORRENT))
+ if (getIntent().hasExtra(ListWidgetProvider.EXTRA_TORRENT)) {
openTorrent = getIntent().getParcelableExtra(ListWidgetProvider.EXTRA_TORRENT);
+ }
}
}
- // Set this as selection in the action bar spinner; we can use the server setting key since we have stable ids
- // Note: skipNextOnNavigationItemSelectedCalls is used to prevent this event from triggering filterSelected
- actionBar.setSelectedNavigationItem(defaultServer.getOrder() + 1);
-
// Connect to the last used server or a server that was explicitly supplied in the starting intent
if (firstStart) {
// Force first torrents refresh
@@ -283,8 +312,8 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
// Resume after instead of fully loading the torrents list; create connection and set action bar title
ServerSetting lastUsed = applicationSettings.getLastUsedServer();
currentConnection = lastUsed.createServerAdapter(connectivityHelper.getConnectedNetworkName(), this);
- navigationSpinnerAdapter.updateCurrentServer(currentConnection);
- navigationSpinnerAdapter.updateCurrentFilter(currentFilter);
+ serverSelectionView.updateCurrentServer(currentConnection);
+ serverSelectionView.updateCurrentFilter(currentFilter);
}
firstStart = false;
@@ -294,12 +323,21 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
}
+ @Override
+ protected void onPostCreate(Bundle savedInstanceState) {
+ super.onPostCreate(savedInstanceState);
+ // Sync the toggle state after onRestoreInstanceState has occurred
+ if (drawerToggle != null) {
+ drawerToggle.syncState();
+ }
+ }
+
@Override
protected void onResume() {
super.onResume();
// Refresh server settings
- navigationSpinnerAdapter.updateServers(applicationSettings.getAllServerSettings());
+ navigationListAdapter.updateServers(applicationSettings.getAllServerSettings());
ServerSetting lastUsed = applicationSettings.getLastUsedServer();
if (lastUsed == null) {
// Still no settings
@@ -308,10 +346,11 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
}
// If we had no connection before, establish it now; otherwise just reload the settings
- if (currentConnection == null)
+ if (currentConnection == null) {
filterSelected(lastUsed, true);
- else
+ } else {
currentConnection = lastUsed.createServerAdapter(connectivityHelper.getConnectedNetworkName(), this);
+ }
// Start auto refresh
startAutoRefresh();
@@ -331,8 +370,9 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void startAutoRefresh() {
// Check if already running
- if (autoRefreshTask != null || stopRefresh || systemSettings.getRefreshIntervalMilliseconds() == 0)
+ if (autoRefreshTask != null || stopRefresh || systemSettings.getRefreshIntervalMilliseconds() == 0) {
return;
+ }
autoRefreshTask = new AsyncTask() {
@Override
@@ -344,43 +384,41 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
// Ignore
}
// Just in case it was cancelled during sleep
- if (isCancelled())
+ if (isCancelled()) {
return null;
+ }
refreshTorrents();
- if (Daemon.supportsStats(currentConnection.getType()))
+ if (Daemon.supportsStats(currentConnection.getType())) {
getAdditionalStats();
+ }
}
return null;
}
};
- // Executes serially by default on Honeycomb, was parallel before
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
- autoRefreshTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
- else
- autoRefreshTask.execute();
+ autoRefreshTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
public void stopAutoRefresh() {
- if (autoRefreshTask != null)
+ if (autoRefreshTask != null) {
autoRefreshTask.cancel(true);
+ }
autoRefreshTask = null;
}
- @Override
- protected void onDestroy() {
- Crouton.cancelAllCroutons();
- super.onDestroy();
- }
-
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
+ // Manually insert the actions into the main torrent and secondary actions toolbars
+ torrentsToolbar.inflateMenu(R.menu.activity_torrents_main);
+ 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 searchView = new SearchView(torrentsToolbar.getContext());
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
searchView.setQueryRefinementEnabled(true);
searchView.setOnSearchClickListener(new OnClickListener() {
@@ -391,7 +429,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
stopAutoRefresh();
}
});
- item.setOnActionExpandListener(new OnActionExpandListener() {
+ MenuItemCompat.setOnActionExpandListener(item, new MenuItemCompat.OnActionExpandListener() {
@Override
public boolean onMenuItemActionExpand(MenuItem item) {
return true;
@@ -404,7 +442,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
return true;
}
});
- item.setActionView(searchView);
+ MenuItemCompat.setActionView(item, searchView);
searchMenu = item;
}
return true;
@@ -416,62 +454,70 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
// No connection yet; hide all menu options except settings
if (currentConnection == null) {
- menu.findItem(R.id.action_add).setVisible(false);
- menu.findItem(R.id.action_search).setVisible(false);
- menu.findItem(R.id.action_rss).setVisible(false);
- menu.findItem(R.id.action_enableturtle).setVisible(false);
- menu.findItem(R.id.action_disableturtle).setVisible(false);
- menu.findItem(R.id.action_refresh).setVisible(false);
- menu.findItem(R.id.action_sort).setVisible(false);
- menu.findItem(R.id.action_filter).setVisible(false);
- menu.findItem(R.id.action_settings).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
- menu.findItem(R.id.action_help).setVisible(true);
- if (fragmentTorrents != null)
+ torrentsToolbar.setNavigationIcon(null);
+ addmenuButton.setVisibility(View.GONE);
+ actionsToolbar.setVisibility(View.GONE);
+ torrentsToolbar.getMenu().findItem(R.id.action_search).setVisible(false);
+ torrentsToolbar.getMenu().findItem(R.id.action_rss).setVisible(false);
+ torrentsToolbar.getMenu().findItem(R.id.action_settings).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
+ torrentsToolbar.getMenu().findItem(R.id.action_help).setVisible(true);
+ actionsToolbar.getMenu().findItem(R.id.action_enableturtle).setVisible(false);
+ actionsToolbar.getMenu().findItem(R.id.action_disableturtle).setVisible(false);
+ actionsToolbar.getMenu().findItem(R.id.action_refresh).setVisible(false);
+ actionsToolbar.getMenu().findItem(R.id.action_sort).setVisible(false);
+ if (fragmentTorrents != null) {
fragmentTorrents.updateConnectionStatus(false, null);
- getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
+ }
return true;
}
// There is a connection (read: settings to some server known)
- menu.findItem(R.id.action_add).setVisible(true);
+ if (drawerToggle != null)
+ torrentsToolbar.setNavigationIcon(R.drawable.ic_action_drawer);
+ addmenuButton.setVisibility(View.VISIBLE);
+ actionsToolbar.setVisibility(View.VISIBLE);
boolean addByFile = Daemon.supportsAddByFile(currentConnection.getType());
- menu.findItem(R.id.action_add_fromfile).setVisible(addByFile);
- menu.findItem(R.id.action_search).setVisible(navigationHelper.enableSearchUi());
- menu.findItem(R.id.action_rss).setVisible(navigationHelper.enableRssUi());
+ addmenuFileButton.setVisibility(addByFile ? View.VISIBLE : View.GONE);
+ // Primary toolbar menu
+ torrentsToolbar.getMenu().findItem(R.id.action_search).setVisible(navigationHelper.enableSearchUi());
+ torrentsToolbar.getMenu().findItem(R.id.action_rss).setVisible(navigationHelper.enableRssUi());
+ torrentsToolbar.getMenu().findItem(R.id.action_settings).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
+ torrentsToolbar.getMenu().findItem(R.id.action_help).setVisible(false);
+ // Secondary toolbar menu
boolean hasAltMode = Daemon.supportsSetAlternativeMode(currentConnection.getType());
- menu.findItem(R.id.action_enableturtle).setVisible(hasAltMode && !turleModeEnabled);
- menu.findItem(R.id.action_disableturtle).setVisible(hasAltMode && turleModeEnabled);
- menu.findItem(R.id.action_refresh).setVisible(true);
- menu.findItem(R.id.action_sort).setVisible(true);
- menu.findItem(R.id.action_sort_added).setVisible(Daemon.supportsDateAdded(currentConnection.getType()));
- menu.findItem(R.id.action_filter).setVisible(true);
- menu.findItem(R.id.action_settings).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
- menu.findItem(R.id.action_help).setVisible(false);
- if (fragmentTorrents != null)
+ actionsToolbar.getMenu().findItem(R.id.action_enableturtle).setVisible(hasAltMode && !turtleModeEnabled);
+ actionsToolbar.getMenu().findItem(R.id.action_disableturtle).setVisible(hasAltMode && turtleModeEnabled);
+ actionsToolbar.getMenu().findItem(R.id.action_refresh).setVisible(true);
+ actionsToolbar.getMenu().findItem(R.id.action_sort).setVisible(true);
+ actionsToolbar.getMenu().findItem(R.id.action_sort_added).setVisible(Daemon.supportsDateAdded(currentConnection.getType()));
+ if (fragmentTorrents != null) {
fragmentTorrents.updateConnectionStatus(true, currentConnection.getType());
- getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
+ }
return true;
}
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ // Handle only if this is the drawer toggle; otherwise the AndroidAnnotations will be used
+ return drawerToggle != null && drawerToggle.onOptionsItemSelected(item);
+ }
+
/**
- * Called when an item in the action bar navigation spinner was selected
+ * Handles item selections on the dedicated list of filter items
*/
- @Override
- public boolean onNavigationItemSelected(int itemPosition, long itemId) {
- if (skipNextOnNavigationItemSelectedCalls > 0) {
- skipNextOnNavigationItemSelectedCalls--;
- return false;
- }
- Object item = navigationSpinnerAdapter.getItem(itemPosition);
- if (item instanceof SimpleListItem) {
- // A filter item was selected form the navigation spinner
- filterSelected((SimpleListItem) item, false);
- return true;
+ private OnItemClickListener onFilterListItemClicked = new OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> parent, View view, int position, long id) {
+ navigationList.setItemChecked(position, true);
+ Object item = navigationList.getAdapter().getItem(position);
+ if (item instanceof SimpleListItem) {
+ filterSelected((SimpleListItem) item, false);
+ }
+ if (drawerLayout != null)
+ drawerLayout.closeDrawer(drawerContainer);
}
- // A header was selected; no action
- return false;
- }
+ };
/**
* A new filter was selected; update the view over the current data
@@ -497,9 +543,10 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
// Update connection to the newly selected server and refresh
currentConnection = server.createServerAdapter(connectivityHelper.getConnectedNetworkName(), this);
applicationSettings.setLastUsedServer(server);
- navigationSpinnerAdapter.updateCurrentServer(currentConnection);
- if (forceNewConnection)
- navigationSpinnerAdapter.updateCurrentFilter(currentFilter);
+ serverSelectionView.updateCurrentServer(currentConnection);
+ if (forceNewConnection) {
+ serverSelectionView.updateCurrentFilter(currentFilter);
+ }
// Clear the currently shown list of torrents and perhaps the details
fragmentTorrents.clear(true, true);
@@ -519,7 +566,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
// Set new filter
currentFilter = (NavigationFilter) item;
fragmentTorrents.applyNavigationFilter(currentFilter);
- navigationSpinnerAdapter.updateCurrentFilter(currentFilter);
+ serverSelectionView.updateCurrentFilter(currentFilter);
// Remember that the user last selected this
applicationSettings.setLastUsedNavigationFilter(currentFilter);
// Clear the details view
@@ -536,13 +583,12 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
* @param hasServerSettings Whether there are server settings available, so we can continue to connect
*/
private void updateFragmentVisibility(boolean hasServerSettings) {
- if (filtersList != null)
- filtersList.setVisibility(hasServerSettings ? View.VISIBLE : View.GONE);
if (fragmentDetails != null && fragmentDetails.isAdded()) {
- if (hasServerSettings)
+ if (hasServerSettings) {
getFragmentManager().beginTransaction().show(fragmentDetails).commit();
- else
+ } else {
getFragmentManager().beginTransaction().hide(fragmentDetails).commit();
+ }
}
invalidateOptionsMenu();
}
@@ -555,8 +601,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
protected void handleStartIntent() {
// For intents that come from out of the application, perhaps we can not directly add them
- if (applicationSettings.getDefaultServerKey() == ApplicationSettings.DEFAULTSERVER_ASKONADD
- && getIntent().getData() != null) {
+ if (applicationSettings.getDefaultServerKey() == ApplicationSettings.DEFAULTSERVER_ASKONADD && getIntent().getData() != null) {
// First ask which server to use before adding any intent from the extras
ServerPickerDialog.startServerPicker(this, applicationSettings.getAllServerSettings());
return;
@@ -570,8 +615,6 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
ServerSetting selectedServer = applicationSettings.getAllServerSettings().get(position);
filterSelected(selectedServer, false);
addFromIntent();
- skipNextOnNavigationItemSelectedCalls++; // Prevent this selection from launching filterSelected() again
- getActionBar().setSelectedNavigationItem(position + 1);
}
/**
@@ -590,8 +633,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
String[] titles = intent.getStringArrayExtra("TORRENT_TITLES");
if (urls != null) {
for (int i = 0; i < urls.length; i++) {
- String title = (titles != null && titles.length >= i ? titles[i] : NavigationHelper
- .extractNameFromUri(Uri.parse(urls[i])));
+ String title = (titles != null && titles.length >= i ? titles[i] : NavigationHelper.extractNameFromUri(Uri.parse(urls[i])));
if (intent.hasExtra("PRIVATE_SOURCE")) {
// This is marked by the Search Module as being a private source site; get the url locally first
addTorrentFromPrivateSource(urls[i], title, intent.getStringExtra("PRIVATE_SOURCE"));
@@ -604,10 +646,11 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
}
// Add a torrent from a local or remote data URI?
- if (dataUri == null)
+ if (dataUri == null) {
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.red));
return;
}
@@ -665,15 +708,15 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
// Adding a local .torrent file; the title we show is just the file name
if (dataUri.getScheme().equals("file")) {
addTorrentByFile(data, title);
- return;
}
}
@Override
protected void onPause() {
- if (searchMenu != null)
+ if (searchMenu != null) {
searchMenu.collapseActionView();
+ }
stopAutoRefresh();
super.onPause();
}
@@ -686,13 +729,15 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
return true;
}
- @OptionsItem(resName = "action_add_fromurl")
+ @Click(R.id.addmenu_link_button)
protected void startUrlEntryDialog() {
- UrlEntryDialog.startUrlEntry(this);
+ addmenuButton.collapse();
+ UrlEntryDialog.show(this);
}
- @OptionsItem(resName = "action_add_fromfile")
+ @Click(R.id.addmenu_file_button)
protected void startFilePicker() {
+ addmenuButton.collapse();
FilePickerHelper.startFilePicker(this);
}
@@ -701,13 +746,28 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
public void onFilePicked(int resultCode, Intent data) {
// We should have received an Intent with a local torrent's Uri as data from the file picker
if (data != null && data.getData() != null && !data.getData().toString().equals("")) {
- String url = data.getData().getPath();
- addTorrentByFile(data.getData().toString(), url.substring(url.lastIndexOf("/")));
+ Uri dataUri = data.getData();
+
+ // Get torrent title
+ String title = NavigationHelper.extractNameFromUri(dataUri);
+
+ // Adding a torrent from the via a content:// scheme (access through content provider stream)
+ if (dataUri.getScheme().equals(ContentResolver.SCHEME_CONTENT)) {
+ addTorrentFromDownloads(dataUri, title);
+ return;
+ }
+
+ // Adding a .torrent file directly via the file:// scheme (we can access it directly)
+ if (dataUri.getScheme().equals("file")) {
+ addTorrentByFile(data.getDataString(), title);
+ }
+
}
}
- @OptionsItem(resName = "action_add_frombarcode")
+ @Click(R.id.addmenu_barcode_button)
protected void startBarcodeScanner() {
+ addmenuButton.collapse();
BarcodeHelper.startBarcodeScanner(this, BarcodeHelper.ACTIVITY_BARCODE_ADDTORRENT);
}
@@ -723,7 +783,8 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
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.red)
+ .type(SnackbarType.MULTI_LINE));
} else if (result.startsWith("http") || result.startsWith("https")) {
addTorrentByUrl(result, "QR code result"); // No torrent title known
} else if (navigationHelper.enableSearchUi()) {
@@ -731,110 +792,98 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
}
}
- /**
- * Attaches some view (perhaps contained in a fragment) to this activity's pull to refresh support
- * @param view The view to attach
- */
- @Override
- public void addRefreshableView(View view) {
- if (pullToRefreshAttacher == null) {
- // Still need to initialise the PullToRefreshAttacher
- Options options = new PullToRefreshAttacher.Options();
- options.headerTransformer = new NoProgressHeaderTransformer();
- pullToRefreshAttacher = PullToRefreshAttacher.get(this, options);
- }
- pullToRefreshAttacher.addRefreshableView(view, new OnRefreshListener() {
- @Override
- public void onRefreshStarted(View view) {
- // Just refresh the full screen, now that the user has pulled to refresh
- pullToRefreshAttacher.setRefreshComplete();
- refreshScreen();
- }
- });
- }
-
- @OptionsItem(resName = "action_refresh")
+ @OptionsItem(R.id.action_refresh)
public void refreshScreen() {
fragmentTorrents.updateIsLoading(true);
refreshTorrents();
- if (Daemon.supportsStats(currentConnection.getType()))
+ if (Daemon.supportsStats(currentConnection.getType())) {
getAdditionalStats();
+ }
}
- @OptionsItem(resName = "action_enableturtle")
+ @OptionsItem(R.id.action_enableturtle)
protected void enableTurtleMode() {
updateTurtleMode(true);
}
- @OptionsItem(resName = "action_disableturtle")
+ @OptionsItem(R.id.action_disableturtle)
protected void disableTurtleMode() {
updateTurtleMode(false);
}
- @OptionsItem(resName = "action_rss")
+ @OptionsItem(R.id.action_rss)
protected void openRss() {
RssfeedsActivity_.intent(this).start();
}
- @OptionsItem(resName = "action_settings")
+ @OptionsItem(R.id.action_settings)
protected void openSettings() {
MainSettingsActivity_.intent(this).start();
}
- @OptionsItem(resName = "action_help")
+ @OptionsItem(R.id.action_help)
protected void openHelp() {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.transdroid.org/download/")));
}
- @OptionsItem(resName = "action_sort_byname")
+ @OptionsItem(R.id.action_sort_byname)
protected void sortByName() {
fragmentTorrents.sortBy(TorrentsSortBy.Alphanumeric);
}
- @OptionsItem(resName = "action_sort_status")
+ @OptionsItem(R.id.action_sort_status)
protected void sortByStatus() {
fragmentTorrents.sortBy(TorrentsSortBy.Status);
}
- @OptionsItem(resName = "action_sort_done")
+ @OptionsItem(R.id.action_sort_done)
protected void sortByDateDone() {
fragmentTorrents.sortBy(TorrentsSortBy.DateDone);
}
- @OptionsItem(resName = "action_sort_added")
+ @OptionsItem(R.id.action_sort_added)
protected void sortByDateAdded() {
fragmentTorrents.sortBy(TorrentsSortBy.DateAdded);
}
- @OptionsItem(resName = "action_sort_percent")
+ @OptionsItem(R.id.action_sort_percent)
protected void sortByPercent() {
fragmentTorrents.sortBy(TorrentsSortBy.Percent);
}
- @OptionsItem(resName = "action_sort_downspeed")
+ @OptionsItem(R.id.action_sort_downspeed)
protected void sortByDownspeed() {
fragmentTorrents.sortBy(TorrentsSortBy.DownloadSpeed);
}
- @OptionsItem(resName = "action_sort_upspeed")
+ @OptionsItem(R.id.action_sort_upspeed)
protected void sortByUpspeed() {
fragmentTorrents.sortBy(TorrentsSortBy.UploadSpeed);
}
- @OptionsItem(resName = "action_sort_ratio")
+ @OptionsItem(R.id.action_sort_ratio)
protected void sortByRatio() {
fragmentTorrents.sortBy(TorrentsSortBy.Ratio);
}
- @OptionsItem(resName = "action_sort_size")
+ @OptionsItem(R.id.action_sort_size)
protected void sortBySize() {
fragmentTorrents.sortBy(TorrentsSortBy.Size);
}
- @OptionsItem(resName = "action_filter")
- protected void startFilterEntryDialog() {
- FilterEntryDialog.startFilterEntry(this);
- }
+ private SearchView.OnQueryTextListener filterQueryTextChanged = new SearchView.OnQueryTextListener() {
+ @Override
+ public boolean onQueryTextSubmit(String query) {
+ return false;
+ }
+
+ @Override
+ public boolean onQueryTextChange(String newText) {
+ // Redirect to filter method which will directly apply it
+ filterTorrents(newText);
+ return true;
+ }
+ };
/**
* Redirect the newly entered list filter to the torrents fragment.
@@ -845,16 +894,15 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
}
/**
- * Shows the a details fragment for the given torrent, either in the dedicated details fragment pane, in the same
- * pane as the torrent list was displayed or by starting a details activity.
+ * Shows the a details fragment for the given torrent, either in the dedicated details fragment pane, in the same pane as the torrent list was
+ * displayed or by starting a details activity.
* @param torrent The torrent to show detailed statistics for
*/
public void openDetails(Torrent torrent) {
if (fragmentDetails != null && fragmentDetails.isAdded()) {
fragmentDetails.updateTorrent(torrent);
} else {
- DetailsActivity_.intent(this).torrent(torrent).currentLabels(lastNavigationLabels)
- .startForResult(RESULT_DETAILS);
+ DetailsActivity_.intent(this).torrent(torrent).currentLabels(lastNavigationLabels).startForResult(RESULT_DETAILS);
}
}
@@ -867,8 +915,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
return;
}
if (result instanceof RetrieveTaskSuccessResult) {
- onTorrentsRetrieved(((RetrieveTaskSuccessResult) result).getTorrents(),
- ((RetrieveTaskSuccessResult) result).getLabels());
+ onTorrentsRetrieved(((RetrieveTaskSuccessResult) result).getTorrents(), ((RetrieveTaskSuccessResult) result).getLabels());
} else {
onCommunicationError((DaemonTaskFailureResult) result, true);
}
@@ -876,8 +923,9 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
@Background
public void refreshTorrentDetails(Torrent torrent) {
- if (!Daemon.supportsFineDetails(currentConnection.getType()))
+ if (!Daemon.supportsFineDetails(currentConnection.getType())) {
return;
+ }
String startConnectionId = currentConnection.getSettings().getIdString();
DaemonTaskResult result = GetTorrentDetailsTask.create(currentConnection, torrent).execute(log);
if (!startConnectionId.equals(currentConnection.getSettings().getIdString())) {
@@ -893,8 +941,9 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
@Background
public void refreshTorrentFiles(Torrent torrent) {
- if (!Daemon.supportsFileListing(currentConnection.getType()))
+ if (!Daemon.supportsFileListing(currentConnection.getType())) {
return;
+ }
String startConnectionId = currentConnection.getSettings().getIdString();
DaemonTaskResult result = GetFileListTask.create(currentConnection, torrent).execute(log);
if (!startConnectionId.equals(currentConnection.getSettings().getIdString())) {
@@ -963,9 +1012,8 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
AddByMagnetUrlTask addByMagnetUrlTask = AddByMagnetUrlTask.create(currentConnection, url);
if (!Daemon.supportsAddByMagnetUrl(currentConnection.getType())) {
// No support for magnet links: forcefully let the task fail to report the error
- onCommunicationError(new DaemonTaskFailureResult(addByMagnetUrlTask,
- new DaemonException(DaemonException.ExceptionType.MethodUnsupported,
- currentConnection.getType().name() + " does not support magnet links")), false);
+ onCommunicationError(new DaemonTaskFailureResult(addByMagnetUrlTask, new DaemonException(DaemonException.ExceptionType.MethodUnsupported,
+ currentConnection.getType().name() + " does not support magnet links")), false);
return;
}
@@ -998,10 +1046,10 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
} 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.red));
} 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.red));
}
}
@@ -1013,7 +1061,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
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.red));
}
}
@@ -1023,8 +1071,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
try {
// Cookies are taken from the websearchSetting that we already matched against this target URL
- DefaultHttpClient httpclient = HttpHelper.createStandardHttpClient(false, null, null, true, null, 10000,
- null, -1);
+ DefaultHttpClient httpclient = HttpHelper.createStandardHttpClient(false, null, null, true, null, 10000, null, -1);
Map cookies = HttpHelper.parseCookiePairs(websearchSetting.getCookies());
String domain = Uri.parse(url).getHost();
for (Entry pair : cookies.entrySet()) {
@@ -1037,19 +1084,19 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
// Download the torrent at the specified URL (which will first be written to a temporary file)
// If we get an HTTP 401, 403 or 404 response, show an error to the user
HttpResponse response = httpclient.execute(new HttpGet(url));
- if (response.getStatusLine().getStatusCode() == HttpStatus.SC_UNAUTHORIZED
- || response.getStatusLine().getStatusCode() == HttpStatus.SC_FORBIDDEN
- || 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);
+ if (response.getStatusLine().getStatusCode() == HttpStatus.SC_UNAUTHORIZED ||
+ response.getStatusLine().getStatusCode() == HttpStatus.SC_FORBIDDEN ||
+ response.getStatusLine().getStatusCode() == HttpStatus.SC_NOT_FOUND) {
+ log.e(this, "Can't retrieve web torrent " + url + ": Unexpected HTTP response status code " +
+ response.getStatusLine().toString());
+ SnackbarManager.show(Snackbar.with(this).text(R.string.error_401).colorResource(R.color.red));
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.red));
}
}
@@ -1064,8 +1111,9 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
try {
final byte[] buffer = new byte[1024];
int read;
- while ((read = input.read(buffer)) != -1)
+ while ((read = input.read(buffer)) != -1) {
output.write(buffer, 0, read);
+ }
output.flush();
String fileName = Uri.fromFile(tempFile).toString();
addTorrentByFile(fileName, title);
@@ -1074,14 +1122,15 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
}
} 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.red));
} finally {
try {
- if (input != null)
+ if (input != null) {
input.close();
+ }
} 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.red));
}
}
}
@@ -1139,8 +1188,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
public void removeTorrent(Torrent torrent, boolean withData) {
DaemonTaskResult result = RemoveTask.create(currentConnection, torrent, withData).execute(log);
if (result instanceof DaemonTaskSuccessResult) {
- onTaskSucceeded(
- (DaemonTaskSuccessResult) result,
+ onTaskSucceeded((DaemonTaskSuccessResult) result,
getString(withData ? R.string.result_removed_with_data : R.string.result_removed, torrent.getName()));
} else {
onCommunicationError((DaemonTaskFailureResult) result, false);
@@ -1151,13 +1199,10 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
@Override
public void updateLabel(Torrent torrent, String newLabel) {
torrent.mimicNewLabel(newLabel);
- DaemonTaskResult result = SetLabelTask.create(currentConnection, torrent, newLabel == null ? "" : newLabel)
- .execute(log);
+ DaemonTaskResult result = SetLabelTask.create(currentConnection, torrent, newLabel == null ? "" : newLabel).execute(log);
if (result instanceof DaemonTaskSuccessResult) {
- onTaskSucceeded(
- (DaemonTaskSuccessResult) result,
- newLabel == null ? getString(R.string.result_labelremoved) : getString(R.string.result_labelset,
- newLabel));
+ onTaskSucceeded((DaemonTaskSuccessResult) result,
+ newLabel == null ? getString(R.string.result_labelremoved) : getString(R.string.result_labelset, newLabel));
} else {
onCommunicationError((DaemonTaskFailureResult) result, false);
}
@@ -1169,8 +1214,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
torrent.mimicCheckingStatus();
DaemonTaskResult result = ForceRecheckTask.create(currentConnection, torrent).execute(log);
if (result instanceof DaemonTaskSuccessResult) {
- onTaskSucceeded((DaemonTaskSuccessResult) result,
- getString(R.string.result_recheckedstarted, torrent.getName()));
+ onTaskSucceeded((DaemonTaskSuccessResult) result, getString(R.string.result_recheckedstarted, torrent.getName()));
} else {
onCommunicationError((DaemonTaskFailureResult) result, false);
}
@@ -1201,8 +1245,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
@Background
@Override
public void updatePriority(Torrent torrent, List files, Priority priority) {
- DaemonTaskResult result = SetFilePriorityTask.create(currentConnection, torrent, priority,
- new ArrayList(files)).execute(log);
+ DaemonTaskResult result = SetFilePriorityTask.create(currentConnection, torrent, priority, new ArrayList<>(files)).execute(log);
if (result instanceof DaemonTaskSuccessResult) {
onTaskSucceeded((DaemonTaskSuccessResult) result, getString(R.string.result_priotitiesset));
} else {
@@ -1212,8 +1255,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
@Background
public void updateMaxSpeeds(Integer maxDownloadSpeed, Integer maxUploadSpeed) {
- DaemonTaskResult result = SetTransferRatesTask.create(currentConnection, maxUploadSpeed, maxDownloadSpeed)
- .execute(log);
+ DaemonTaskResult result = SetTransferRatesTask.create(currentConnection, maxUploadSpeed, maxDownloadSpeed).execute(log);
if (result instanceof DaemonTaskSuccessResult) {
onTaskSucceeded((DaemonTaskSuccessResult) result, getString(R.string.result_maxspeedsset));
} else {
@@ -1225,31 +1267,32 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
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
protected void onCommunicationError(DaemonTaskFailureResult result, boolean isCritical) {
+ //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.red).type(SnackbarType.MULTI_LINE));
fragmentTorrents.updateIsLoading(false);
if (isCritical) {
fragmentTorrents.updateError(error);
- if (fragmentDetails != null && fragmentDetails.isAdded())
+ if (fragmentDetails != null && fragmentDetails.isAdded()) {
fragmentDetails.updateIsLoading(false, error);
+ }
}
}
@UiThread
protected void onTorrentsRetrieved(List torrents, List labels) {
- lastNavigationLabels = Label.convertToNavigationLabels(labels,
- getResources().getString(R.string.labels_unlabeled));
+ lastNavigationLabels = Label.convertToNavigationLabels(labels, getResources().getString(R.string.labels_unlabeled));
// Report the newly retrieved list of torrents to the torrents fragment
fragmentTorrents.updateIsLoading(false);
- fragmentTorrents.updateTorrents(new ArrayList(torrents), lastNavigationLabels);
+ fragmentTorrents.updateTorrents(new ArrayList<>(torrents), lastNavigationLabels);
// Update the details fragment if the currently shown torrent is in the newly retrieved list
if (fragmentDetails != null && fragmentDetails.isAdded()) {
@@ -1257,27 +1300,19 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
}
// Update local list of labels in the navigation
- if (navigationListAdapter != null) {
- // Labels are shown in the dedicated side navigation
- navigationListAdapter.updateLabels(lastNavigationLabels);
- } else {
- // Labels are shown in the action bar spinner
- navigationSpinnerAdapter.updateLabels(lastNavigationLabels);
- }
- if (fragmentDetails != null && fragmentDetails.isAdded())
+ navigationListAdapter.updateLabels(lastNavigationLabels);
+ if (fragmentDetails != null && fragmentDetails.isAdded()) {
fragmentDetails.updateLabels(lastNavigationLabels);
+ }
// Perhaps we were still waiting to preselect the last used filter (on a fresh application start)
- if (preselectNavigationFilter != null) {
- FilterListAdapter adapter = navigationListAdapter != null ? navigationListAdapter
- : navigationSpinnerAdapter;
- for (int i = 0; i < adapter.getCount(); i++) {
- // Regardless of the navigation style (side list or action bar spinner), we can look up the navigation
- // filter item, which is represented as simple list item (and might not exist any more, such as with a
- // label that is deleted on the server)
- Object item = adapter.getItem(i);
- if (item instanceof SimpleListItem && item instanceof NavigationFilter
- && ((NavigationFilter) item).getCode().equals(preselectNavigationFilter)) {
+ if (preselectNavigationFilter != null && navigationListAdapter != null) {
+ for (int i = 0; i < navigationListAdapter.getCount(); i++) {
+ // Look up the navigation filter item, which is represented as simple list item (and might not exist any
+ // more, such as with a label that is deleted on the server)
+ Object item = navigationListAdapter.getItem(i);
+ if (item instanceof SimpleListItem && item instanceof NavigationFilter &&
+ ((NavigationFilter) item).getCode().equals(preselectNavigationFilter)) {
filterSelected((SimpleListItem) item, false);
break;
}
@@ -1287,28 +1322,30 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
}
// Update the server status (counts and speeds) in the action bar
- serverStatusView.update(torrents, systemSettings.treatDormantAsInactive(),
- Daemon.supportsSetTransferRates(currentConnection.getType()));
+ serverStatusView
+ .updateStatus(torrents, systemSettings.treatDormantAsInactive(), Daemon.supportsSetTransferRates(currentConnection.getType()));
}
@UiThread
protected void onTorrentDetailsRetrieved(Torrent torrent, TorrentDetails torrentDetails) {
// Update the details fragment with the new fine details for the shown torrent
- if (fragmentDetails != null && fragmentDetails.isAdded())
+ if (fragmentDetails != null && fragmentDetails.isAdded()) {
fragmentDetails.updateTorrentDetails(torrent, torrentDetails);
+ }
}
@UiThread
protected void onTorrentFilesRetrieved(Torrent torrent, List torrentFiles) {
// Update the details fragment with the newly retrieved list of files
- if (fragmentDetails != null && fragmentDetails.isAdded())
- fragmentDetails.updateTorrentFiles(torrent, new ArrayList(torrentFiles));
+ if (fragmentDetails != null && fragmentDetails.isAdded()) {
+ fragmentDetails.updateTorrentFiles(torrent, new ArrayList<>(torrentFiles));
+ }
}
@UiThread
protected void onTurtleModeRetrieved(boolean turtleModeEnabled) {
- turleModeEnabled = turtleModeEnabled;
+ this.turtleModeEnabled = turtleModeEnabled;
invalidateOptionsMenu();
}
diff --git a/app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java b/app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java
index 6bb7a267..b5d371c3 100644
--- a/app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java
+++ b/app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java
@@ -16,10 +16,22 @@
*/
package org.transdroid.core.gui;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Locale;
+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;
+import android.view.View;
+import android.widget.AbsListView.MultiChoiceModeListener;
+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;
@@ -31,7 +43,8 @@ import org.androidannotations.annotations.ViewById;
import org.transdroid.R;
import org.transdroid.core.app.settings.ApplicationSettings;
import org.transdroid.core.app.settings.SystemSettings;
-import org.transdroid.core.gui.lists.*;
+import org.transdroid.core.gui.lists.TorrentsAdapter;
+import org.transdroid.core.gui.lists.TorrentsAdapter_;
import org.transdroid.core.gui.navigation.Label;
import org.transdroid.core.gui.navigation.NavigationFilter;
import org.transdroid.core.gui.navigation.RefreshableActivity;
@@ -43,23 +56,17 @@ import org.transdroid.daemon.Torrent;
import org.transdroid.daemon.TorrentsComparator;
import org.transdroid.daemon.TorrentsSortBy;
-import android.app.Fragment;
-import android.view.ActionMode;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.widget.AbsListView.MultiChoiceModeListener;
-import android.widget.ListView;
-import android.widget.ProgressBar;
-import android.widget.TextView;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Locale;
/**
- * Fragment that shows a list of torrents that are active on the server. It supports sorting and filtering and can show
- * connection progress and issues. However, actual task starting and execution and overall navigation elements are part
- * of the containing activity, not this fragment.
+ * Fragment that shows a list of torrents that are active on the server. It supports sorting and filtering and can show connection progress and
+ * issues. However, actual task starting and execution and overall navigation elements are part of the containing activity, not this fragment.
* @author Eric Kok
*/
-@EFragment(resName = "fragment_torrents")
+@EFragment(R.layout.fragment_torrents)
public class TorrentsFragment extends Fragment implements OnLabelPickedListener {
// Local data
@@ -91,7 +98,9 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
protected Daemon daemonType;
// Views
- @ViewById(resName = "torrents_list")
+ @ViewById
+ protected SwipeRefreshLayout swipeRefreshLayout;
+ @ViewById
protected ListView torrentsList;
@ViewById
protected TextView emptyText;
@@ -113,11 +122,18 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
torrentsList.setAdapter(TorrentsAdapter_.getInstance_(getActivity()));
torrentsList.setMultiChoiceModeListener(onTorrentsSelected);
torrentsList.setFastScrollEnabled(true);
- if (torrents != null)
+ if (torrents != null) {
updateTorrents(torrents, currentLabels);
+ }
// Allow pulls on the list view to refresh the torrents
if (getActivity() != null && getActivity() instanceof RefreshableActivity) {
- ((RefreshableActivity) getActivity()).addRefreshableView(torrentsList);
+ swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
+ @Override
+ public void onRefresh() {
+ ((RefreshableActivity) getActivity()).refreshScreen();
+ swipeRefreshLayout.setRefreshing(false); // Use our custom indicator
+ }
+ });
}
nosettingsText.setText(getString(R.string.navigation_nosettings, getString(R.string.app_name)));
@@ -149,8 +165,9 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
}
}
// In case it was an update, add the updated torrent object
- if (!wasRemoved)
+ if (!wasRemoved) {
this.torrents.add(affected);
+ }
// Now refresh the screen
applyAllFilters();
}
@@ -162,8 +179,9 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
*/
public void clear(boolean clearError, boolean clearFilter) {
this.torrents = null;
- if (clearError)
+ if (clearError) {
this.connectionErrorMessage = null;
+ }
if (clearFilter) {
this.currentTextFilter = null;
this.currentNavigationFilter = null;
@@ -172,8 +190,8 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
}
/**
- * Stores the new sort order (for future refreshes) and sorts the current visible list. If the given new sort
- * property equals the existing property, the list sort order is reversed instead.
+ * Stores the new sort order (for future refreshes) and sorts the current visible list. If the given new sort property equals the existing
+ * property, the list sort order is reversed instead.
* @param newSortOrder The sort order that the user selected.
*/
public void sortBy(TorrentsSortBy newSortOrder) {
@@ -212,26 +230,26 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
}
// Filter the list of torrents to show according to navigation and text filters
- ArrayList filteredTorrents = new ArrayList(torrents);
+ ArrayList filteredTorrents = new ArrayList<>(torrents);
if (currentNavigationFilter != null) {
// Remove torrents that do not match the selected navigation filter
- for (Iterator torrentIter = filteredTorrents.iterator(); torrentIter.hasNext();) {
- if (!currentNavigationFilter.matches(torrentIter.next(), systemSettings.treatDormantAsInactive()))
+ for (Iterator torrentIter = filteredTorrents.iterator(); torrentIter.hasNext(); ) {
+ if (!currentNavigationFilter.matches(torrentIter.next(), systemSettings.treatDormantAsInactive())) {
torrentIter.remove();
+ }
}
}
if (currentTextFilter != null) {
- // Remove torrent that do not contain the text filter string
- for (Iterator torrentIter = filteredTorrents.iterator(); torrentIter.hasNext();) {
- if (!torrentIter.next().getName().toLowerCase(Locale.getDefault())
- .contains(currentTextFilter.toLowerCase(Locale.getDefault())))
+ // Remove torrents that do not contain the text filter string
+ for (Iterator torrentIter = filteredTorrents.iterator(); torrentIter.hasNext(); ) {
+ if (!torrentIter.next().getName().toLowerCase(Locale.getDefault()).contains(currentTextFilter.toLowerCase(Locale.getDefault()))) {
torrentIter.remove();
+ }
}
}
// Sort the list of filtered torrents
- Collections.sort(filteredTorrents, new TorrentsComparator(daemonType, this.currentSortOrder,
- this.currentSortDescending));
+ Collections.sort(filteredTorrents, new TorrentsComparator(daemonType, this.currentSortOrder, this.currentSortDescending));
((TorrentsAdapter) torrentsList.getAdapter()).update(filteredTorrents);
updateViewVisibility();
@@ -239,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;
}
@@ -255,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) {
@@ -270,11 +308,11 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
// Get checked torrents
- ArrayList checked = new ArrayList();
+ ArrayList checked = new ArrayList<>();
for (int i = 0; i < torrentsList.getCheckedItemPositions().size(); i++) {
- if (torrentsList.getCheckedItemPositions().valueAt(i) && i < torrentsList.getAdapter().getCount())
- checked.add((Torrent) torrentsList.getAdapter().getItem(
- torrentsList.getCheckedItemPositions().keyAt(i)));
+ if (torrentsList.getCheckedItemPositions().valueAt(i) && i < torrentsList.getAdapter().getCount()) {
+ checked.add((Torrent) torrentsList.getAdapter().getItem(torrentsList.getCheckedItemPositions().keyAt(i)));
+ }
}
int itemId = item.getItemId();
@@ -316,9 +354,9 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
return true;
} else if (itemId == R.id.action_setlabel) {
lastMultiSelectedTorrents = checked;
- if (currentLabels != null)
- new SetLabelDialog().setOnLabelPickedListener(TorrentsFragment.this).setCurrentLabels(currentLabels)
- .show(getFragmentManager(), "SetLabelDialog");
+ if (currentLabels != null) {
+ SetLabelDialog.show(getActivity(), TorrentsFragment.this,currentLabels);
+ }
mode.finish();
return true;
} else {
@@ -339,6 +377,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);
}
};
@@ -359,7 +400,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
}
}
- @ItemClick(resName = "torrents_list")
+ @ItemClick(R.id.torrents_list)
protected void torrentsListClicked(Torrent torrent) {
// Show the torrent details fragment
((TorrentsActivity) getActivity()).openDetails(torrent);
@@ -373,8 +414,8 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
}
/**
- * Updates the shown screen depending on whether we have a connection (so torrents can be shown) or not (in case we
- * need to show a message suggesting help). This should only ever be called on the UI thread.
+ * Updates the shown screen depending on whether we have a connection (so torrents can be shown) or not (in case we need to show a message
+ * suggesting help). This should only ever be called on the UI thread.
* @param hasAConnection True if the user has servers configured and therefore has a connection that can be used
*/
public void updateConnectionStatus(boolean hasAConnection, Daemon daemonType) {
@@ -386,6 +427,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
loadingProgress.setVisibility(View.GONE);
errorText.setVisibility(View.GONE);
nosettingsText.setVisibility(View.VISIBLE);
+ swipeRefreshLayout.setEnabled(false);
clear(true, true); // Indirectly also calls updateViewVisibility()
} else {
updateViewVisibility();
@@ -393,8 +435,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
}
/**
- * Updates the shown screen depending on whether the torrents are loading. This should only ever be called on the UI
- * thread.
+ * Updates the shown screen depending on whether the torrents are loading. This should only ever be called on the UI thread.
* @param isLoading True if the list of torrents is (re)loading, false otherwise
*/
public void updateIsLoading(boolean isLoading) {
@@ -407,10 +448,8 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
}
/**
- * Updates the shown screen depending on whether a connection error occurred. This should only ever be called on the
- * UI thread.
- * @param connectionErrorMessage The error message from the last failed connection attempt, or null to clear the
- * visible error text
+ * Updates the shown screen depending on whether a connection error occurred. This should only ever be called on the UI thread.
+ * @param connectionErrorMessage The error message from the last failed connection attempt, or null to clear the visible error text
*/
public void updateError(String connectionErrorMessage) {
this.connectionErrorMessage = connectionErrorMessage;
@@ -433,6 +472,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
torrentsList.setVisibility(!hasError && !isLoading && !isEmpty ? View.VISIBLE : View.GONE);
loadingProgress.setVisibility(!hasError && isLoading ? View.VISIBLE : View.GONE);
emptyText.setVisibility(!hasError && !isLoading && isEmpty ? View.VISIBLE : View.GONE);
+ swipeRefreshLayout.setEnabled(true);
}
/**
diff --git a/app/src/main/java/org/transdroid/core/gui/lists/NoProgressHeaderTransformer.java b/app/src/main/java/org/transdroid/core/gui/lists/NoProgressHeaderTransformer.java
deleted file mode 100644
index d3632169..00000000
--- a/app/src/main/java/org/transdroid/core/gui/lists/NoProgressHeaderTransformer.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.transdroid.core.gui.lists;
-
-import org.transdroid.R;
-
-import uk.co.senab.actionbarpulltorefresh.library.DefaultHeaderTransformer;
-import android.app.Activity;
-import android.view.View;
-
-public class NoProgressHeaderTransformer extends DefaultHeaderTransformer {
-
- @Override
- public void onViewCreated(Activity activity, View headerView) {
- super.onViewCreated(activity, headerView);
- setProgressBarColor(activity.getResources().getColor(R.color.green));
- }
-
-}
diff --git a/app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemView.java b/app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemView.java
index 9f632dff..96ef720e 100644
--- a/app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemView.java
+++ b/app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemView.java
@@ -16,31 +16,33 @@
*/
package org.transdroid.core.gui.lists;
-import org.androidannotations.annotations.EViewGroup;
-import org.androidannotations.annotations.ViewById;
-
import android.content.Context;
import android.widget.FrameLayout;
import android.widget.TextView;
+import org.androidannotations.annotations.EViewGroup;
+import org.androidannotations.annotations.ViewById;
+import org.transdroid.R;
+
/**
* View that represents some {@link SimpleListItem} object and simple prints out the text (in proper style)
* @author Eric Kok
*/
-@EViewGroup(resName="list_item_simple")
+@EViewGroup(R.layout.list_item_simple)
public class SimpleListItemView extends FrameLayout {
@ViewById
protected TextView itemText;
-
+
public SimpleListItemView(Context context) {
super(context);
}
public void bind(SimpleListItem filterItem, int autoLinkMask) {
itemText.setText(filterItem.getName());
- if (autoLinkMask > 0)
+ if (autoLinkMask > 0) {
itemText.setAutoLinkMask(autoLinkMask);
+ }
}
-
+
}
diff --git a/app/src/main/java/org/transdroid/core/gui/lists/TorrentDetailsView.java b/app/src/main/java/org/transdroid/core/gui/lists/TorrentDetailsView.java
index 4a6de94a..cd22e6a3 100644
--- a/app/src/main/java/org/transdroid/core/gui/lists/TorrentDetailsView.java
+++ b/app/src/main/java/org/transdroid/core/gui/lists/TorrentDetailsView.java
@@ -16,13 +16,6 @@
*/
package org.transdroid.core.gui.lists;
-import org.androidannotations.annotations.EViewGroup;
-import org.androidannotations.annotations.ViewById;
-import org.transdroid.R;
-import org.transdroid.daemon.Daemon;
-import org.transdroid.daemon.Torrent;
-import org.transdroid.daemon.util.FileSizeConverter;
-
import android.content.Context;
import android.text.TextUtils;
import android.text.format.DateUtils;
@@ -30,16 +23,23 @@ import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
+import org.androidannotations.annotations.EViewGroup;
+import org.androidannotations.annotations.ViewById;
+import org.transdroid.R;
+import org.transdroid.daemon.Daemon;
+import org.transdroid.daemon.Torrent;
+import org.transdroid.daemon.util.FileSizeConverter;
+
/**
* Represents a group of views that show torrent status, sizes, speeds and other details.
* @author Eric Kok
*/
-@EViewGroup(resName="fragment_details_header")
+@EViewGroup(R.layout.fragment_details_header)
public class TorrentDetailsView extends RelativeLayout {
@ViewById
- protected TextView labelText, dateaddedText, uploadedText, uploadedunitText, ratioText, upspeedText, seedersText,
- downloadedunitText, downloadedText, totalsizeText, downspeedText, leechersText, statusText;
+ protected TextView labelText, dateaddedText, uploadedText, uploadedunitText, ratioText, upspeedText, seedersText, downloadedunitText,
+ downloadedText, totalsizeText, downspeedText, leechersText, statusText;
@ViewById
protected TorrentStatusLayout statusLayout;
@@ -73,36 +73,31 @@ public class TorrentDetailsView extends RelativeLayout {
// Set status texts
if (torrent.getDateAdded() != null) {
- dateaddedText.setText(getResources().getString(
- R.string.status_sincedate,
- DateUtils.getRelativeDateTimeString(getContext(), torrent.getDateAdded().getTime(),
- DateUtils.SECOND_IN_MILLIS, DateUtils.WEEK_IN_MILLIS, DateUtils.FORMAT_ABBREV_MONTH)));
+ dateaddedText.setText(getResources().getString(R.string.status_sincedate, DateUtils
+ .getRelativeDateTimeString(getContext(), torrent.getDateAdded().getTime(), DateUtils.SECOND_IN_MILLIS,
+ DateUtils.WEEK_IN_MILLIS, DateUtils.FORMAT_ABBREV_MONTH)));
dateaddedText.setVisibility(View.VISIBLE);
} else {
dateaddedText.setVisibility(View.INVISIBLE);
}
-
+
statusLayout.setStatus(torrent.getStatusCode());
statusText.setText(getResources().getString(R.string.status_status, local.getProgressStatusEta(getResources())));
ratioText.setText(getResources().getString(R.string.status_ratio, local.getRatioString()));
- seedersText.setText(getResources().getString(R.string.status_seeders, torrent.getSeedersConnected(),
- torrent.getSeedersKnown()));
- leechersText.setText(getResources().getString(R.string.status_leechers, torrent.getLeechersConnected(),
- torrent.getLeechersKnown()));
+ seedersText.setText(getResources().getString(R.string.status_seeders, torrent.getSeedersConnected(), torrent.getSeedersKnown()));
+ leechersText.setText(getResources().getString(R.string.status_leechers, torrent.getLeechersConnected(), torrent.getLeechersKnown()));
// TODO: Add field that displays torrent errors (as opposed to tracker errors)
// TODO: Add field that displays availability
// Sizes and speeds texts
- totalsizeText.setText(getResources().getString(R.string.status_ofsize,
- FileSizeConverter.getSize(torrent.getTotalSize())));
+ totalsizeText.setText(getResources().getString(R.string.status_ofsize, FileSizeConverter.getSize(torrent.getTotalSize())));
downloadedText.setText(FileSizeConverter.getSize(torrent.getDownloadedEver(), false));
downloadedunitText.setText(FileSizeConverter.getSizeUnit(torrent.getDownloadedEver()).toString());
uploadedText.setText(FileSizeConverter.getSize(torrent.getUploadedEver(), false));
uploadedunitText.setText(FileSizeConverter.getSizeUnit(torrent.getUploadedEver()).toString());
- downspeedText.setText(getResources().getString(R.string.status_speed_down_details,
- FileSizeConverter.getSize(torrent.getRateDownload()) + "/s"));
- upspeedText.setText(getResources().getString(R.string.status_speed_up,
- FileSizeConverter.getSize(torrent.getRateUpload()) + "/s"));
+ downspeedText
+ .setText(getResources().getString(R.string.status_speed_down_details, FileSizeConverter.getSize(torrent.getRateDownload()) + "/s"));
+ upspeedText.setText(getResources().getString(R.string.status_speed_up, FileSizeConverter.getSize(torrent.getRateUpload()) + "/s"));
}
diff --git a/app/src/main/java/org/transdroid/core/gui/lists/TorrentFileView.java b/app/src/main/java/org/transdroid/core/gui/lists/TorrentFileView.java
index 17a91e42..475f7ef3 100644
--- a/app/src/main/java/org/transdroid/core/gui/lists/TorrentFileView.java
+++ b/app/src/main/java/org/transdroid/core/gui/lists/TorrentFileView.java
@@ -16,23 +16,24 @@
*/
package org.transdroid.core.gui.lists;
+import android.content.Context;
+import android.widget.TextView;
+
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;
+import org.transdroid.R;
import org.transdroid.daemon.TorrentFile;
-import android.content.Context;
-import android.widget.TextView;
-
/**
* View that represents some {@link TorrentFile} object and show the file's name, status and priority
* @author Eric Kok
*/
-@EViewGroup(resName="list_item_torrentfile")
+@EViewGroup(R.layout.list_item_torrentfile)
public class TorrentFileView extends TorrentFilePriorityLayout {
@ViewById
protected TextView nameText, progressText, sizesText;
-
+
public TorrentFileView(Context context) {
super(context, null);
}
@@ -43,5 +44,5 @@ public class TorrentFileView extends TorrentFilePriorityLayout {
progressText.setText(torrentFile.getProgressText());
setPriority(torrentFile.getPriority());
}
-
+
}
diff --git a/app/src/main/java/org/transdroid/core/gui/lists/TorrentProgressBar.java b/app/src/main/java/org/transdroid/core/gui/lists/TorrentProgressBar.java
index d5da5884..6fae0972 100644
--- a/app/src/main/java/org/transdroid/core/gui/lists/TorrentProgressBar.java
+++ b/app/src/main/java/org/transdroid/core/gui/lists/TorrentProgressBar.java
@@ -82,12 +82,12 @@ public class TorrentProgressBar extends View {
}
private void initPaints() {
- notdonePaint.setColor(0xFFEEEEEE); // Light grey
- inactiveDonePaint.setColor(0xFFA759D4); // Purple
- inactivePaint.setColor(0xFF9E9E9E); // Grey
- progressPaint.setColor(0xFF42A8FA); // Blue
- donePaint.setColor(0xFF8ACC12); // Green
- errorPaint.setColor(0xFFDE3939); // Red
+ notdonePaint.setColor(getResources().getColor(R.color.torrent_background));
+ inactiveDonePaint.setColor(getResources().getColor(R.color.torrent_paused));
+ inactivePaint.setColor(getResources().getColor(R.color.torrent_other));
+ progressPaint.setColor(getResources().getColor(R.color.torrent_downloading));
+ donePaint.setColor(getResources().getColor(R.color.torrent_seeding));
+ errorPaint.setColor(getResources().getColor(R.color.torrent_error));
}
@Override
diff --git a/app/src/main/java/org/transdroid/core/gui/lists/TorrentStatusLayout.java b/app/src/main/java/org/transdroid/core/gui/lists/TorrentStatusLayout.java
index c3931ea9..acbf21a2 100644
--- a/app/src/main/java/org/transdroid/core/gui/lists/TorrentStatusLayout.java
+++ b/app/src/main/java/org/transdroid/core/gui/lists/TorrentStatusLayout.java
@@ -68,7 +68,7 @@ public class TorrentStatusLayout extends RelativeLayout {
/**
* Registers the status of the represented torrent and invalidates the view so the status colour will be updated
* accordingly.
- * @param status
+ * @param status The updated torrent status to show
*/
public void setStatus(TorrentStatus status) {
this.status = status;
diff --git a/app/src/main/java/org/transdroid/core/gui/lists/TorrentView.java b/app/src/main/java/org/transdroid/core/gui/lists/TorrentView.java
index a29d4c33..2c366bed 100644
--- a/app/src/main/java/org/transdroid/core/gui/lists/TorrentView.java
+++ b/app/src/main/java/org/transdroid/core/gui/lists/TorrentView.java
@@ -16,21 +16,22 @@
*/
package org.transdroid.core.gui.lists;
-import org.androidannotations.annotations.EViewGroup;
-import org.androidannotations.annotations.ViewById;
-import org.transdroid.daemon.Torrent;
-import org.transdroid.daemon.TorrentStatus;
-
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
+import org.androidannotations.annotations.EViewGroup;
+import org.androidannotations.annotations.ViewById;
+import org.transdroid.R;
+import org.transdroid.daemon.Torrent;
+import org.transdroid.daemon.TorrentStatus;
+
/**
* View that represents some {@link Torrent} object and displays progress, status, speeds, etc.
* @author Eric Kok
*/
-@EViewGroup(resName = "list_item_torrent")
+@EViewGroup(R.layout.list_item_torrent)
public class TorrentView extends TorrentStatusLayout {
@ViewById
@@ -54,8 +55,8 @@ public class TorrentView extends TorrentStatusLayout {
priorityImage.setVisibility(View.INVISIBLE);
// Only show status bar, peers and speed fields if relevant, i.e. when downloading or actively seeding
- if (torrent.getStatusCode() == TorrentStatus.Downloading
- || (torrent.getStatusCode() == TorrentStatus.Seeding && torrent.getRateUpload() > 0)) {
+ if (torrent.getStatusCode() == TorrentStatus.Downloading ||
+ (torrent.getStatusCode() == TorrentStatus.Seeding && torrent.getRateUpload() > 0)) {
torrentProgressbar.setVisibility(View.VISIBLE);
torrentProgressbar.setProgress((int) (torrent.getDownloadedPercentage() * 100));
torrentProgressbar.setActive(torrent.canPause());
diff --git a/app/src/main/java/org/transdroid/core/gui/lists/TorrentsAdapter.java b/app/src/main/java/org/transdroid/core/gui/lists/TorrentsAdapter.java
index c9b045d6..fdf0b440 100644
--- a/app/src/main/java/org/transdroid/core/gui/lists/TorrentsAdapter.java
+++ b/app/src/main/java/org/transdroid/core/gui/lists/TorrentsAdapter.java
@@ -16,16 +16,16 @@
*/
package org.transdroid.core.gui.lists;
-import java.util.ArrayList;
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext;
import org.transdroid.daemon.Torrent;
-import android.content.Context;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.BaseAdapter;
+import java.util.ArrayList;
/**
* Adapter that contains a list of torrent objects to show.
@@ -33,9 +33,9 @@ import android.widget.BaseAdapter;
*/
@EBean
public class TorrentsAdapter extends BaseAdapter {
-
+
private ArrayList torrents = null;
-
+
@RootContext
protected Context context;
@@ -47,23 +47,25 @@ public class TorrentsAdapter extends BaseAdapter {
this.torrents = newTorrents;
notifyDataSetChanged();
}
-
+
@Override
public boolean hasStableIds() {
return true;
}
-
+
@Override
public int getCount() {
- if (torrents == null)
+ if (torrents == null) {
return 0;
+ }
return torrents.size();
}
@Override
public Torrent getItem(int position) {
- if (torrents == null)
+ if (torrents == null) {
return null;
+ }
return torrents.get(position);
}
diff --git a/app/src/main/java/org/transdroid/core/gui/navigation/DialogHelper.java b/app/src/main/java/org/transdroid/core/gui/navigation/DialogHelper.java
index d5b90a94..9052fe96 100644
--- a/app/src/main/java/org/transdroid/core/gui/navigation/DialogHelper.java
+++ b/app/src/main/java/org/transdroid/core/gui/navigation/DialogHelper.java
@@ -48,7 +48,7 @@ public class DialogHelper extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(dialog.getDialogLayoutId());
- getActionBar().setDisplayHomeAsUpEnabled(true);
+ // TODO getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
diff --git a/app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java b/app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java
index c75e509d..a4e016be 100644
--- a/app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java
+++ b/app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java
@@ -16,8 +16,8 @@
*/
package org.transdroid.core.gui.navigation;
-import java.util.ArrayList;
-import java.util.List;
+import android.content.Context;
+import android.view.View;
import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext;
@@ -28,12 +28,11 @@ import org.transdroid.core.gui.lists.SimpleListItem;
import org.transdroid.core.gui.lists.ViewHolderAdapter;
import org.transdroid.core.gui.navigation.StatusType.StatusTypeFilter;
-import android.content.Context;
-import android.view.View;
+import java.util.ArrayList;
+import java.util.List;
/**
- * List adapter that holds filter items, that is, servers, view types and labels. A header item is inserted where
- * appropriate.
+ * List adapter that holds filter items, that is, servers, view types and labels. A header item is inserted where appropriate.
* @author Eric Kok
*/
@EBean
@@ -54,8 +53,7 @@ public class FilterListAdapter extends MergeAdapter {
*/
public void updateServers(List servers) {
if (this.serverItems == null && servers != null) {
- serverSeparator = new ViewHolderAdapter(FilterSeparatorView_.build(context).setText(
- context.getString(R.string.navigation_servers)));
+ serverSeparator = new ViewHolderAdapter(FilterSeparatorView_.build(context).setText(context.getString(R.string.navigation_servers)));
serverSeparator.setViewVisibility(servers.isEmpty() ? View.GONE : View.VISIBLE);
addAdapter(serverSeparator);
this.serverItems = new FilterListItemAdapter(context, servers);
@@ -76,8 +74,7 @@ public class FilterListAdapter extends MergeAdapter {
*/
public void updateStatusTypes(List statusTypes) {
if (this.statusTypeItems == null && statusTypes != null) {
- statusTypeSeparator = new ViewHolderAdapter(FilterSeparatorView_.build(context).setText(
- context.getString(R.string.navigation_status)));
+ statusTypeSeparator = new ViewHolderAdapter(FilterSeparatorView_.build(context).setText(context.getString(R.string.navigation_status)));
statusTypeSeparator.setViewVisibility(statusTypes.isEmpty() ? View.GONE : View.VISIBLE);
addAdapter(statusTypeSeparator);
this.statusTypeItems = new FilterListItemAdapter(context, statusTypes);
@@ -98,8 +95,7 @@ public class FilterListAdapter extends MergeAdapter {
*/
public void updateLabels(List labels) {
if (this.labelItems == null && labels != null) {
- labelSeperator = new ViewHolderAdapter(FilterSeparatorView_.build(context).setText(
- context.getString(R.string.navigation_labels)));
+ labelSeperator = new ViewHolderAdapter(FilterSeparatorView_.build(context).setText(context.getString(R.string.navigation_labels)));
labelSeperator.setViewVisibility(labels.isEmpty() ? View.GONE : View.VISIBLE);
addAdapter(labelSeperator);
this.labelItems = new FilterListItemAdapter(context, labels);
diff --git a/app/src/main/java/org/transdroid/core/gui/navigation/FilterListDropDownAdapter.java b/app/src/main/java/org/transdroid/core/gui/navigation/FilterListDropDownAdapter.java
deleted file mode 100644
index 3a1b1c0e..00000000
--- a/app/src/main/java/org/transdroid/core/gui/navigation/FilterListDropDownAdapter.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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 .
- */
-package org.transdroid.core.gui.navigation;
-
-import org.androidannotations.annotations.EBean;
-import org.transdroid.daemon.IDaemonAdapter;
-
-import android.view.View;
-import android.view.ViewGroup;
-
-/**
- * List adapter that holds filter items, that is, servers, view types and labels and is displayed as content to a
- * Spinner instead of a ListView.
- * @author Eric Kok
- */
-@EBean
-public class FilterListDropDownAdapter extends FilterListAdapter {
-
- protected NavigationSelectionView navigationSelectionView = null;
- private String currentServer = null;
- private String currentFilter = null;
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- // This returns the singleton navigation spinner view
- if (navigationSelectionView == null) {
- navigationSelectionView = NavigationSelectionView_.build(context);
- }
- navigationSelectionView.bind(currentServer, currentFilter);
- return navigationSelectionView;
- }
-
- @Override
- public View getDropDownView(int position, View convertView, ViewGroup parent) {
- // This returns the item to show in the drop down list
- return super.getView(position, convertView, parent);
- }
-
- public void updateCurrentFilter(NavigationFilter currentFilter) {
- this.currentFilter = currentFilter.getName();
- if (navigationSelectionView != null)
- navigationSelectionView.bind(this.currentServer, this.currentFilter);
- }
-
- public void updateCurrentServer(IDaemonAdapter currentConnection) {
- this.currentServer = currentConnection.getSettings().getName();
- if (navigationSelectionView != null)
- navigationSelectionView.bind(this.currentServer, this.currentFilter);
- }
-
- public void hideServersLabel() {
- serverSeparator.setViewVisibility(View.GONE);
- notifyDataSetInvalidated();
- }
-
-}
diff --git a/app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemAdapter.java b/app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemAdapter.java
index c2fa40de..23213bf0 100644
--- a/app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemAdapter.java
+++ b/app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemAdapter.java
@@ -16,16 +16,16 @@
*/
package org.transdroid.core.gui.navigation;
-import java.util.List;
-
-import org.transdroid.core.gui.lists.SimpleListItem;
-import org.transdroid.core.gui.lists.SimpleListItemView;
-
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
+import org.transdroid.core.gui.lists.SimpleListItem;
+import org.transdroid.core.gui.lists.SimpleListItemView;
+
+import java.util.List;
+
public class FilterListItemAdapter extends BaseAdapter {
private final Context context;
diff --git a/app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemView.java b/app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemView.java
index dbca6b3d..ceab9dd5 100644
--- a/app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemView.java
+++ b/app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemView.java
@@ -16,24 +16,25 @@
*/
package org.transdroid.core.gui.navigation;
-import org.androidannotations.annotations.EViewGroup;
-import org.androidannotations.annotations.ViewById;
-import org.transdroid.core.gui.lists.SimpleListItem;
-
import android.content.Context;
import android.widget.FrameLayout;
import android.widget.TextView;
+import org.androidannotations.annotations.EViewGroup;
+import org.androidannotations.annotations.ViewById;
+import org.transdroid.R;
+import org.transdroid.core.gui.lists.SimpleListItem;
+
/**
* View that represents some {@link SimpleListItem} object specifically used to represent a navigation filter item.
* @author Eric Kok
*/
-@EViewGroup(resName="list_item_filter")
+@EViewGroup(R.layout.list_item_filter)
public class FilterListItemView extends FrameLayout {
@ViewById
protected TextView itemText;
-
+
public FilterListItemView(Context context) {
super(context);
}
@@ -41,5 +42,5 @@ public class FilterListItemView extends FrameLayout {
public void bind(SimpleListItem filterItem) {
itemText.setText(filterItem.getName());
}
-
+
}
diff --git a/app/src/main/java/org/transdroid/core/gui/navigation/FilterSeparatorView.java b/app/src/main/java/org/transdroid/core/gui/navigation/FilterSeparatorView.java
index c98dfddf..2fd210b4 100644
--- a/app/src/main/java/org/transdroid/core/gui/navigation/FilterSeparatorView.java
+++ b/app/src/main/java/org/transdroid/core/gui/navigation/FilterSeparatorView.java
@@ -16,26 +16,27 @@
*/
package org.transdroid.core.gui.navigation;
-import org.androidannotations.annotations.EViewGroup;
-import org.androidannotations.annotations.ViewById;
-
import android.content.Context;
import android.widget.AbsListView;
import android.widget.FrameLayout;
import android.widget.TextView;
+import org.androidannotations.annotations.EViewGroup;
+import org.androidannotations.annotations.ViewById;
+import org.transdroid.R;
+
/**
* A list item that shows a sub header or separator (in underlined Holo style).
* @author Eric Kok
*/
-@EViewGroup(resName="list_item_separator")
+@EViewGroup(R.layout.list_item_separator)
public class FilterSeparatorView extends FrameLayout {
protected String text;
-
+
@ViewById
protected TextView separatorText;
-
+
public FilterSeparatorView(Context context) {
super(context);
}
@@ -47,9 +48,8 @@ public class FilterSeparatorView extends FrameLayout {
*/
public FilterSeparatorView setText(String text) {
separatorText.setText(text);
- setLayoutParams(new AbsListView.LayoutParams(AbsListView.LayoutParams.WRAP_CONTENT,
- AbsListView.LayoutParams.WRAP_CONTENT));
+ setLayoutParams(new AbsListView.LayoutParams(AbsListView.LayoutParams.WRAP_CONTENT, AbsListView.LayoutParams.WRAP_CONTENT));
return this;
}
-
+
}
diff --git a/app/src/main/java/org/transdroid/core/gui/navigation/Label.java b/app/src/main/java/org/transdroid/core/gui/navigation/Label.java
index aee80d3b..038e0b19 100644
--- a/app/src/main/java/org/transdroid/core/gui/navigation/Label.java
+++ b/app/src/main/java/org/transdroid/core/gui/navigation/Label.java
@@ -16,16 +16,16 @@
*/
package org.transdroid.core.gui.navigation;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.text.TextUtils;
import org.transdroid.core.gui.lists.SimpleListItem;
import org.transdroid.daemon.Torrent;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.text.TextUtils;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
/**
* Represents some label that is active or available on the server.
@@ -44,18 +44,19 @@ public class Label implements SimpleListItem, NavigationFilter, Comparable convertToNavigationLabels(List daemonLabels,
- String unnamedLabel) {
- if (daemonLabels == null)
+ public static ArrayList convertToNavigationLabels(List daemonLabels, String unnamedLabel) {
+ if (daemonLabels == null) {
return null;
- ArrayList localLabels = new ArrayList();
+ }
+ ArrayList localLabels = new ArrayList<>();
unnamedLabelText = unnamedLabel;
localLabels.add(new Label(unnamedLabel, -1, true));
for (org.transdroid.daemon.Label label : daemonLabels) {
- if (!TextUtils.isEmpty(label.getName()))
+ if (!TextUtils.isEmpty(label.getName())) {
localLabels.add(new Label(label));
+ }
}
Collections.sort(localLabels);
return localLabels;
@@ -134,7 +136,7 @@ public class Label implements SimpleListItem, NavigationFilter, Comparable= 0) {
+ int begin = start + (parameter + "=").length();
+ int end = uri.toString().indexOf("&", begin);
+ return uri.toString().substring(begin, end >= 0 ? end : uri.toString().length());
+ }
+ return null;
+ }
/**
* Returns (and initialises, if needed) an image cache that uses memory and (1MB) local storage.
@@ -78,8 +123,7 @@ public class NavigationHelper {
if (imageCache == null) {
imageCache = ImageLoader.getInstance();
try {
- LruDiscCache diskCache =
- new LruDiscCache(context.getCacheDir(), null, new Md5FileNameGenerator(), 640000, 25);
+ LruDiscCache diskCache = new LruDiscCache(context.getCacheDir(), null, new Md5FileNameGenerator(), 640000, 25);
// @formatter:off
Builder imageCacheBuilder = new Builder(context)
.defaultDisplayImageOptions(
@@ -100,24 +144,16 @@ public class NavigationHelper {
}
/**
- * Whether any search-related UI components should be shown in the interface. At the moment returns false only if we
- * run as Transdroid Lite version.
- * @return True if search is enabled, false otherwise
+ * Returns the application name (like Transdroid) and version name (like 1.5.0), appended by the version code (like 180).
+ * @return The app name and version, such as 'Transdroid 1.5.0 (180)'
*/
public String getAppNameAndVersion() {
- String appName = context.getString(R.string.app_name);
- try {
- PackageInfo m = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
- return appName + " " + m.versionName + " (" + m.versionCode + ")";
- } catch (NameNotFoundException e) {
- return appName;
- }
+ return context.getString(R.string.app_name) + " " + BuildConfig.VERSION_NAME + " (" + Integer.toString(BuildConfig.VERSION_CODE) + ")";
}
/**
- * Returns whether the device is considered small (i.e. a phone) rather than large (i.e. a tablet). Can, for
- * example, be used to determine if a dialog should be shown full screen. Currently is true if the device's smallest
- * dimension is 500 dip.
+ * Returns whether the device is considered small (i.e. a phone) rather than large (i.e. a tablet). Can, for example, be used to determine if a
+ * dialog should be shown full screen. Currently is true if the device's smallest dimension is 500 dip.
* @return True if the app runs on a small device, false otherwise
*/
public boolean isSmallScreen() {
@@ -125,8 +161,8 @@ public class NavigationHelper {
}
/**
- * Whether any search-related UI components should be shown in the interface. At the moment returns false only if we
- * run as Transdroid Lite version.
+ * Whether any search-related UI components should be shown in the interface. At the moment returns false only if we run as Transdroid Lite
+ * version.
* @return True if search is enabled, false otherwise
*/
public boolean enableSearchUi() {
@@ -134,8 +170,7 @@ public class NavigationHelper {
}
/**
- * Whether any RSS-related UI components should be shown in the interface. At the moment returns false only if we
- * run as Transdroid Lite version.
+ * Whether any RSS-related UI components should be shown in the interface. At the moment returns false only if we run as Transdroid Lite version.
* @return True if search is enabled, false otherwise
*/
public boolean enableRssUi() {
@@ -143,8 +178,8 @@ public class NavigationHelper {
}
/**
- * Returns whether any seedbox-related components should be shown in the interface; specifically the option to add
- * server settings via easy seedbox-specific screens.
+ * Returns whether any seedbox-related components should be shown in the interface; specifically the option to add server settings via easy
+ * seedbox-specific screens.
* @return True if seedbox settings should be shown, false otherwise
*/
public boolean enableSeedboxes() {
@@ -153,75 +188,11 @@ public class NavigationHelper {
/**
* Whether the custom app update checker should be used to check for new app and search module versions.
- * @return True if it should be checked against transdroid.org if there are app updates (as opposed to using the
- * Play Store for updates, for example), false otherwise
+ * @return True if it should be checked against transdroid.org if there are app updates (as opposed to using the Play Store for updates, for
+ * example), false otherwise
*/
public boolean enableUpdateChecker() {
return context.getResources().getBoolean(R.bool.updatecheck_available);
}
- /**
- * Converts a string into a {@link Spannable} that displays the string in the Roboto Condensed font
- * @param string A plain text {@link String}
- * @return A {@link Spannable} that can be applied to supporting views (such as the action bar title) so that the
- * input string will be displayed using the Roboto Condensed font (if the OS has this)
- */
- public static SpannableString buildCondensedFontString(String string) {
- if (string == null) {
- return null;
- }
- SpannableString s = new SpannableString(string);
- s.setSpan(new TypefaceSpan("sans-serif-condensed"), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
- return s;
- }
-
- /**
- * Analyses a torrent http or magnet URI and tries to come up with a reasonable human-readable name.
- * @param rawTorrentUri The raw http:// or magnet: link to the torrent
- * @return A best-guess, reasonably long name for the linked torrent
- */
- public static String extractNameFromUri(Uri rawTorrentUri) {
-
- if (rawTorrentUri.getScheme() == null) {
- // Probably an incorrect URI; just return the whole thing
- return rawTorrentUri.toString();
- }
-
- if (rawTorrentUri.getScheme().equals("magnet")) {
- // Magnet links might have a dn (display name) parameter
- String dn = getQueryParameter(rawTorrentUri, "dn");
- if (dn != null && !dn.equals("")) {
- return dn;
- }
- // If not, try to return the hash that is specified as xt (exact topci)
- String xt = getQueryParameter(rawTorrentUri, "xt");
- if (xt != null && !xt.equals("")) {
- return xt;
- }
- }
-
- if (rawTorrentUri.isHierarchical()) {
- String path = rawTorrentUri.getPath();
- if (path != null) {
- if (path.contains("/")) {
- path = path.substring(path.lastIndexOf("/"));
- }
- return path;
- }
- }
-
- // No idea what to do with this; return as is
- return rawTorrentUri.toString();
- }
-
- private static String getQueryParameter(Uri uri, String parameter) {
- int start = uri.toString().indexOf(parameter + "=");
- if (start >= 0) {
- int begin = start + (parameter + "=").length();
- int end = uri.toString().indexOf("&", begin);
- return uri.toString().substring(begin, end >= 0 ? end : uri.toString().length());
- }
- return null;
- }
-
}
diff --git a/app/src/main/java/org/transdroid/core/gui/navigation/NavigationSelectionView.java b/app/src/main/java/org/transdroid/core/gui/navigation/NavigationSelectionView.java
deleted file mode 100644
index 23f9106f..00000000
--- a/app/src/main/java/org/transdroid/core/gui/navigation/NavigationSelectionView.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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 .
- */
-package org.transdroid.core.gui.navigation;
-
-import org.androidannotations.annotations.EViewGroup;
-import org.androidannotations.annotations.ViewById;
-
-import android.content.Context;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-/**
- * View that displays the user-selected server and display filter inside the action bar list navigation spinner
- * @author Eric Kok
- */
-@EViewGroup(resName="actionbar_navigation")
-public class NavigationSelectionView extends LinearLayout {
-
- @ViewById
- protected TextView filterText;
- @ViewById
- protected TextView serverText;
-
- public NavigationSelectionView(Context context) {
- super(context);
- }
-
- /**
- * Binds the names of the current connected server and selected filter to this navigation view.
- * @param currentServer The name of the server currently connected to
- * @param currentFilter The name of the filter that is currently selected
- */
- public void bind(String currentServer, String currentFilter) {
- serverText.setText(currentServer);
- filterText.setText(currentFilter);
- }
-
-}
diff --git a/app/src/main/java/org/transdroid/core/gui/navigation/RefreshableActivity.java b/app/src/main/java/org/transdroid/core/gui/navigation/RefreshableActivity.java
index 37ab45af..4fd34f50 100644
--- a/app/src/main/java/org/transdroid/core/gui/navigation/RefreshableActivity.java
+++ b/app/src/main/java/org/transdroid/core/gui/navigation/RefreshableActivity.java
@@ -16,17 +16,12 @@
*/
package org.transdroid.core.gui.navigation;
-import android.view.View;
-
/**
- * Interface to be implemented by any activity that allows its content to be refreshed; fragments can ask for
- * user-initiated refreshes.
+ * Interface to be implemented by any activity that allows its content to be refreshed; fragments can ask for user-initiated refreshes.
* @author Eric Kok
*/
public interface RefreshableActivity {
- public void refreshScreen();
-
- public void addRefreshableView(View view);
+ void refreshScreen();
}
diff --git a/app/src/main/java/org/transdroid/core/gui/navigation/SelectionManagerMode.java b/app/src/main/java/org/transdroid/core/gui/navigation/SelectionManagerMode.java
index 6520b4e2..38aae6ad 100644
--- a/app/src/main/java/org/transdroid/core/gui/navigation/SelectionManagerMode.java
+++ b/app/src/main/java/org/transdroid/core/gui/navigation/SelectionManagerMode.java
@@ -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;
*/
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
@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
.getCheckedItemPositions().keyAt(i)))))
checkedCount++;
}
- ((SelectionModificationSpinner) mode.getCustomView()).updateTitle(managedList.getContext().getResources()
+ ((SelectionModificationSpinner) mode.getCustomView()).updateTitle(themedContext.getResources()
.getQuantityString(titleTemplateResource, checkedCount, checkedCount));
}
diff --git a/app/src/main/java/org/transdroid/core/gui/navigation/SetLabelDialog.java b/app/src/main/java/org/transdroid/core/gui/navigation/SetLabelDialog.java
index 54f28962..1a949580 100644
--- a/app/src/main/java/org/transdroid/core/gui/navigation/SetLabelDialog.java
+++ b/app/src/main/java/org/transdroid/core/gui/navigation/SetLabelDialog.java
@@ -16,109 +16,80 @@
*/
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;
-import android.content.DialogInterface;
-import android.content.DialogInterface.OnClickListener;
-import android.os.Bundle;
+import android.content.Context;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.EditText;
import android.widget.ListView;
-import de.keyboardsurfer.android.widget.crouton.Crouton;
-/**
- * A dialog fragment that allows picking a label or entering a new label to set this new label to the torrent.
- * @author Eric Kok
- */
-public class SetLabelDialog extends DialogFragment {
+import com.afollestad.materialdialogs.MaterialDialog;
+import com.nispok.snackbar.Snackbar;
+import com.nispok.snackbar.SnackbarManager;
- private OnLabelPickedListener onLabelPickedListener = null;
- private List extends SimpleListItem> currentLabels = null;
+import org.transdroid.R;
- public SetLabelDialog() {
- setRetainInstance(true);
- }
+import java.util.Iterator;
+import java.util.List;
- /**
- * Sets the callback for when the user is has picked a label for the target torrent.
- * @param onLabelPickedListener The event listener to this dialog
- * @return This dialog, for method chaining
- */
- public SetLabelDialog setOnLabelPickedListener(OnLabelPickedListener onLabelPickedListener) {
- this.onLabelPickedListener = onLabelPickedListener;
- return this;
- }
+public class SetLabelDialog {
/**
- * 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
+ * A dialog fragment that allows picking a label or entering a new label to set this new label to the torrent.
+ * @param context The activity context that opens (and owns) this dialog
+ * @param onLabelPickedListener The callback when a new label has been entered or picked by the user
+ * @param currentLabels The list of labels as currently exist on the server, to present as list for easy selection
*/
- public SetLabelDialog setCurrentLabels(List currentLabels) {
+ public static void show(final Context context, final OnLabelPickedListener onLabelPickedListener, List currentLabels) {
+
// Discard the empty label in this list before storing it locally
- for (Iterator iter = currentLabels.iterator(); iter.hasNext();) {
- if (iter.next().isEmptyLabel())
+ for (Iterator iter = currentLabels.iterator(); iter.hasNext(); ) {
+ if (iter.next().isEmptyLabel()) {
iter.remove();
+ }
}
- this.currentLabels = currentLabels;
- return this;
- }
- @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)
- 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);
+ final View setLabelLayout = LayoutInflater.from(context).inflate(R.layout.dialog_setlabel, null);
+ final ListView labelsList = (ListView) setLabelLayout.findViewById(R.id.labels_list);
+ final EditText newLabelEdit = (EditText) setLabelLayout.findViewById(R.id.newlabel_edit);
+
+ final MaterialDialog dialog = new MaterialDialog.Builder(context).customView(setLabelLayout, false).positiveText(R.string.status_update)
+ .neutralText(R.string.status_label_remove).negativeText(android.R.string.cancel).callback(new MaterialDialog.ButtonCallback() {
+ @Override
+ public void onPositive(MaterialDialog dialog) {
+ // User should have provided a new label
+ if (TextUtils.isEmpty(newLabelEdit.getText())) {
+ SnackbarManager.show(Snackbar.with(context).text(R.string.error_notalabel).colorResource(R.color.red));
+ return;
+ }
+ onLabelPickedListener.onLabelPicked(newLabelEdit.getText().toString());
+ }
+
+ @Override
+ public void onNeutral(MaterialDialog dialog) {
+ onLabelPickedListener.onLabelPicked(null);
+ }
+ }).build();
+
if (currentLabels.size() == 0) {
// Hide the list (and its label) if there are no labels yet
- setlabelFrame.findViewById(R.id.pick_label).setVisibility(View.GONE);
- setlabelFrame.findViewById(R.id.line1).setVisibility(View.GONE);
- setlabelFrame.findViewById(R.id.line2).setVisibility(View.GONE);
+ setLabelLayout.findViewById(R.id.pick_label).setVisibility(View.GONE);
labelsList.setVisibility(View.GONE);
} else {
- labelsList.setAdapter(new FilterListItemAdapter(getActivity(), currentLabels));
+ labelsList.setAdapter(new FilterListItemAdapter(context, currentLabels));
labelsList.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView> parent, View view, int position, long id) {
onLabelPickedListener.onLabelPicked(((Label) labelsList.getItemAtPosition(position)).getName());
- dismiss();
+ dialog.dismiss();
}
});
}
- 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();
+
+ dialog.show();
+
}
public interface OnLabelPickedListener {
diff --git a/app/src/main/java/org/transdroid/core/gui/navigation/SetStorageLocationDialog.java b/app/src/main/java/org/transdroid/core/gui/navigation/SetStorageLocationDialog.java
index b4a3dfed..583d0622 100644
--- a/app/src/main/java/org/transdroid/core/gui/navigation/SetStorageLocationDialog.java
+++ b/app/src/main/java/org/transdroid/core/gui/navigation/SetStorageLocationDialog.java
@@ -16,73 +16,35 @@
*/
package org.transdroid.core.gui.navigation;
-import java.security.InvalidParameterException;
-
-import org.transdroid.R;
-
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.app.DialogFragment;
-import android.content.DialogInterface;
-import android.content.DialogInterface.OnClickListener;
-import android.os.Bundle;
+import android.content.Context;
+import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
-/**
- * A dialog fragment that allows changing of the storage location by editing the path text directly.
- * @author Eric Kok
- */
-public class SetStorageLocationDialog extends DialogFragment {
-
- private OnStorageLocationUpdatedListener onStorageLocationUpdatedListener = null;
- private String currentLocation = null;
+import com.afollestad.materialdialogs.MaterialDialog;
- public SetStorageLocationDialog() {
- setRetainInstance(true);
- }
+import org.transdroid.R;
- /**
- * Sets the callback for when the user is done updating the storage location.
- * @param onStorageLocationUpdatedListener The event listener to this dialog
- * @return This dialog, for method chaining
- */
- public SetStorageLocationDialog setOnStorageLocationUpdated(
- OnStorageLocationUpdatedListener onStorageLocationUpdatedListener) {
- this.onStorageLocationUpdatedListener = onStorageLocationUpdatedListener;
- return this;
- }
+public class SetStorageLocationDialog {
/**
- * Sets the current storage location that will be available to the user to edit
- * @param currentLocation The current storage location path as text
- * @return This dialog, for method chaining
+ * A dialog fragment that allows changing of the storage location by editing the path text directly.
+ * @param context The activity context that opens (and owns) this dialog
+ * @param onStorageLocationUpdatedListener The callback for when the user is done updating the storage location
+ * @param currentLocation The current storage location that will be available to the user to edit
*/
- public SetStorageLocationDialog setCurrentLocation(String currentLocation) {
- this.currentLocation = currentLocation;
- return this;
- }
-
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- if (currentLocation == null)
- throw new InvalidParameterException(
- "Please first set the current trackers text using setCurrentLocation before opening the dialog.");
- if (onStorageLocationUpdatedListener == null)
- throw new InvalidParameterException(
- "Please first set the callback listener using setOnStorageLocationUpdated before opening the dialog.");
- final View locationFrame = getActivity().getLayoutInflater().inflate(R.layout.dialog_storagelocation, null,
- false);
- final EditText locationText = (EditText) locationFrame.findViewById(R.id.location_edit);
+ public static void show(final Context context, final OnStorageLocationUpdatedListener onStorageLocationUpdatedListener, String currentLocation) {
+ View locationLayout = LayoutInflater.from(context).inflate(R.layout.dialog_storagelocation, null);
+ final EditText locationText = (EditText) locationLayout.findViewById(R.id.location_edit);
locationText.setText(currentLocation);
- return new AlertDialog.Builder(getActivity()).setView(locationFrame)
- .setPositiveButton(R.string.status_update, new OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- // User is done editing and requested to update given the text input
- onStorageLocationUpdatedListener.onStorageLocationUpdated(locationText.getText().toString());
- }
- }).setNegativeButton(android.R.string.cancel, null).show();
+ new MaterialDialog.Builder(context).customView(locationLayout, false).positiveText(R.string.status_update)
+ .negativeText(android.R.string.cancel).callback(new MaterialDialog.ButtonCallback() {
+ @Override
+ public void onPositive(MaterialDialog dialog) {
+ // User is done editing and requested to update given the text input
+ onStorageLocationUpdatedListener.onStorageLocationUpdated(locationText.getText().toString());
+ }
+ }).show();
}
public interface OnStorageLocationUpdatedListener {
diff --git a/app/src/main/java/org/transdroid/core/gui/navigation/SetTrackersDialog.java b/app/src/main/java/org/transdroid/core/gui/navigation/SetTrackersDialog.java
index 78d232dd..a33eceb7 100644
--- a/app/src/main/java/org/transdroid/core/gui/navigation/SetTrackersDialog.java
+++ b/app/src/main/java/org/transdroid/core/gui/navigation/SetTrackersDialog.java
@@ -16,74 +16,39 @@
*/
package org.transdroid.core.gui.navigation;
-import java.security.InvalidParameterException;
-import java.util.Arrays;
-import java.util.List;
-
-import org.transdroid.R;
-
-import android.app.AlertDialog;
-import android.app.Dialog;
import android.app.DialogFragment;
-import android.content.DialogInterface;
-import android.content.DialogInterface.OnClickListener;
-import android.os.Bundle;
+import android.content.Context;
+import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
-/**
- * A dialog fragment that allows changing the trackers of a torrent by editing the text directly.
- * @author Eric Kok
- */
-public class SetTrackersDialog extends DialogFragment {
+import com.afollestad.materialdialogs.MaterialDialog;
- private OnTrackersUpdatedListener onTrackersUpdatedListener = null;
- private String currentTrackers = null;
+import org.transdroid.R;
- public SetTrackersDialog() {
- setRetainInstance(true);
- }
+import java.util.Arrays;
+import java.util.List;
- /**
- * Sets the callback for when the user is done updating the trackers list.
- * @param onTrackersUpdatedListener The event listener to this dialog
- * @return This dialog, for method chaining
- */
- public SetTrackersDialog setOnTrackersUpdated(OnTrackersUpdatedListener onTrackersUpdatedListener) {
- this.onTrackersUpdatedListener = onTrackersUpdatedListener;
- return this;
- }
+public class SetTrackersDialog extends DialogFragment {
/**
- * Sets the current trackers text/list that will be available to the user to edit
- * @param currentTrackers The current trackers for the target torrent
- * @return This dialog, for method chaining
+ * A dialog fragment that allows changing the trackers of a torrent by editing the text directly.
+ * @param context The activity context that opens (and owns) this dialog
+ * @param onTrackersUpdatedListener The callback for when the user is done updating the trackers list
+ * @param currentTrackers The current trackers text/list that will be available to the user to edit
*/
- public SetTrackersDialog setCurrentTrackers(String currentTrackers) {
- this.currentTrackers = currentTrackers;
- return this;
- }
-
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- if (currentTrackers == null)
- throw new InvalidParameterException(
- "Please first set the current trackers text using setCurrentTrackers before opening the dialog.");
- if (onTrackersUpdatedListener == null)
- throw new InvalidParameterException(
- "Please first set the callback listener using setOnTrackersUpdated before opening the dialog.");
- final View trackersFrame = getActivity().getLayoutInflater().inflate(R.layout.dialog_trackers, null, false);
- final EditText trackersText = (EditText) trackersFrame.findViewById(R.id.trackers_edit);
+ public static void show(final Context context, final OnTrackersUpdatedListener onTrackersUpdatedListener, String currentTrackers) {
+ View trackersLayout = LayoutInflater.from(context).inflate(R.layout.dialog_trackers, null);
+ final EditText trackersText = (EditText) trackersLayout.findViewById(R.id.trackers_edit);
trackersText.setText(currentTrackers);
- return new AlertDialog.Builder(getActivity()).setView(trackersFrame)
- .setPositiveButton(R.string.status_update, new OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- // User is done editing and requested to update given the text input
- onTrackersUpdatedListener.onTrackersUpdated(Arrays.asList(trackersText.getText().toString()
- .split("\n")));
- }
- }).setNegativeButton(android.R.string.cancel, null).show();
+ new MaterialDialog.Builder(context).customView(trackersLayout, false).positiveText(R.string.status_update)
+ .negativeText(android.R.string.cancel).callback(new MaterialDialog.ButtonCallback() {
+ @Override
+ public void onPositive(MaterialDialog dialog) {
+ // User is done editing and requested to update given the text input
+ onTrackersUpdatedListener.onTrackersUpdated(Arrays.asList(trackersText.getText().toString().split("\n")));
+ }
+ }).show();
}
public interface OnTrackersUpdatedListener {
diff --git a/app/src/main/java/org/transdroid/core/gui/navigation/SetTransferRatesDialog.java b/app/src/main/java/org/transdroid/core/gui/navigation/SetTransferRatesDialog.java
index 95508349..c69867f7 100644
--- a/app/src/main/java/org/transdroid/core/gui/navigation/SetTransferRatesDialog.java
+++ b/app/src/main/java/org/transdroid/core/gui/navigation/SetTransferRatesDialog.java
@@ -16,93 +16,64 @@
*/
package org.transdroid.core.gui.navigation;
-import java.security.InvalidParameterException;
-
-import org.transdroid.R;
-
-import android.app.Dialog;
-import android.app.DialogFragment;
-import android.os.Bundle;
+import android.content.Context;
+import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
-import android.view.Window;
import android.widget.Button;
import android.widget.TextView;
-/**
- * A dialog fragment that allow picking of maximum download and upload transfer rates as well as the resetting of these
- * values.
- * @author Eric Kok
- */
-public class SetTransferRatesDialog extends DialogFragment {
+import com.afollestad.materialdialogs.MaterialDialog;
- private OnRatesPickedListener onRatesPickedListener = null;
- private TextView maxSpeedDown, maxSpeedUp;
+import org.transdroid.R;
- public SetTransferRatesDialog() {
- setRetainInstance(true);
- }
+public class SetTransferRatesDialog {
/**
- * Sets the callback for results in this dialog (with newly selected values or a reset).
- * @param onRatesPickedListener The event listener to this dialog
- * @return This dialog, for method chaining
+ * A dialog fragment that allow picking of maximum download and upload transfer rates as well as the resetting of these values.
+ * @param context The activity context that opens (and owns) this dialog
+ * @param onRatesPickedListener The callback for results in this dialog (with newly selected values or a reset)
*/
- public SetTransferRatesDialog setOnRatesPickedListener(OnRatesPickedListener onRatesPickedListener) {
- this.onRatesPickedListener = onRatesPickedListener;
- return this;
- }
+ public static void show(final Context context, final OnRatesPickedListener onRatesPickedListener) {
+
+ View transferRatesLayout = LayoutInflater.from(context).inflate(R.layout.dialog_transferrates, null);
+ final TextView maxSpeedDown = (TextView) transferRatesLayout.findViewById(R.id.maxspeeddown_text);
+ final TextView maxSpeedUp = (TextView) transferRatesLayout.findViewById(R.id.maxspeedup_text);
+
+ MaterialDialog dialog = new MaterialDialog.Builder(context).customView(transferRatesLayout, false).positiveText(R.string.status_update)
+ .neutralText(R.string.status_maxspeed_reset).negativeText(android.R.string.cancel).callback(new MaterialDialog.ButtonCallback() {
+ @Override
+ public void onPositive(MaterialDialog dialog) {
+ int maxDown = -1, maxUp = -1;
+ try {
+ maxDown = Integer.parseInt(maxSpeedDown.getText().toString());
+ maxUp = Integer.parseInt(maxSpeedUp.getText().toString());
+ } catch (NumberFormatException e) {
+ // Impossible as we only input via the number buttons
+ }
+ if (maxDown <= 0 || maxUp <= 0) {
+ onRatesPickedListener.onInvalidNumber();
+ return;
+ }
+ onRatesPickedListener.onRatesPicked(maxDown, maxUp);
+ }
+
+ @Override
+ public void onNeutral(MaterialDialog dialog) {
+ onRatesPickedListener.resetRates();
+ }
+ }).build();
+
+ bindButtons(dialog.getCustomView(), maxSpeedDown, R.id.down1Button, R.id.down2Button, R.id.down3Button, R.id.down4Button, R.id.down5Button,
+ R.id.down6Button, R.id.down7Button, R.id.down8Button, R.id.down9Button, R.id.down0Button);
+ bindButtons(dialog.getCustomView(), maxSpeedUp, R.id.up1Button, R.id.up2Button, R.id.up3Button, R.id.up4Button, R.id.up5Button,
+ R.id.up6Button, R.id.up7Button, R.id.up8Button, R.id.up9Button, R.id.up0Button);
+
+ dialog.show();
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- if (onRatesPickedListener == null)
- throw new InvalidParameterException(
- "Please first set the callback listener using setOnRatesPickedListener before opening the dialog.");
- final View transferRatesContent = getActivity().getLayoutInflater().inflate(R.layout.dialog_transferrates,
- null, false);
- maxSpeedDown = (TextView) transferRatesContent.findViewById(R.id.maxspeeddown_text);
- maxSpeedUp = (TextView) transferRatesContent.findViewById(R.id.maxspeedup_text);
- bindButtons(transferRatesContent, maxSpeedDown, R.id.down1Button, R.id.down2Button, R.id.down3Button,
- R.id.down4Button, R.id.down5Button, R.id.down6Button, R.id.down7Button, R.id.down8Button,
- R.id.down9Button, R.id.down0Button);
- bindButtons(transferRatesContent, maxSpeedUp, R.id.up1Button, R.id.up2Button, R.id.up3Button, R.id.up4Button,
- R.id.up5Button, R.id.up6Button, R.id.up7Button, R.id.up8Button, R.id.up9Button, R.id.up0Button);
- ((Button) transferRatesContent.findViewById(R.id.ok_button)).setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- int maxDown = -1, maxUp = -1;
- try {
- maxDown = Integer.parseInt(maxSpeedDown.getText().toString());
- maxUp = Integer.parseInt(maxSpeedUp.getText().toString());
- } catch (NumberFormatException e) {
- }
- if (maxDown <= 0 || maxUp <= 0) {
- onRatesPickedListener.onInvalidNumber();
- }
- onRatesPickedListener.onRatesPicked(maxDown, maxUp);
- dismiss();
- }
- });
- ((Button) transferRatesContent.findViewById(R.id.reset_button)).setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- onRatesPickedListener.resetRates();
- dismiss();
- }
- });
- ((Button) transferRatesContent.findViewById(R.id.cancel_button)).setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- dismiss();
- }
- });
- Dialog dialog = new Dialog(getActivity());
- dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
- dialog.setContentView(transferRatesContent);
- return dialog;
}
- private void bindButtons(View transferRatesContent, View numberView, int... buttonResource) {
+ private static void bindButtons(View transferRatesContent, View numberView, int... buttonResource) {
for (int i : buttonResource) {
// Keep the relevant number as reference in the view tag and bind the click listerner
transferRatesContent.findViewById(i).setTag(numberView);
@@ -110,14 +81,15 @@ public class SetTransferRatesDialog extends DialogFragment {
}
}
- private android.view.View.OnClickListener onNumberClicked = new android.view.View.OnClickListener() {
+ private static OnClickListener onNumberClicked = new OnClickListener() {
@Override
public void onClick(View v) {
// Append the text contents of the button itself as text to the current number (as reference in the view's
// tag)
TextView numberView = (TextView) v.getTag();
- if (numberView.getText().toString().equals(getString(R.string.status_maxspeed_novalue)))
+ if (numberView.getText().toString().equals(v.getContext().getString(R.string.status_maxspeed_novalue))) {
numberView.setText("");
+ }
numberView.setText(numberView.getText().toString() + ((Button) v).getText().toString());
}
};
diff --git a/app/src/main/java/org/transdroid/core/gui/rss/RssfeedLoader.java b/app/src/main/java/org/transdroid/core/gui/rss/RssfeedLoader.java
index b6007d58..3610cf8e 100644
--- a/app/src/main/java/org/transdroid/core/gui/rss/RssfeedLoader.java
+++ b/app/src/main/java/org/transdroid/core/gui/rss/RssfeedLoader.java
@@ -16,18 +16,18 @@
*/
package org.transdroid.core.gui.rss;
+import org.transdroid.core.app.settings.RssfeedSetting;
+import org.transdroid.core.rssparser.Channel;
+import org.transdroid.core.rssparser.Item;
+
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
-import org.transdroid.core.app.settings.RssfeedSetting;
-import org.transdroid.core.rssparser.Channel;
-import org.transdroid.core.rssparser.Item;
-
/**
- * A container class that holds RSS feed settings and, after they have been retrieved, the contents as {@link Channel},
- * the number of new items and an indication of a connection error.
+ * A container class that holds RSS feed settings and, after they have been retrieved, the contents as {@link Channel}, the number of new items and an
+ * indication of a connection error.
* @author Eric Kok
*/
public class RssfeedLoader {
@@ -45,7 +45,7 @@ public class RssfeedLoader {
this.channel = channel;
this.hasError = hasError;
if (channel == null || channel.getItems() == null || hasError) {
- hasError = true;
+ this.hasError = true;
newCount = -1;
return;
}
@@ -67,8 +67,7 @@ public class RssfeedLoader {
}
});
for (Item item : items) {
- if (item.getPubdate() == null || setting.getLastViewed() == null
- || item.getPubdate().after(setting.getLastViewed())) {
+ if (item.getPubdate() == null || setting.getLastViewed() == null || item.getPubdate().after(setting.getLastViewed())) {
newCount++;
item.setIsNew(true);
} else {
@@ -79,12 +78,12 @@ public class RssfeedLoader {
// Use the url of the last RSS item the last time the feed was viewed by the user to count new items
boolean isNew = true;
for (Item item : channel.getItems()) {
- if (item.getTheLink() != null && setting.getLastViewedItemUrl() != null
- && item.getTheLink().equals(setting.getLastViewedItemUrl())) {
+ if (item.getTheLink() != null && setting.getLastViewedItemUrl() != null && item.getTheLink().equals(setting.getLastViewedItemUrl())) {
isNew = false;
}
- if (isNew)
+ if (isNew) {
newCount++;
+ }
item.setIsNew(isNew);
}
}
diff --git a/app/src/main/java/org/transdroid/core/gui/rss/RssfeedView.java b/app/src/main/java/org/transdroid/core/gui/rss/RssfeedView.java
index 545d5ebd..3b3731fb 100644
--- a/app/src/main/java/org/transdroid/core/gui/rss/RssfeedView.java
+++ b/app/src/main/java/org/transdroid/core/gui/rss/RssfeedView.java
@@ -16,12 +16,6 @@
*/
package org.transdroid.core.gui.rss;
-import org.androidannotations.annotations.Bean;
-import org.androidannotations.annotations.EViewGroup;
-import org.androidannotations.annotations.ViewById;
-import org.transdroid.core.app.settings.RssfeedSetting;
-import org.transdroid.core.gui.navigation.NavigationHelper;
-
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
@@ -29,19 +23,26 @@ import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
+import org.androidannotations.annotations.Bean;
+import org.androidannotations.annotations.EViewGroup;
+import org.androidannotations.annotations.ViewById;
+import org.transdroid.R;
+import org.transdroid.core.app.settings.RssfeedSetting;
+import org.transdroid.core.gui.navigation.NavigationHelper;
+
/**
- * View that represents some {@link RssfeedSetting} object and displays name as well as loads a favicon for the feed's
- * site and can load how many new items are available.
+ * View that represents some {@link RssfeedSetting} object and displays name as well as loads a favicon for the feed's site and can load how many new
+ * items are available.
* @author Eric Kok
*/
-@EViewGroup(resName = "list_item_rssfeed")
+@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;
-
+
// Views
@ViewById
protected ImageView faviconImage;
@@ -61,18 +62,17 @@ public class RssfeedView extends LinearLayout {
if (rssfeedLoader.hasError() || rssfeedLoader.getChannel() != null) {
loadingProgress.setVisibility(View.GONE);
newcountText.setVisibility(View.VISIBLE);
- newcountText.setText(rssfeedLoader.hasError()? "?": Integer.toString(rssfeedLoader.getNewCount()));
+ newcountText.setText(rssfeedLoader.hasError() ? "?" : Integer.toString(rssfeedLoader.getNewCount()));
} else {
loadingProgress.setVisibility(View.VISIBLE);
newcountText.setVisibility(View.GONE);
}
-
+
// 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);
+
}
}
diff --git a/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java b/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java
index b6dd48f0..b1bc2f5a 100644
--- a/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java
+++ b/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java
@@ -16,9 +16,17 @@
*/
package org.transdroid.core.gui.rss;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import android.annotation.TargetApi;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+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;
@@ -27,25 +35,23 @@ import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.FragmentById;
import org.androidannotations.annotations.OptionsItem;
import org.androidannotations.annotations.UiThread;
+import org.androidannotations.annotations.ViewById;
import org.transdroid.R;
-import org.transdroid.core.app.settings.*;
-import org.transdroid.core.gui.*;
+import org.transdroid.core.app.settings.ApplicationSettings;
+import org.transdroid.core.app.settings.RssfeedSetting;
+import org.transdroid.core.app.settings.SystemSettings_;
+import org.transdroid.core.gui.TorrentsActivity_;
import org.transdroid.core.gui.log.Log;
import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.rssparser.Channel;
import org.transdroid.core.rssparser.RssParser;
-import android.annotation.TargetApi;
-import android.app.Activity;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import android.text.TextUtils;
-import de.keyboardsurfer.android.widget.crouton.Crouton;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
-@EActivity(resName = "activity_rssfeeds")
-public class RssfeedsActivity extends Activity {
+@EActivity(R.layout.activity_rssfeeds)
+public class RssfeedsActivity extends ActionBarActivity {
// Settings and local data
@Bean
@@ -55,26 +61,27 @@ public class RssfeedsActivity extends Activity {
protected List loaders;
// Contained feeds and items fragments
- @FragmentById(resName = "rssfeeds_fragment")
+ @FragmentById(R.id.rssfeeds_fragment)
protected RssfeedsFragment fragmentFeeds;
- @FragmentById(resName = "rssitems_fragment")
+ @FragmentById(R.id.rssitems_fragment)
protected RssitemsFragment fragmentItems;
+ @ViewById
+ protected Toolbar rssfeedsToolbar;
@Override
public void onCreate(Bundle savedInstanceState) {
// Set the theme according to the user preference
if (SystemSettings_.getInstance_(this).useDarkTheme()) {
setTheme(R.style.TransdroidTheme_Dark);
- getActionBar().setIcon(R.drawable.ic_activity_torrents);
}
super.onCreate(savedInstanceState);
}
@AfterViews
protected void init() {
- // Simple action bar with up button and correct title font
- getActionBar().setDisplayHomeAsUpEnabled(true);
- getActionBar().setTitle(NavigationHelper.buildCondensedFontString(getString(R.string.rss_feeds)));
+ setSupportActionBar(rssfeedsToolbar);
+ getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(getString(R.string.rss_feeds)));
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@@ -93,7 +100,7 @@ public class RssfeedsActivity extends Activity {
* Reload the RSS feed settings and start loading all the feeds. To be called from contained fragments.
*/
public void refreshFeeds() {
- loaders = new ArrayList();
+ loaders = new ArrayList<>();
// For each RSS feed setting the user created, start a loader that retrieved the RSS feed (via a background
// thread) and, on success, determines the new items in the feed
for (RssfeedSetting setting : applicationSettings.getRssfeedSettings()) {
@@ -124,8 +131,7 @@ public class RssfeedsActivity extends Activity {
}
/**
- * Stores the retrieved RSS feed content channel into the loader and updates the RSS feed in the feeds list
- * fragment.
+ * Stores the retrieved RSS feed content channel into the loader and updates the RSS feed in the feeds list fragment.
* @param loader The RSS feed loader that was executed
* @param channel The data that was retrieved, or null if it could not be parsed
* @param hasError True if a connection error occurred in the loading of the feed; false otherwise
@@ -137,12 +143,10 @@ public class RssfeedsActivity extends Activity {
}
/**
- * Opens an RSS feed in the dedicated fragment (if there was space in the UI) or a new {@link RssitemsActivity}.
- * Optionally this also registers in the user preferences that the feed was now viewed, so that in the future the
- * new items can be properly marked.
+ * Opens an RSS feed in the dedicated fragment (if there was space in the UI) or a new {@link RssitemsActivity}. Optionally this also registers in
+ * the user preferences that the feed was now viewed, so that in the future the new items can be properly marked.
* @param loader The RSS feed loader (with settings and the loaded content channel) to show
- * @param markAsViewedNow True if the user settings should be updated to reflect this feed's last viewed date; false
- * otherwise
+ * @param markAsViewedNow True if the user settings should be updated to reflect this feed's last viewed date; false otherwise
*/
public void openRssfeed(RssfeedLoader loader, boolean markAsViewedNow) {
@@ -153,8 +157,9 @@ public class RssfeedsActivity extends Activity {
// be loaded until the RSS feeds screen in opened again.
if (!loader.hasError() && loader.getChannel() != null && markAsViewedNow) {
String lastViewedItemUrl = null;
- if (loader.getChannel().getItems() != null && loader.getChannel().getItems().size() > 0)
+ if (loader.getChannel().getItems() != null && loader.getChannel().getItems().size() > 0) {
lastViewedItemUrl = loader.getChannel().getItems().get(0).getTheLink();
+ }
applicationSettings.setRssfeedLastViewer(loader.getSetting().getOrder(), new Date(), lastViewedItemUrl);
}
fragmentItems.update(loader.getChannel(), loader.hasError());
@@ -163,11 +168,11 @@ public class RssfeedsActivity extends Activity {
// 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.red));
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.red));
return;
}
@@ -175,14 +180,16 @@ public class RssfeedsActivity extends Activity {
// be loaded until the RSS feeds screen in opened again
if (markAsViewedNow) {
String lastViewedItemUrl = null;
- if (loader.getChannel().getItems() != null && loader.getChannel().getItems().size() > 0)
+ if (loader.getChannel().getItems() != null && loader.getChannel().getItems().size() > 0) {
lastViewedItemUrl = loader.getChannel().getItems().get(0).getTheLink();
+ }
applicationSettings.setRssfeedLastViewer(loader.getSetting().getOrder(), new Date(), lastViewedItemUrl);
}
String name = loader.getChannel().getTitle();
- if (TextUtils.isEmpty(name))
+ if (TextUtils.isEmpty(name)) {
name = loader.getSetting().getName();
+ }
if (TextUtils.isEmpty(name) && !TextUtils.isEmpty(loader.getSetting().getUrl())) {
name = Uri.parse(loader.getSetting().getUrl()).getHost();
}
diff --git a/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsAdapter.java b/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsAdapter.java
index dab9e60a..15f514ff 100644
--- a/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsAdapter.java
+++ b/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsAdapter.java
@@ -16,16 +16,16 @@
*/
package org.transdroid.core.gui.rss;
-import java.util.List;
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext;
import org.transdroid.core.app.settings.RssfeedSetting;
-import android.content.Context;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.BaseAdapter;
+import java.util.List;
/**
* Adapter that contains a list of {@link RssfeedSetting}s, each with associated loaded RSS feed {@link org.transdroid.core.rssparser.Channel}.
@@ -33,9 +33,9 @@ import android.widget.BaseAdapter;
*/
@EBean
public class RssfeedsAdapter extends BaseAdapter {
-
+
private List loaders = null;
-
+
@RootContext
protected Context context;
@@ -47,23 +47,25 @@ public class RssfeedsAdapter extends BaseAdapter {
this.loaders = loaders;
notifyDataSetChanged();
}
-
+
@Override
public boolean hasStableIds() {
return true;
}
-
+
@Override
public int getCount() {
- if (loaders == null)
+ if (loaders == null) {
return 0;
+ }
return loaders.size();
}
@Override
public RssfeedLoader getItem(int position) {
- if (loaders == null)
+ if (loaders == null) {
return null;
+ }
return loaders.get(position);
}
diff --git a/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsFragment.java b/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsFragment.java
index bb43609b..aa205a56 100644
--- a/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsFragment.java
+++ b/app/src/main/java/org/transdroid/core/gui/rss/RssfeedsFragment.java
@@ -16,7 +16,12 @@
*/
package org.transdroid.core.gui.rss;
-import java.util.List;
+import android.app.Fragment;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ListView;
+import android.widget.TextView;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Bean;
@@ -26,25 +31,20 @@ import org.androidannotations.annotations.OptionsItem;
import org.androidannotations.annotations.OptionsMenu;
import org.androidannotations.annotations.ViewById;
import org.transdroid.R;
-import org.transdroid.core.gui.settings.*;
+import org.transdroid.core.gui.settings.MainSettingsActivity_;
-import android.app.Fragment;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.widget.ListView;
-import android.widget.TextView;
+import java.util.List;
/**
* Fragment lists the RSS feeds the user wants to monitor and, if room, the list of items in a feed in a right pane.
* @author Eric Kok
*/
-@EFragment(resName = "fragment_rssfeeds")
-@OptionsMenu(resName = "fragment_rssfeeds")
+@EFragment(R.layout.fragment_rssfeeds)
+@OptionsMenu(R.menu.fragment_rssfeeds)
public class RssfeedsFragment extends Fragment {
// Views
- @ViewById(resName = "rssfeeds_list")
+ @ViewById(R.id.rssfeeds_list)
protected ListView feedsList;
@Bean
protected RssfeedsAdapter rssfeedsAdapter;
@@ -59,39 +59,39 @@ public class RssfeedsFragment extends Fragment {
public void update(List loaders) {
rssfeedsAdapter.update(loaders);
boolean hasSettings = !(loaders == null || loaders.size() == 0);
- feedsList.setVisibility(hasSettings ? View.VISIBLE: View.GONE);
- nosettingsText.setVisibility(hasSettings ? View.GONE: View.VISIBLE);
+ feedsList.setVisibility(hasSettings ? View.VISIBLE : View.GONE);
+ nosettingsText.setVisibility(hasSettings ? View.GONE : View.VISIBLE);
getActivity().invalidateOptionsMenu();
}
@Override
public void onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
- menu.findItem(R.id.action_settings).setShowAsAction(
- rssfeedsAdapter == null || rssfeedsAdapter.getCount() == 0 ? MenuItem.SHOW_AS_ACTION_ALWAYS
- : MenuItem.SHOW_AS_ACTION_NEVER);
+ boolean hasFeeds = rssfeedsAdapter != null && rssfeedsAdapter.getCount() > 0;
+ menu.findItem(R.id.action_refresh).setVisible(hasFeeds);
+ menu.findItem(R.id.action_settings).setShowAsAction(!hasFeeds ? MenuItem.SHOW_AS_ACTION_ALWAYS : MenuItem.SHOW_AS_ACTION_NEVER);
}
- @OptionsItem(resName = "action_settings")
+ @OptionsItem(R.id.action_settings)
protected void openSettings() {
MainSettingsActivity_.intent(getActivity()).start();
}
- @OptionsItem(resName = "action_refresh")
+ @OptionsItem(R.id.action_refresh)
protected void refreshScreen() {
- ((RssfeedsActivity)getActivity()).refreshFeeds();
+ ((RssfeedsActivity) getActivity()).refreshFeeds();
}
- @ItemClick(resName = "rssfeeds_list")
+ @ItemClick(R.id.rssfeeds_list)
protected void onFeedClicked(RssfeedLoader loader) {
- ((RssfeedsActivity)getActivity()).openRssfeed(loader, true);
+ ((RssfeedsActivity) getActivity()).openRssfeed(loader, true);
}
-
+
/**
* Notifies the contained list of RSS feeds that the underlying data has been changed.
*/
public void notifyDataSetChanged() {
rssfeedsAdapter.notifyDataSetChanged();
}
-
+
}
diff --git a/app/src/main/java/org/transdroid/core/gui/rss/RssitemStatusLayout.java b/app/src/main/java/org/transdroid/core/gui/rss/RssitemStatusLayout.java
index 453cf7de..08f1c0fe 100644
--- a/app/src/main/java/org/transdroid/core/gui/rss/RssitemStatusLayout.java
+++ b/app/src/main/java/org/transdroid/core/gui/rss/RssitemStatusLayout.java
@@ -23,20 +23,21 @@ import android.graphics.RectF;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
+import org.transdroid.R;
+
/**
- * A relative layout that that is checkable (to be used in a contextual action bar) and shows a coloured bar in the far
- * left indicating the view status, that is, if the item is new to the user or was viewed earlier.
+ * A relative layout that that is checkable (to be used in a contextual action bar) and shows a coloured bar in the far left indicating the view
+ * status, that is, if the item is new to the user or was viewed earlier.
* @author Eric Kok
*/
public class RssitemStatusLayout extends RelativeLayout {
private final float scale = getContext().getResources().getDisplayMetrics().density;
private final int WIDTH = (int) (6 * scale + 0.5f);
-
- private Boolean isNew = null;
private final Paint oldPaint = new Paint();
private final Paint newPaint = new Paint();
private final RectF fullRect = new RectF();
+ private Boolean isNew = null;
public RssitemStatusLayout(Context context) {
super(context);
@@ -51,8 +52,8 @@ public class RssitemStatusLayout extends RelativeLayout {
}
private void initPaints() {
- oldPaint.setColor(0xFF9E9E9E); // Grey
- newPaint.setColor(0xFF8ACC12); // Normal green
+ oldPaint.setColor(getResources().getColor(R.color.file_off)); // Grey
+ newPaint.setColor(getResources().getColor(R.color.file_normal)); // Normal green
}
public void setIsNew(Boolean isNew) {
@@ -72,7 +73,7 @@ public class RssitemStatusLayout extends RelativeLayout {
return;
}
- canvas.drawRect(fullRect, isNew? newPaint: oldPaint);
+ canvas.drawRect(fullRect, isNew ? newPaint : oldPaint);
}
diff --git a/app/src/main/java/org/transdroid/core/gui/rss/RssitemView.java b/app/src/main/java/org/transdroid/core/gui/rss/RssitemView.java
index ba121a0d..2c4a43c3 100644
--- a/app/src/main/java/org/transdroid/core/gui/rss/RssitemView.java
+++ b/app/src/main/java/org/transdroid/core/gui/rss/RssitemView.java
@@ -16,19 +16,20 @@
*/
package org.transdroid.core.gui.rss;
-import org.androidannotations.annotations.EViewGroup;
-import org.androidannotations.annotations.ViewById;
-import org.transdroid.core.rssparser.Item;
-
import android.content.Context;
import android.text.format.DateUtils;
import android.widget.TextView;
+import org.androidannotations.annotations.EViewGroup;
+import org.androidannotations.annotations.ViewById;
+import org.transdroid.R;
+import org.transdroid.core.rssparser.Item;
+
/**
* View that represents some {@link Item} object, which is a single item in some RSS feed.
* @author Eric Kok
*/
-@EViewGroup(resName = "list_item_rssitem")
+@EViewGroup(R.layout.list_item_rssitem)
public class RssitemView extends RssitemStatusLayout {
// Views
@@ -42,9 +43,9 @@ public class RssitemView extends RssitemStatusLayout {
public void bind(Item rssitem) {
nameText.setText(rssitem.getTitle());
- dateText.setText(rssitem.getPubdate() == null ? "" : DateUtils.getRelativeDateTimeString(getContext(), rssitem
- .getPubdate().getTime(), DateUtils.SECOND_IN_MILLIS, DateUtils.WEEK_IN_MILLIS,
- DateUtils.FORMAT_ABBREV_MONTH));
+ dateText.setText(rssitem.getPubdate() == null ? "" : DateUtils
+ .getRelativeDateTimeString(getContext(), rssitem.getPubdate().getTime(), DateUtils.SECOND_IN_MILLIS, DateUtils.WEEK_IN_MILLIS,
+ DateUtils.FORMAT_ABBREV_MONTH));
setIsNew(rssitem.isNew());
}
diff --git a/app/src/main/java/org/transdroid/core/gui/rss/RssitemsActivity.java b/app/src/main/java/org/transdroid/core/gui/rss/RssitemsActivity.java
index 50c69460..7408b7e6 100644
--- a/app/src/main/java/org/transdroid/core/gui/rss/RssitemsActivity.java
+++ b/app/src/main/java/org/transdroid/core/gui/rss/RssitemsActivity.java
@@ -16,40 +16,43 @@
*/
package org.transdroid.core.gui.rss;
+import android.annotation.TargetApi;
+import android.content.Intent;
+import android.os.Build;
+import android.os.Bundle;
+import android.support.v7.app.ActionBarActivity;
+import android.support.v7.widget.Toolbar;
+
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.Extra;
import org.androidannotations.annotations.FragmentById;
import org.androidannotations.annotations.OptionsItem;
+import org.androidannotations.annotations.ViewById;
import org.transdroid.R;
-import org.transdroid.core.app.settings.*;
-import org.transdroid.core.gui.*;
+import org.transdroid.core.app.settings.SystemSettings_;
+import org.transdroid.core.gui.TorrentsActivity_;
import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.rssparser.Channel;
-import android.annotation.TargetApi;
-import android.app.Activity;
-import android.content.Intent;
-import android.os.Build;
-import android.os.Bundle;
-
-@EActivity(resName = "activity_rssitems")
-public class RssitemsActivity extends Activity {
+@EActivity(R.layout.activity_rssitems)
+public class RssitemsActivity extends ActionBarActivity {
@Extra
protected Channel rssfeed = null;
@Extra
protected String rssfeedName;
- @FragmentById(resName = "rssitems_fragment")
+ @FragmentById(R.id.rssitems_fragment)
protected RssitemsFragment fragmentItems;
+ @ViewById
+ protected Toolbar rssfeedsToolbar;
@Override
public void onCreate(Bundle savedInstanceState) {
// Set the theme according to the user preference
if (SystemSettings_.getInstance_(this).useDarkTheme()) {
setTheme(R.style.TransdroidTheme_Dark);
- getActionBar().setIcon(R.drawable.ic_activity_torrents);
}
super.onCreate(savedInstanceState);
}
@@ -63,9 +66,9 @@ public class RssitemsActivity extends Activity {
return;
}
- // Simple action bar with up button and torrent name as title
- getActionBar().setDisplayHomeAsUpEnabled(true);
- getActionBar().setTitle(NavigationHelper.buildCondensedFontString(rssfeedName));
+ setSupportActionBar(rssfeedsToolbar);
+ getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(rssfeedName));
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// Get the intent extras and show them to the already loaded fragment
fragmentItems.update(rssfeed, false);
diff --git a/app/src/main/java/org/transdroid/core/gui/rss/RssitemsAdapter.java b/app/src/main/java/org/transdroid/core/gui/rss/RssitemsAdapter.java
index 7ebd0c7d..94f73a2d 100644
--- a/app/src/main/java/org/transdroid/core/gui/rss/RssitemsAdapter.java
+++ b/app/src/main/java/org/transdroid/core/gui/rss/RssitemsAdapter.java
@@ -16,16 +16,16 @@
*/
package org.transdroid.core.gui.rss;
-import org.androidannotations.annotations.EBean;
-import org.androidannotations.annotations.RootContext;
-import org.transdroid.core.rssparser.Channel;
-import org.transdroid.core.rssparser.Item;
-
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
+import org.androidannotations.annotations.EBean;
+import org.androidannotations.annotations.RootContext;
+import org.transdroid.core.rssparser.Channel;
+import org.transdroid.core.rssparser.Item;
+
/**
* Adapter that contains a list of {@link Item}s in an RSS feed.
* @author Eric Kok
@@ -34,7 +34,7 @@ import android.widget.BaseAdapter;
public class RssitemsAdapter extends BaseAdapter {
private Channel rssfeed = null;
-
+
@RootContext
protected Context context;
@@ -46,23 +46,25 @@ public class RssitemsAdapter extends BaseAdapter {
this.rssfeed = rssfeed;
notifyDataSetChanged();
}
-
+
@Override
public boolean hasStableIds() {
return true;
}
-
+
@Override
public int getCount() {
- if (rssfeed == null)
+ if (rssfeed == null) {
return 0;
+ }
return rssfeed.getItems().size();
}
@Override
public Item getItem(int position) {
- if (rssfeed == null)
+ if (rssfeed == null) {
return null;
+ }
return rssfeed.getItems().get(position);
}
diff --git a/app/src/main/java/org/transdroid/core/gui/rss/RssitemsFragment.java b/app/src/main/java/org/transdroid/core/gui/rss/RssitemsFragment.java
index 962c5cc7..39d40fa8 100644
--- a/app/src/main/java/org/transdroid/core/gui/rss/RssitemsFragment.java
+++ b/app/src/main/java/org/transdroid/core/gui/rss/RssitemsFragment.java
@@ -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;
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;
@@ -44,23 +48,20 @@ import org.androidannotations.annotations.InstanceState;
import org.androidannotations.annotations.ItemClick;
import org.androidannotations.annotations.ViewById;
import org.transdroid.R;
-import org.transdroid.core.gui.*;
-import org.transdroid.core.gui.navigation.NavigationHelper;
+import org.transdroid.core.gui.TorrentsActivity_;
import org.transdroid.core.gui.navigation.SelectionManagerMode;
-import org.transdroid.core.gui.search.*;
+import org.transdroid.core.gui.search.SearchActivity_;
import org.transdroid.core.rssparser.Channel;
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
*/
-@EFragment(resName = "fragment_rssitems")
+@EFragment(R.layout.fragment_rssitems)
public class RssitemsFragment extends Fragment {
@InstanceState
@@ -69,7 +70,7 @@ public class RssitemsFragment extends Fragment {
protected boolean hasError = false;
// Views
- @ViewById(resName = "rssitems_list")
+ @ViewById(R.id.rssitems_list)
protected ListView rssitemsList;
private MultiChoiceModeListener onItemsSelected = new MultiChoiceModeListener() {
@@ -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;
}
@@ -92,7 +94,7 @@ public class RssitemsFragment extends Fragment {
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
// Get checked torrents
- List- checked = new ArrayList
- ();
+ List
- checked = new ArrayList<>();
for (int i = 0; i < rssitemsList.getCheckedItemPositions().size(); i++) {
if (rssitemsList.getCheckedItemPositions().valueAt(i)) {
checked.add(rssitemsAdapter.getItem(rssitemsList.getCheckedItemPositions().keyAt(i)));
@@ -126,8 +128,7 @@ public class RssitemsFragment extends Fragment {
}
names.append(checked.get(f).getTitle());
}
- ClipboardManager clipboardManager =
- (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
+ ClipboardManager clipboardManager = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
clipboardManager.setPrimaryClip(ClipData.newPlainText("Transdroid", names.toString()));
mode.finish();
return true;
@@ -146,18 +147,15 @@ public class RssitemsFragment extends Fragment {
return new AlertDialog.Builder(getActivity()).setMessage(first.getDescription())
.setPositiveButton(R.string.action_close, null).create();
}
-
- ;
}.show(getFragmentManager(), "RssItemDescription");
} else if (itemId == R.id.action_openwebsite) {
// Open the browser to show the website contained in the item's link tag
- Toast.makeText(getActivity(), getString(R.string.search_openingdetails, first.getTitle()),
- Toast.LENGTH_LONG).show();
+ Toast.makeText(getActivity(), getString(R.string.search_openingdetails, first.getTitle()), Toast.LENGTH_LONG).show();
if (!TextUtils.isEmpty(first.getLink())) {
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.red));
}
} else if (itemId == R.id.action_useassearch) {
// Use the RSS item title to start a new search (mimicking the search manager style)
@@ -201,8 +199,7 @@ public class RssitemsFragment extends Fragment {
/**
* Update the shown RSS items in the list.
* @param channel The loaded RSS content channel object
- * @param hasError True if there were errors in loading the channel, in which case an error text is shown; false
- * otherwise
+ * @param hasError True if there were errors in loading the channel, in which case an error text is shown; false otherwise
*/
public void update(Channel channel, boolean hasError) {
rssitemsAdapter.update(channel);
diff --git a/app/src/main/java/org/transdroid/core/gui/search/BarcodeHelper.java b/app/src/main/java/org/transdroid/core/gui/search/BarcodeHelper.java
index 7aaf6298..9113bf2f 100644
--- a/app/src/main/java/org/transdroid/core/gui/search/BarcodeHelper.java
+++ b/app/src/main/java/org/transdroid/core/gui/search/BarcodeHelper.java
@@ -106,8 +106,8 @@ public class BarcodeHelper {
* can be constructed for it
*/
public static String handleScanResult(int resultCode, Intent data, boolean supportsSearch) {
- String contents = data != null? data.getStringExtra("SCAN_RESULT"): null;
- String formatName = data != null? data.getStringExtra("SCAN_RESULT_FORMAT"): null;
+ String contents = data != null ? data.getStringExtra("SCAN_RESULT") : null;
+ String formatName = data != null ? data.getStringExtra("SCAN_RESULT_FORMAT") : null;
if (formatName != null && formatName.equals("QR_CODE")) {
// Scanned barcode was a QR code: return the contents directly
return contents;
diff --git a/app/src/main/java/org/transdroid/core/gui/search/SearchActivity.java b/app/src/main/java/org/transdroid/core/gui/search/SearchActivity.java
index 87773171..0a065933 100644
--- a/app/src/main/java/org/transdroid/core/gui/search/SearchActivity.java
+++ b/app/src/main/java/org/transdroid/core/gui/search/SearchActivity.java
@@ -17,15 +17,15 @@
package org.transdroid.core.gui.search;
import android.annotation.TargetApi;
-import android.app.ActionBar;
-import android.app.ActionBar.OnNavigationListener;
-import android.app.Activity;
import android.app.SearchManager;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
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;
@@ -46,23 +46,26 @@ import org.androidannotations.annotations.ViewById;
import org.transdroid.R;
import org.transdroid.core.app.search.SearchHelper;
import org.transdroid.core.app.search.SearchSite;
-import org.transdroid.core.app.settings.*;
-import org.transdroid.core.gui.*;
+import org.transdroid.core.app.settings.ApplicationSettings;
+import org.transdroid.core.app.settings.SystemSettings_;
+import org.transdroid.core.app.settings.WebsearchSetting;
+import org.transdroid.core.gui.TorrentsActivity_;
import org.transdroid.core.gui.navigation.NavigationHelper;
import java.util.List;
/**
- * An activity that shows search results to the user (after a query was supplied by the standard Android search manager)
- * and either shows the list of search sites on the left (e.g. on tablets) or allows switching between search sites via
- * the action bar spinner.
+ * An activity that shows search results to the user (after a query was supplied by the standard Android search manager) and either shows the list of
+ * search sites on the left (e.g. on tablets) or allows switching between search sites via the action bar spinner.
* @author Eric Kok
*/
-@EActivity(resName = "activity_search")
-@OptionsMenu(resName = "activity_search")
-public class SearchActivity extends Activity implements OnNavigationListener {
+@EActivity(R.layout.activity_search)
+@OptionsMenu(R.menu.activity_search)
+public class SearchActivity extends ActionBarActivity implements ActionBar.OnNavigationListener {
- @FragmentById(resName = "searchresults_fragment")
+ @ViewById
+ protected Toolbar searchToolbar;
+ @FragmentById(R.id.searchresults_fragment)
protected SearchResultsFragment fragmentResults;
@ViewById
protected ListView searchsitesList;
@@ -77,8 +80,7 @@ public class SearchActivity extends Activity implements OnNavigationListener {
@SystemService
protected SearchManager searchManager;
private MenuItem searchMenu = null;
- private SearchRecentSuggestions suggestions =
- new SearchRecentSuggestions(this, SearchHistoryProvider.AUTHORITY, SearchHistoryProvider.MODE);
+ private SearchRecentSuggestions suggestions = new SearchRecentSuggestions(this, SearchHistoryProvider.AUTHORITY, SearchHistoryProvider.MODE);
private List
searchSites;
private SearchSetting lastUsedSite;
@@ -97,7 +99,6 @@ public class SearchActivity extends Activity implements OnNavigationListener {
// Set the theme according to the user preference
if (SystemSettings_.getInstance_(this).useDarkTheme()) {
setTheme(R.style.TransdroidTheme_Dark);
- getActionBar().setIcon(R.drawable.ic_activity_torrents);
}
super.onCreate(savedInstanceState);
}
@@ -127,7 +128,8 @@ public class SearchActivity extends Activity implements OnNavigationListener {
}
// Allow site selection via list (on large screens) or action bar spinner
- getActionBar().setDisplayHomeAsUpEnabled(true);
+ setSupportActionBar(searchToolbar);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
if (searchsitesList != null) {
// The current layout has a dedicated list view to select the search site
SearchSitesAdapter searchSitesAdapter = SearchSitesAdapter_.getInstance_(this);
@@ -140,12 +142,12 @@ public class SearchActivity extends Activity implements OnNavigationListener {
}
} else {
// Use the action bar spinner to select sites
- getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
- getActionBar().setDisplayShowTitleEnabled(false);
- getActionBar().setListNavigationCallbacks(new SearchSettingsDropDownAdapter(this, searchSites), this);
+ getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
+ getSupportActionBar().setDisplayShowTitleEnabled(false);
+ getSupportActionBar().setListNavigationCallbacks(new SearchSettingsDropDownAdapter(searchToolbar.getContext(), searchSites), this);
// Select the last used site; this also starts the search!
if (lastUsedPosition >= 0) {
- getActionBar().setSelectedNavigationItem(lastUsedPosition);
+ getSupportActionBar().setSelectedNavigationItem(lastUsedPosition);
}
}
@@ -157,7 +159,7 @@ public class SearchActivity extends Activity implements OnNavigationListener {
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);
@@ -253,7 +255,7 @@ public class SearchActivity extends Activity implements OnNavigationListener {
}
- @OptionsItem(resName = "action_refresh")
+ @OptionsItem(R.id.action_refresh)
protected void refreshSearch() {
if (searchMenu != null) {
@@ -265,8 +267,7 @@ public class SearchActivity extends Activity implements OnNavigationListener {
// Start a browser page directly to the requested search results
WebsearchSetting websearch = (WebsearchSetting) lastUsedSite;
- startActivity(
- new Intent(Intent.ACTION_VIEW, Uri.parse(websearch.getBaseUrl().replace("%s", lastUsedQuery))));
+ startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(websearch.getBaseUrl().replace("%s", lastUsedQuery))));
finish();
} else if (lastUsedSite instanceof SearchSite) {
@@ -274,15 +275,15 @@ public class SearchActivity extends Activity implements OnNavigationListener {
// Save the search site currently used to search for future usage
applicationSettings.setLastUsedSearchSite(lastUsedSite);
// Update the activity title (only shown on large devices)
- getActionBar().setTitle(NavigationHelper.buildCondensedFontString(
- getString(R.string.search_queryonsite, lastUsedQuery, lastUsedSite.getName())));
+ getSupportActionBar().setTitle(
+ NavigationHelper.buildCondensedFontString(getString(R.string.search_queryonsite, lastUsedQuery, lastUsedSite.getName())));
// Ask the results fragment to start a search for the specified query
fragmentResults.startSearch(lastUsedQuery, (SearchSite) lastUsedSite);
}
}
- @OptionsItem(resName = "action_downloadsearch")
+ @OptionsItem(R.id.action_downloadsearch)
protected void downloadSearchModule() {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.transdroid.org/latest-search")));
}
diff --git a/app/src/main/java/org/transdroid/core/gui/search/SearchHistoryProvider.java b/app/src/main/java/org/transdroid/core/gui/search/SearchHistoryProvider.java
index 930472df..b3c6edb5 100644
--- a/app/src/main/java/org/transdroid/core/gui/search/SearchHistoryProvider.java
+++ b/app/src/main/java/org/transdroid/core/gui/search/SearchHistoryProvider.java
@@ -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() {
diff --git a/app/src/main/java/org/transdroid/core/gui/search/SearchResultsAdapter.java b/app/src/main/java/org/transdroid/core/gui/search/SearchResultsAdapter.java
index ce837c61..1932e29c 100644
--- a/app/src/main/java/org/transdroid/core/gui/search/SearchResultsAdapter.java
+++ b/app/src/main/java/org/transdroid/core/gui/search/SearchResultsAdapter.java
@@ -16,16 +16,16 @@
*/
package org.transdroid.core.gui.search;
-import java.util.List;
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext;
import org.transdroid.core.app.search.SearchResult;
-import android.content.Context;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.BaseAdapter;
+import java.util.List;
/**
* Adapter that contains a list of {@link SearchResult}s.
@@ -41,7 +41,7 @@ public class SearchResultsAdapter extends BaseAdapter {
/**
* Allows updating the search results, replacing the old data
- * @param newRssfeeds The new list of search results
+ * @param results The new list of search results
*/
public void update(List results) {
this.results = results;
@@ -55,15 +55,17 @@ public class SearchResultsAdapter extends BaseAdapter {
@Override
public int getCount() {
- if (results == null)
+ if (results == null) {
return 0;
+ }
return results.size();
}
@Override
public SearchResult getItem(int position) {
- if (results == null)
+ if (results == null) {
return null;
+ }
return results.get(position);
}
diff --git a/app/src/main/java/org/transdroid/core/gui/search/SearchResultsFragment.java b/app/src/main/java/org/transdroid/core/gui/search/SearchResultsFragment.java
index c58953dc..0f119b35 100644
--- a/app/src/main/java/org/transdroid/core/gui/search/SearchResultsFragment.java
+++ b/app/src/main/java/org/transdroid/core/gui/search/SearchResultsFragment.java
@@ -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;
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;
@@ -42,20 +47,19 @@ import org.transdroid.core.app.search.SearchHelper;
import org.transdroid.core.app.search.SearchHelper.SearchSortOrder;
import org.transdroid.core.app.search.SearchResult;
import org.transdroid.core.app.search.SearchSite;
-import org.transdroid.core.app.settings.*;
-import org.transdroid.core.gui.*;
-import org.transdroid.core.gui.navigation.*;
+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.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
*/
-@EFragment(resName = "fragment_searchresults")
+@EFragment(R.layout.fragment_searchresults)
public class SearchResultsFragment extends Fragment {
@InstanceState
@@ -66,80 +70,8 @@ public class SearchResultsFragment extends Fragment {
protected SearchHelper searchHelper;
// Views
- @ViewById(resName = "searchresults_list")
+ @ViewById(R.id.searchresults_list)
protected ListView resultsList;
- private MultiChoiceModeListener onItemsSelected = new MultiChoiceModeListener() {
-
- SelectionManagerMode selectionManagerMode;
-
- @Override
- 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);
- selectionManagerMode.onCreateActionMode(mode, menu);
- return true;
- }
-
- @Override
- public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
- return selectionManagerMode.onPrepareActionMode(mode, menu);
- }
-
- public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
-
- // Get checked torrents
- List checked = new ArrayList();
- for (int i = 0; i < resultsList.getCheckedItemPositions().size(); i++) {
- if (resultsList.getCheckedItemPositions().valueAt(i)) {
- checked.add(resultsAdapter.getItem(resultsList.getCheckedItemPositions().keyAt(i)));
- }
- }
-
- int itemId = item.getItemId();
- if (itemId == R.id.action_addall) {
- // Start an Intent that adds multiple items at once, by supplying the urls and titles as string array
- // extras and setting the Intent action to ADD_MULTIPLE
- Intent intent = new Intent("org.transdroid.ADD_MULTIPLE");
- String[] urls = new String[checked.size()];
- String[] titles = new String[checked.size()];
- for (int i = 0; i < checked.size(); i++) {
- urls[i] = checked.get(i).getTorrentUrl();
- titles[i] = checked.get(i).getName();
- }
- intent.putExtra("TORRENT_URLS", urls);
- intent.putExtra("TORRENT_TITLES", titles);
- if (resultsSource != null) {
- intent.putExtra("PRIVATE_SOURCE", resultsSource);
- }
- startActivity(intent);
- mode.finish();
- return true;
- } else if (itemId == R.id.action_showdetails) {
- SearchResult first = checked.get(0);
- // Open the torrent's web page in the browser
- if (checked.size() > 1) {
- Toast.makeText(getActivity(), getString(R.string.search_openingdetails, first.getName()),
- Toast.LENGTH_LONG).show();
- }
- startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(first.getDetailsUrl())));
- return true;
- } else {
- return false;
- }
- }
-
- @Override
- public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) {
- selectionManagerMode.onItemCheckedStateChanged(mode, position, id, checked);
- }
-
- @Override
- public void onDestroyActionMode(ActionMode mode) {
- selectionManagerMode.onDestroyActionMode(mode);
- }
-
- };
@Bean
protected SearchResultsAdapter resultsAdapter;
@ViewById
@@ -196,10 +128,10 @@ public class SearchResultsFragment extends Fragment {
emptyText.setVisibility(View.GONE);
}
- @ItemClick(resName = "searchresults_list")
+ @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.red));
return;
}
// Don't broadcast this intent; we can safely assume this is intended for Transdroid only
@@ -212,4 +144,77 @@ public class SearchResultsFragment extends Fragment {
startActivity(i);
}
+ private MultiChoiceModeListener onItemsSelected = new MultiChoiceModeListener() {
+
+ SelectionManagerMode selectionManagerMode;
+
+ @Override
+ 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);
+ Context themedContext = ((ActionBarActivity) getActivity()).getSupportActionBar().getThemedContext();
+ selectionManagerMode = new SelectionManagerMode(themedContext, resultsList, R.plurals.search_resutlsselected);
+ selectionManagerMode.onCreateActionMode(mode, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
+ return selectionManagerMode.onPrepareActionMode(mode, menu);
+ }
+
+ public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
+
+ // Get checked torrents
+ List checked = new ArrayList();
+ for (int i = 0; i < resultsList.getCheckedItemPositions().size(); i++) {
+ if (resultsList.getCheckedItemPositions().valueAt(i)) {
+ checked.add(resultsAdapter.getItem(resultsList.getCheckedItemPositions().keyAt(i)));
+ }
+ }
+
+ int itemId = item.getItemId();
+ if (itemId == R.id.action_addall) {
+ // Start an Intent that adds multiple items at once, by supplying the urls and titles as string array
+ // extras and setting the Intent action to ADD_MULTIPLE
+ Intent intent = new Intent("org.transdroid.ADD_MULTIPLE");
+ String[] urls = new String[checked.size()];
+ String[] titles = new String[checked.size()];
+ for (int i = 0; i < checked.size(); i++) {
+ urls[i] = checked.get(i).getTorrentUrl();
+ titles[i] = checked.get(i).getName();
+ }
+ intent.putExtra("TORRENT_URLS", urls);
+ intent.putExtra("TORRENT_TITLES", titles);
+ if (resultsSource != null) {
+ intent.putExtra("PRIVATE_SOURCE", resultsSource);
+ }
+ startActivity(intent);
+ mode.finish();
+ return true;
+ } else if (itemId == R.id.action_showdetails) {
+ SearchResult first = checked.get(0);
+ // Open the torrent's web page in the browser
+ if (checked.size() > 1) {
+ Toast.makeText(getActivity(), getString(R.string.search_openingdetails, first.getName()), Toast.LENGTH_LONG).show();
+ }
+ startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(first.getDetailsUrl())));
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) {
+ selectionManagerMode.onItemCheckedStateChanged(mode, position, id, checked);
+ }
+
+ @Override
+ public void onDestroyActionMode(ActionMode mode) {
+ selectionManagerMode.onDestroyActionMode(mode);
+ }
+
+ };
+
}
diff --git a/app/src/main/java/org/transdroid/core/gui/search/SearchSetting.java b/app/src/main/java/org/transdroid/core/gui/search/SearchSetting.java
index f5352b09..c8677b39 100644
--- a/app/src/main/java/org/transdroid/core/gui/search/SearchSetting.java
+++ b/app/src/main/java/org/transdroid/core/gui/search/SearchSetting.java
@@ -25,7 +25,7 @@ public interface SearchSetting extends SimpleListItem {
* @return A unique string identifying this search setting
*/
public String getKey();
-
+
/**
* Should return an URL (which may still be abstract and not the actual search URL) specific to the search site
* @return A clean URL directing to the search site, to, for example, get the favicon of the site
diff --git a/app/src/main/java/org/transdroid/core/gui/search/SearchSettingSelectionView.java b/app/src/main/java/org/transdroid/core/gui/search/SearchSettingSelectionView.java
index cfb88056..35b9f632 100644
--- a/app/src/main/java/org/transdroid/core/gui/search/SearchSettingSelectionView.java
+++ b/app/src/main/java/org/transdroid/core/gui/search/SearchSettingSelectionView.java
@@ -16,18 +16,19 @@
*/
package org.transdroid.core.gui.search;
-import org.androidannotations.annotations.EViewGroup;
-import org.androidannotations.annotations.ViewById;
-
import android.content.Context;
import android.widget.FrameLayout;
import android.widget.TextView;
+import org.androidannotations.annotations.EViewGroup;
+import org.androidannotations.annotations.ViewById;
+import org.transdroid.R;
+
/**
* View that shows, as part of the action bar spinner, which {@link SearchSetting} is currently chosen.
* @author Eric Kok
*/
-@EViewGroup(resName = "actionbar_searchsite")
+@EViewGroup(R.layout.actionbar_searchsite)
public class SearchSettingSelectionView extends FrameLayout {
@ViewById
diff --git a/app/src/main/java/org/transdroid/core/gui/search/SearchSettingsDropDownAdapter.java b/app/src/main/java/org/transdroid/core/gui/search/SearchSettingsDropDownAdapter.java
index c0ce1373..4b779673 100644
--- a/app/src/main/java/org/transdroid/core/gui/search/SearchSettingsDropDownAdapter.java
+++ b/app/src/main/java/org/transdroid/core/gui/search/SearchSettingsDropDownAdapter.java
@@ -16,18 +16,17 @@
*/
package org.transdroid.core.gui.search;
-import java.util.List;
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
import org.transdroid.core.gui.lists.SimpleListItem;
import org.transdroid.core.gui.navigation.FilterListItemAdapter;
-import android.content.Context;
-import android.view.View;
-import android.view.ViewGroup;
+import java.util.List;
/**
- * List adapter that holds search settings, that is, web searches and in-app search sites, displayed as content to a
- * Spinner instead of a ListView.
+ * List adapter that holds search settings, that is, web searches and in-app search sites, displayed as content to a Spinner instead of a ListView.
* @author Eric Kok
*/
public class SearchSettingsDropDownAdapter extends FilterListItemAdapter {
diff --git a/app/src/main/java/org/transdroid/core/gui/search/SearchSiteView.java b/app/src/main/java/org/transdroid/core/gui/search/SearchSiteView.java
index 802f5313..4842c470 100644
--- a/app/src/main/java/org/transdroid/core/gui/search/SearchSiteView.java
+++ b/app/src/main/java/org/transdroid/core/gui/search/SearchSiteView.java
@@ -16,23 +16,24 @@
*/
package org.transdroid.core.gui.search;
+import android.content.Context;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;
+import org.transdroid.R;
import org.transdroid.core.app.settings.RssfeedSetting;
import org.transdroid.core.gui.navigation.NavigationHelper;
-import android.content.Context;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
/**
- * View that represents some {@link RssfeedSetting} object and displays name as well as loads a favicon for the feed's
- * site and can load how many new items are available.
+ * View that represents some {@link RssfeedSetting} object and displays name as well as loads a favicon for the feed's site and can load how many new
+ * items are available.
* @author Eric Kok
*/
-@EViewGroup(resName = "list_item_searchsite")
+@EViewGroup(R.layout.list_item_searchsite)
public class SearchSiteView extends LinearLayout {
private static final String GETFVO_URL = "http://g.etfv.co/%1$s";
@@ -57,8 +58,7 @@ public class SearchSiteView extends LinearLayout {
// Clear and then asynchronously load the site's favicon
// Uses the g.etfv.co service to resolve the favicon of any URL
faviconImage.setImageDrawable(null);
- navigationHelper.getImageCache().displayImage(String.format(GETFVO_URL, rssfeedLoader.getBaseUrl()),
- faviconImage);
+ navigationHelper.getImageCache().displayImage(String.format(GETFVO_URL, rssfeedLoader.getBaseUrl()), faviconImage);
}
diff --git a/app/src/main/java/org/transdroid/core/gui/search/SearchSitesAdapter.java b/app/src/main/java/org/transdroid/core/gui/search/SearchSitesAdapter.java
index d1e82042..95593f51 100644
--- a/app/src/main/java/org/transdroid/core/gui/search/SearchSitesAdapter.java
+++ b/app/src/main/java/org/transdroid/core/gui/search/SearchSitesAdapter.java
@@ -16,17 +16,17 @@
*/
package org.transdroid.core.gui.search;
-import java.util.List;
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext;
import org.transdroid.core.app.search.SearchSite;
import org.transdroid.core.app.settings.WebsearchSetting;
-import android.content.Context;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.BaseAdapter;
+import java.util.List;
/**
* Adapter that contains a list of {@link SearchSetting}s, either {@link SearchSite} or {@link WebsearchSetting}.
@@ -34,9 +34,9 @@ import android.widget.BaseAdapter;
*/
@EBean
public class SearchSitesAdapter extends BaseAdapter {
-
+
private List sites = null;
-
+
@RootContext
protected Context context;
@@ -48,23 +48,25 @@ public class SearchSitesAdapter extends BaseAdapter {
this.sites = sites;
notifyDataSetChanged();
}
-
+
@Override
public boolean hasStableIds() {
return true;
}
-
+
@Override
public int getCount() {
- if (sites == null)
+ if (sites == null) {
return 0;
+ }
return sites.size();
}
@Override
public SearchSetting getItem(int position) {
- if (sites == null)
+ if (sites == null) {
return null;
+ }
return sites.get(position);
}
diff --git a/app/src/main/java/org/transdroid/core/gui/search/UrlEntryDialog.java b/app/src/main/java/org/transdroid/core/gui/search/UrlEntryDialog.java
index 5342d927..94e8e6a7 100644
--- a/app/src/main/java/org/transdroid/core/gui/search/UrlEntryDialog.java
+++ b/app/src/main/java/org/transdroid/core/gui/search/UrlEntryDialog.java
@@ -16,67 +16,52 @@
*/
package org.transdroid.core.gui.search;
-import org.transdroid.core.gui.TorrentsActivity;
-import org.transdroid.core.gui.navigation.NavigationHelper;
-
-import android.annotation.SuppressLint;
-import android.annotation.TargetApi;
-import android.app.AlertDialog;
-import android.app.DialogFragment;
import android.content.ClipboardManager;
import android.content.Context;
-import android.content.DialogInterface;
-import android.content.DialogInterface.OnClickListener;
import android.net.Uri;
-import android.os.Build;
import android.text.InputType;
import android.text.TextUtils;
-import android.view.inputmethod.InputMethodManager;
+import android.view.LayoutInflater;
+import android.view.View;
import android.widget.EditText;
+import com.afollestad.materialdialogs.MaterialDialog;
+
+import org.transdroid.R;
+import org.transdroid.core.gui.TorrentsActivity;
+import org.transdroid.core.gui.navigation.NavigationHelper;
+
public class UrlEntryDialog {
/**
- * Opens a dialog that allows entry of a single URL string, which (on confirmation) will be supplied to the calling
- * activity's {@link TorrentsActivity#addTorrentByUrl(String, String) method}.
+ * Opens a dialog that allows entry of a single URL string, which (on confirmation) will be supplied to the calling activity's {@link
+ * TorrentsActivity#addTorrentByUrl(String, String) method}.
* @param activity The activity that opens (and owns) this dialog
*/
- @SuppressLint("ValidFragment")
- public static void startUrlEntry(final TorrentsActivity activity) {
- new DialogFragment() {
- @TargetApi(Build.VERSION_CODES.HONEYCOMB)
- public android.app.Dialog onCreateDialog(android.os.Bundle savedInstanceState) {
- final EditText urlInput = new EditText(activity);
- urlInput.setInputType(InputType.TYPE_TEXT_VARIATION_URI);
- if (android.os.Build.VERSION.SDK_INT >= 11) {
- ClipboardManager clipboard = (ClipboardManager) activity
- .getSystemService(Context.CLIPBOARD_SERVICE);
- if (clipboard.hasPrimaryClip() && clipboard.getPrimaryClip().getItemCount() > 0) {
- CharSequence content = clipboard.getPrimaryClip().getItemAt(0).coerceToText(activity);
- urlInput.setText(content);
- }
- }
- ((InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(
- InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
- return new AlertDialog.Builder(activity).setView(urlInput)
- .setPositiveButton(android.R.string.ok, new OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- // Assume text entry box input as URL and treat the filename (after the last /) as title
- String url = urlInput.getText().toString();
- Uri uri = Uri.parse(url);
- if (activity != null && !TextUtils.isEmpty(url)) {
- String title = NavigationHelper.extractNameFromUri(uri);
- if (uri.getScheme() != null && uri.getScheme().equals("magnet")) {
- activity.addTorrentByMagnetUrl(url, title);
- } else {
- activity.addTorrentByUrl(url, title);
- }
- }
+ public static void show(final TorrentsActivity activity) {
+ View inputLayout = LayoutInflater.from(activity).inflate(R.layout.dialog_url, null);
+ final EditText urlEdit = (EditText) inputLayout.findViewById(R.id.url_edit);
+ ClipboardManager clipboard = (ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE);
+ if (clipboard.hasPrimaryClip() && clipboard.getPrimaryClip().getItemCount() > 0) {
+ CharSequence content = clipboard.getPrimaryClip().getItemAt(0).coerceToText(activity);
+ urlEdit.setText(content);
+ }
+ new MaterialDialog.Builder(activity).customView(inputLayout, false).positiveText(android.R.string.ok).negativeText(android.R.string.cancel)
+ .callback(new MaterialDialog.ButtonCallback() {
+ @Override
+ public void onPositive(MaterialDialog dialog) {
+ String url = urlEdit.getText().toString();
+ Uri uri = Uri.parse(url);
+ if (!TextUtils.isEmpty(url)) {
+ String title = NavigationHelper.extractNameFromUri(uri);
+ if (uri.getScheme() != null && uri.getScheme().equals("magnet")) {
+ activity.addTorrentByMagnetUrl(url, title);
+ } else {
+ activity.addTorrentByUrl(url, title);
}
- }).setNegativeButton(android.R.string.cancel, null).create();
- };
- }.show(activity.getFragmentManager(), "urlentry");
+ }
+ }
+ }).show();
}
}
diff --git a/app/src/main/java/org/transdroid/core/gui/settings/HelpSettingsActivity.java b/app/src/main/java/org/transdroid/core/gui/settings/HelpSettingsActivity.java
index 525cfdab..3c68c8f7 100644
--- a/app/src/main/java/org/transdroid/core/gui/settings/HelpSettingsActivity.java
+++ b/app/src/main/java/org/transdroid/core/gui/settings/HelpSettingsActivity.java
@@ -37,7 +37,7 @@ import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;
@EActivity
-public class HelpSettingsActivity extends PreferenceActivity {
+public class HelpSettingsActivity extends PreferenceCompatActivity {
protected static final int DIALOG_CHANGELOG = 0;
protected static final int DIALOG_ABOUT = 1;
@@ -57,7 +57,7 @@ public class HelpSettingsActivity extends PreferenceActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- getActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// Just load the system-related preferences from XML
addPreferencesFromResource(R.xml.pref_help);
diff --git a/app/src/main/java/org/transdroid/core/gui/settings/KeyBoundPreferencesActivity.java b/app/src/main/java/org/transdroid/core/gui/settings/KeyBoundPreferencesActivity.java
index d291a6ec..800bd7c6 100644
--- a/app/src/main/java/org/transdroid/core/gui/settings/KeyBoundPreferencesActivity.java
+++ b/app/src/main/java/org/transdroid/core/gui/settings/KeyBoundPreferencesActivity.java
@@ -28,7 +28,6 @@ import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
import android.preference.ListPreference;
import android.preference.Preference;
-import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
import android.text.method.PasswordTransformationMethod;
@@ -43,13 +42,13 @@ import android.text.method.PasswordTransformationMethod;
* @author Eric Kok
*/
@EActivity
-public abstract class KeyBoundPreferencesActivity extends PreferenceActivity {
+public abstract class KeyBoundPreferencesActivity extends PreferenceCompatActivity {
@Extra
protected int key = -1;
private SharedPreferences sharedPrefs;
- private Map originalSummaries = new HashMap();
+ private Map originalSummaries = new HashMap<>();
/**
* Should be called during the activity {@link #onCreate(android.os.Bundle)} (but after super.onCreate(Bundle)) to
@@ -78,14 +77,14 @@ public abstract class KeyBoundPreferencesActivity extends PreferenceActivity {
// Monitor preference changes
PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(
onPreferenceChangeListener);
- };
+ }
protected void onPause() {
super.onPause();
// Stop monitoring preference changes
PreferenceManager.getDefaultSharedPreferences(this).unregisterOnSharedPreferenceChangeListener(
onPreferenceChangeListener);
- };
+ }
private OnSharedPreferenceChangeListener onPreferenceChangeListener = new OnSharedPreferenceChangeListener() {
@Override
diff --git a/app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java b/app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java
index 0f4d02a9..81f0aec9 100644
--- a/app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java
+++ b/app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java
@@ -28,8 +28,6 @@ import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
-import android.preference.PreferenceActivity;
-import android.view.View;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EActivity;
@@ -41,9 +39,8 @@ import org.transdroid.core.app.settings.ApplicationSettings;
import org.transdroid.core.app.settings.RssfeedSetting;
import org.transdroid.core.app.settings.ServerSetting;
import org.transdroid.core.app.settings.WebsearchSetting;
-import org.transdroid.core.gui.*;
+import org.transdroid.core.gui.TorrentsActivity_;
import org.transdroid.core.gui.navigation.NavigationHelper;
-import org.transdroid.core.gui.settings.OverflowPreference.OnOverflowClicked;
import org.transdroid.core.gui.settings.RssfeedPreference.OnRssfeedClickedListener;
import org.transdroid.core.gui.settings.ServerPreference.OnServerClickedListener;
import org.transdroid.core.gui.settings.WebsearchPreference.OnWebsearchClickedListener;
@@ -55,21 +52,14 @@ import java.util.ArrayList;
import java.util.List;
/**
- * The main activity that provides access to all application settings. It shows the configured serves, web search sites
- * and RSS feeds along with other general settings.
+ * The main activity that provides access to all application settings. It shows the configured serves, web search sites and RSS feeds along with other
+ * general settings.
* @author Eric Kok
*/
@EActivity
-public class MainSettingsActivity extends PreferenceActivity {
+public class MainSettingsActivity extends PreferenceCompatActivity {
protected static final int DIALOG_ADDSEEDBOX = 0;
- private OnOverflowClicked onOverflowClicked = new OnOverflowClicked() {
- @SuppressWarnings("deprecation")
- @Override
- public void onOverflowClicked(View overflowButton) {
- showDialog(DIALOG_ADDSEEDBOX);
- }
- };
@Bean
protected NavigationHelper navigationHelper;
@Bean
@@ -78,9 +68,13 @@ public class MainSettingsActivity extends PreferenceActivity {
protected SearchHelper searchHelper;
protected SharedPreferences prefs;
private OnPreferenceClickListener onAddServer = new OnPreferenceClickListener() {
+ @SuppressWarnings("deprecation")
@Override
public boolean onPreferenceClick(Preference preference) {
- ServerSettingsActivity_.intent(MainSettingsActivity.this).start();
+ if (navigationHelper.enableSeedboxes())
+ showDialog(DIALOG_ADDSEEDBOX);
+ else
+ ServerSettingsActivity_.intent(MainSettingsActivity.this).start();
return true;
}
};
@@ -130,8 +124,7 @@ public class MainSettingsActivity extends PreferenceActivity {
public void onSeedboxClicked(ServerSetting serverSetting, SeedboxProvider provider, int seedboxOffset) {
// NOTE: The seedboxOffset is the seedbox type-unique order that we need to supply uin the Extras bundle to
// edit this specific seedbox
- startActivity(provider.getSettings().getSettingsActivityIntent(MainSettingsActivity.this)
- .putExtra("key", seedboxOffset));
+ startActivity(provider.getSettings().getSettingsActivityIntent(MainSettingsActivity.this).putExtra("key", seedboxOffset));
}
};
private OnWebsearchClickedListener onWebsearchClicked = new OnWebsearchClickedListener() {
@@ -150,8 +143,10 @@ public class MainSettingsActivity extends PreferenceActivity {
@Override
public void onClick(DialogInterface dialog, int which) {
// Start the configuration activity for this specific chosen seedbox
- startActivity(
- SeedboxProvider.values()[which].getSettings().getSettingsActivityIntent(MainSettingsActivity.this));
+ if (which == 0)
+ ServerSettingsActivity_.intent(MainSettingsActivity.this).start();
+ else
+ startActivity(SeedboxProvider.values()[which - 1].getSettings().getSettingsActivityIntent(MainSettingsActivity.this));
}
};
@@ -166,7 +161,7 @@ public class MainSettingsActivity extends PreferenceActivity {
protected void onResume() {
super.onResume();
- getActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
prefs = getPreferenceManager().getSharedPreferences();
if (getPreferenceScreen() != null) {
@@ -178,13 +173,7 @@ public class MainSettingsActivity extends PreferenceActivity {
// Load the preference menu and attach actions
addPreferencesFromResource(R.xml.pref_main);
- OverflowPreference addServerPrefernce = (OverflowPreference) findPreference("header_addserver");
- addServerPrefernce.setOnPreferenceClickListener(onAddServer);
- if (navigationHelper.enableSeedboxes()) {
- addServerPrefernce.setOnOverflowClickedListener(onOverflowClicked);
- } else {
- addServerPrefernce.hideOverflowButton();
- }
+ findPreference("header_addserver").setOnPreferenceClickListener(onAddServer);
if (enableSearchUi) {
findPreference("header_addwebsearch").setOnPreferenceClickListener(onAddWebsearch);
}
@@ -196,8 +185,8 @@ public class MainSettingsActivity extends PreferenceActivity {
findPreference("header_help").setOnPreferenceClickListener(onHelpSettings);
// Keep a list of the server codes and names (for default server selection)
- List serverCodes = new ArrayList();
- List serverNames = new ArrayList();
+ List serverCodes = new ArrayList<>();
+ List serverNames = new ArrayList<>();
serverCodes.add(Integer.toString(ApplicationSettings.DEFAULTSERVER_LASTUSED));
serverCodes.add(Integer.toString(ApplicationSettings.DEFAULTSERVER_ASKONADD));
serverNames.add(getString(R.string.pref_defaultserver_lastused));
@@ -206,8 +195,8 @@ public class MainSettingsActivity extends PreferenceActivity {
// Add existing servers
List servers = applicationSettings.getNormalServerSettings();
for (ServerSetting serverSetting : servers) {
- getPreferenceScreen().addPreference(new ServerPreference(this).setServerSetting(serverSetting)
- .setOnServerClickedListener(onServerClicked));
+ getPreferenceScreen()
+ .addPreference(new ServerPreference(this).setServerSetting(serverSetting).setOnServerClickedListener(onServerClicked));
if (serverSetting.getUniqueIdentifier() != null) {
serverCodes.add(Integer.toString(serverSetting.getOrder()));
serverNames.add(serverSetting.getName());
@@ -219,9 +208,8 @@ public class MainSettingsActivity extends PreferenceActivity {
for (SeedboxProvider provider : SeedboxProvider.values()) {
int seedboxOffset = 0;
for (ServerSetting seedbox : provider.getSettings().getAllServerSettings(prefs, orderOffset)) {
- getPreferenceScreen().addPreference(
- new SeedboxPreference(this).setProvider(provider).setServerSetting(seedbox)
- .setOnSeedboxClickedListener(onSeedboxClicked, seedboxOffset));
+ getPreferenceScreen().addPreference(new SeedboxPreference(this).setProvider(provider).setServerSetting(seedbox)
+ .setOnSeedboxClickedListener(onSeedboxClicked, seedboxOffset));
orderOffset++;
seedboxOffset++;
if (seedbox.getUniqueIdentifier() != null) {
@@ -242,8 +230,8 @@ public class MainSettingsActivity extends PreferenceActivity {
} else {
List rssfeeds = applicationSettings.getRssfeedSettings();
for (RssfeedSetting rssfeedSetting : rssfeeds) {
- getPreferenceScreen().addPreference(new RssfeedPreference(this).setRssfeedSetting(rssfeedSetting)
- .setOnRssfeedClickedListener(onRssfeedClicked));
+ getPreferenceScreen()
+ .addPreference(new RssfeedPreference(this).setRssfeedSetting(rssfeedSetting).setOnRssfeedClickedListener(onRssfeedClicked));
}
}
@@ -256,8 +244,8 @@ public class MainSettingsActivity extends PreferenceActivity {
// Add existing websearch sites
List websearches = applicationSettings.getWebsearchSettings();
for (WebsearchSetting websearchSetting : websearches) {
- getPreferenceScreen().addPreference(new WebsearchPreference(this).setWebsearchSetting(websearchSetting)
- .setOnWebsearchClickedListener(onWebsearchClicked));
+ getPreferenceScreen().addPreference(
+ new WebsearchPreference(this).setWebsearchSetting(websearchSetting).setOnWebsearchClickedListener(onWebsearchClicked));
}
// Construct list of all available search sites, in-app and web
@@ -265,10 +253,10 @@ public class MainSettingsActivity extends PreferenceActivity {
// Retrieve the available in-app search sites (using the Torrent Search package)
List searchsites = searchHelper.getAvailableSites();
if (searchsites == null) {
- searchsites = new ArrayList();
+ searchsites = new ArrayList<>();
}
- List siteNames = new ArrayList(websearches.size() + searchsites.size());
- List siteValues = new ArrayList(websearches.size() + searchsites.size());
+ List siteNames = new ArrayList<>(websearches.size() + searchsites.size());
+ List siteValues = new ArrayList<>(websearches.size() + searchsites.size());
for (SearchSite searchSite : searchsites) {
siteNames.add(searchSite.getName());
siteValues.add(searchSite.getKey());
@@ -295,14 +283,15 @@ public class MainSettingsActivity extends PreferenceActivity {
super.onBuildHeaders(target);
}
+ @Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case DIALOG_ADDSEEDBOX:
- // Open dialog to pick one of the supported seedbox providers
- String[] seedboxes = new String[SeedboxProvider.values().length];
- for (int i = 0; i < seedboxes.length; i++) {
- seedboxes[i] = getString(R.string.pref_seedbox_addseedbox,
- SeedboxProvider.values()[i].getSettings().getName());
+ // Open dialog to pick one of the supported seedbox providers (or a normal server)
+ String[] seedboxes = new String[SeedboxProvider.values().length + 1];
+ seedboxes[0] = getString(R.string.pref_addserver_normal);
+ for (int i = 0; i < seedboxes.length - 1; i++) {
+ seedboxes[i + 1] = getString(R.string.pref_seedbox_addseedbox, SeedboxProvider.values()[i].getSettings().getName());
}
return new AlertDialog.Builder(this).setItems(seedboxes, onAddSeedbox).create();
}
diff --git a/app/src/main/java/org/transdroid/core/gui/settings/NotificationSettingsActivity.java b/app/src/main/java/org/transdroid/core/gui/settings/NotificationSettingsActivity.java
index 72e7971d..f2717f04 100644
--- a/app/src/main/java/org/transdroid/core/gui/settings/NotificationSettingsActivity.java
+++ b/app/src/main/java/org/transdroid/core/gui/settings/NotificationSettingsActivity.java
@@ -16,24 +16,22 @@
*/
package org.transdroid.core.gui.settings;
-import org.androidannotations.annotations.Bean;
-import org.androidannotations.annotations.EActivity;
-import org.androidannotations.annotations.OptionsItem;
-import org.transdroid.R;
-import org.transdroid.core.app.settings.NotificationSettings;
-import org.transdroid.core.service.BootReceiver;
-
import android.annotation.TargetApi;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.Build;
import android.os.Bundle;
-import android.preference.PreferenceActivity;
+
+import org.androidannotations.annotations.Bean;
+import org.androidannotations.annotations.EActivity;
+import org.androidannotations.annotations.OptionsItem;
+import org.transdroid.R;
+import org.transdroid.core.app.settings.NotificationSettings;
+import org.transdroid.core.service.BootReceiver;
@EActivity
-public class NotificationSettingsActivity extends PreferenceActivity implements
- OnSharedPreferenceChangeListener {
+public class NotificationSettingsActivity extends PreferenceCompatActivity implements OnSharedPreferenceChangeListener {
@Bean
protected NotificationSettings notificationSettings;
@@ -43,13 +41,13 @@ public class NotificationSettingsActivity extends PreferenceActivity implements
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- getActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// Load the notification-related preferences from XML and update availability thereof
addPreferencesFromResource(R.xml.pref_notifications);
boolean disabled = !notificationSettings.isEnabledForRss() && !notificationSettings.isEnabledForTorrents();
updatePrefsEnabled(disabled);
-
+
}
@SuppressWarnings("deprecation")
@@ -59,7 +57,7 @@ public class NotificationSettingsActivity extends PreferenceActivity implements
// Start/stop the background service appropriately
getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
}
-
+
@SuppressWarnings("deprecation")
@Override
protected void onPause() {
@@ -78,8 +76,8 @@ public class NotificationSettingsActivity extends PreferenceActivity implements
boolean disabled = !notificationSettings.isEnabledForRss() && !notificationSettings.isEnabledForTorrents();
updatePrefsEnabled(disabled);
-
- if (disabled ) {
+
+ if (disabled) {
// Disabled all background notifications; disable the alarms that start the service
BootReceiver.cancelBackgroundServices(getApplicationContext());
}
diff --git a/app/src/main/java/org/transdroid/core/gui/settings/OverflowPreference.java b/app/src/main/java/org/transdroid/core/gui/settings/OverflowPreference.java
deleted file mode 100644
index e8659918..00000000
--- a/app/src/main/java/org/transdroid/core/gui/settings/OverflowPreference.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package org.transdroid.core.gui.settings;
-
-import org.transdroid.R;
-
-import android.content.Context;
-import android.preference.Preference;
-import android.util.AttributeSet;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
-import android.widget.ImageButton;
-
-/**
- * A {@link Preference} item that shows an extra overflow button at the right side of the screen. The action attached to
- * this button is set using {@link #setOnOverflowClickedListener(OnOverflowClicked)}. Normal clicks on this preference
- * are handled in the standard way.
- * @author Eric Kok
- */
-public class OverflowPreference extends Preference {
-
- private OnPreferenceClickListener onPreferenceClickListener = null;
- private OnOverflowClicked onOverflowClickedListener = null;
- private ImageButton overflowButton = null;
-
- public OverflowPreference(Context context) {
- super(context);
- init();
- }
-
- public OverflowPreference(Context context, AttributeSet attrs) {
- super(context, attrs);
- init();
- }
-
- public OverflowPreference(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- init();
- }
-
- @Override
- protected View onCreateView(ViewGroup parent) {
- View layout = super.onCreateView(parent);
- // Since the Preference layout is now created, we can attach the proper click listeners
- layout.setClickable(true);
- layout.setFocusable(true);
- // When setting the background drawable the padding on this Preference layout disappears, so add it again
- int bottom = layout.getPaddingBottom();
- int top = layout.getPaddingTop();
- int right = layout.getPaddingRight();
- int left = layout.getPaddingLeft();
- layout.setBackgroundResource(R.drawable.selectable_background_holo_light);
- layout.setPadding(left, top, right, bottom);
- layout.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- if (onPreferenceClickListener != null)
- onPreferenceClickListener.onPreferenceClick(OverflowPreference.this);
- }
- });
- overflowButton = (ImageButton) layout.findViewById(R.id.overflow_button);
- overflowButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- if (onOverflowClickedListener != null)
- onOverflowClickedListener.onOverflowClicked(v);
- }
- });
- return layout;
- }
-
- public void init() {
- // Load an overflow-style image button as custom widget in the right of this Preference layout
- setWidgetLayoutResource(R.layout.pref_withoverflow);
- }
-
- /**
- * Hides the overflow button (on the right side of the Preference) from the UI.
- */
- public void hideOverflowButton() {
- if (overflowButton != null) {
- overflowButton.setVisibility(View.GONE);
- }
- }
-
- /**
- * Shows (after hiding it) the overflow button (on the right side of the Preference) in the UI.
- */
- public void showOverflowButton() {
- if (overflowButton != null) {
- overflowButton.setVisibility(View.VISIBLE);
- }
- }
-
- @Override
- public void setOnPreferenceClickListener(OnPreferenceClickListener onPreferenceClickListener) {
- // Instead of the build-in list item click behaviour, we have to manually assign the click listener to this
- // Preference item, as we stole the focus behaviour when we added a Button to the Preference layout
- this.onPreferenceClickListener = onPreferenceClickListener;
- }
-
- /**
- * Registers the listener for clicks on the overflow button contained in this preference.
- * @param onOverflowClickedListener The overflow button click listener
- */
- public void setOnOverflowClickedListener(OnOverflowClicked onOverflowClickedListener) {
- this.onOverflowClickedListener = onOverflowClickedListener;
- }
-
- /**
- * An interface to be implemented by any activity (or otherwise) that wants to handle events when the contained
- * overflow button is clicked.
- */
- public interface OnOverflowClicked {
- public void onOverflowClicked(View overflowButton);
- }
-
-}
diff --git a/app/src/main/java/org/transdroid/core/gui/settings/PreferenceCompatActivity.java b/app/src/main/java/org/transdroid/core/gui/settings/PreferenceCompatActivity.java
new file mode 100644
index 00000000..a25ba166
--- /dev/null
+++ b/app/src/main/java/org/transdroid/core/gui/settings/PreferenceCompatActivity.java
@@ -0,0 +1,65 @@
+package org.transdroid.core.gui.settings;
+
+import android.content.res.Configuration;
+import android.os.Bundle;
+import android.preference.PreferenceActivity;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.AppCompatCallback;
+import android.support.v7.app.AppCompatDelegate;
+import android.support.v7.view.ActionMode;
+
+public class PreferenceCompatActivity extends PreferenceActivity implements AppCompatCallback {
+
+ private AppCompatDelegate acd;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ acd = AppCompatDelegate.create(this, this);
+ acd.onCreate(savedInstanceState);
+ }
+
+ @Override
+ protected void onPostCreate(Bundle savedInstanceState) {
+ super.onPostCreate(savedInstanceState);
+ acd.onPostCreate(savedInstanceState);
+ }
+
+ @Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ acd.onConfigurationChanged(newConfig);
+ }
+
+ @Override
+ public void setTitle(CharSequence title) {
+ super.setTitle(title);
+ acd.setTitle(title);
+ }
+
+ @Override
+ protected void onStop() {
+ super.onStop();
+ acd.onStop();
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ acd.onDestroy();
+ }
+
+ public ActionBar getSupportActionBar() {
+ return acd.getSupportActionBar();
+ }
+
+ @Override
+ public void onSupportActionModeStarted(ActionMode actionMode) {
+
+ }
+
+ @Override
+ public void onSupportActionModeFinished(ActionMode actionMode) {
+
+ }
+}
diff --git a/app/src/main/java/org/transdroid/core/gui/settings/RssfeedSettingsActivity.java b/app/src/main/java/org/transdroid/core/gui/settings/RssfeedSettingsActivity.java
index 59785028..ae911641 100644
--- a/app/src/main/java/org/transdroid/core/gui/settings/RssfeedSettingsActivity.java
+++ b/app/src/main/java/org/transdroid/core/gui/settings/RssfeedSettingsActivity.java
@@ -37,7 +37,7 @@ import android.os.Bundle;
* @author Eric Kok
*/
@EActivity
-@OptionsMenu(resName = "activity_deleteableprefs")
+@OptionsMenu(R.menu.activity_deleteableprefs)
public class RssfeedSettingsActivity extends KeyBoundPreferencesActivity {
private static final int DIALOG_CONFIRMREMOVE = 0;
@@ -46,7 +46,7 @@ public class RssfeedSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- getActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen
init(R.xml.pref_rssfeed, ApplicationSettings_.getInstance_(this).getMaxRssfeed());
@@ -65,11 +65,12 @@ public class RssfeedSettingsActivity extends KeyBoundPreferencesActivity {
}
@SuppressWarnings("deprecation")
- @OptionsItem(resName = "action_removesettings")
+ @OptionsItem(R.id.action_removesettings)
protected void removeSettings() {
showDialog(DIALOG_CONFIRMREMOVE);
}
+ @Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case DIALOG_CONFIRMREMOVE:
diff --git a/app/src/main/java/org/transdroid/core/gui/settings/ServerSettingsActivity.java b/app/src/main/java/org/transdroid/core/gui/settings/ServerSettingsActivity.java
index 1a8b3d59..72725a92 100644
--- a/app/src/main/java/org/transdroid/core/gui/settings/ServerSettingsActivity.java
+++ b/app/src/main/java/org/transdroid/core/gui/settings/ServerSettingsActivity.java
@@ -41,7 +41,7 @@ import android.preference.PreferenceManager;
* @author Eric Kok
*/
@EActivity
-@OptionsMenu(resName = "activity_deleteableprefs")
+@OptionsMenu(R.menu.activity_deleteableprefs)
public class ServerSettingsActivity extends KeyBoundPreferencesActivity {
private static final int DIALOG_CONFIRMREMOVE = 0;
@@ -52,7 +52,7 @@ public class ServerSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- getActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen
init(R.xml.pref_server, ApplicationSettings_.getInstance_(this).getMaxNormalServer());
@@ -89,11 +89,12 @@ public class ServerSettingsActivity extends KeyBoundPreferencesActivity {
}
@SuppressWarnings("deprecation")
- @OptionsItem(resName = "action_removesettings")
+ @OptionsItem(R.id.action_removesettings)
protected void removeSettings() {
showDialog(DIALOG_CONFIRMREMOVE);
}
+ @Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case DIALOG_CONFIRMREMOVE:
diff --git a/app/src/main/java/org/transdroid/core/gui/settings/SystemSettingsActivity.java b/app/src/main/java/org/transdroid/core/gui/settings/SystemSettingsActivity.java
index 52def869..add9e506 100644
--- a/app/src/main/java/org/transdroid/core/gui/settings/SystemSettingsActivity.java
+++ b/app/src/main/java/org/transdroid/core/gui/settings/SystemSettingsActivity.java
@@ -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,10 +52,8 @@ 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 {
+public class SystemSettingsActivity extends PreferenceCompatActivity {
protected static final int DIALOG_IMPORTSETTINGS = 0;
private OnPreferenceClickListener onImportSettingsClick = new OnPreferenceClickListener() {
@@ -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 {
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.red));
} 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.red));
}
}
};
@@ -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.red));
}
}
};
@@ -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.red));
}
}
};
@@ -160,7 +154,7 @@ public class SystemSettingsActivity extends PreferenceActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- getActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// Just load the system-related preferences from XML
addPreferencesFromResource(R.xml.pref_system);
@@ -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.red));
}
}
}
diff --git a/app/src/main/java/org/transdroid/core/gui/settings/WebsearchPreference.java b/app/src/main/java/org/transdroid/core/gui/settings/WebsearchPreference.java
index dec0f098..ea999b6a 100644
--- a/app/src/main/java/org/transdroid/core/gui/settings/WebsearchPreference.java
+++ b/app/src/main/java/org/transdroid/core/gui/settings/WebsearchPreference.java
@@ -16,11 +16,11 @@
*/
package org.transdroid.core.gui.settings;
-import org.transdroid.core.app.settings.WebsearchSetting;
-
import android.content.Context;
import android.preference.Preference;
+import org.transdroid.core.app.settings.WebsearchSetting;
+
/**
* Represents a {@link WebsearchSetting} in a preferences screen.
* @author Eric Kok
@@ -31,7 +31,7 @@ public class WebsearchPreference extends Preference {
private WebsearchSetting websearchSetting;
private OnWebsearchClickedListener onWebsearchClickedListener = null;
-
+
public WebsearchPreference(Context context) {
super(context);
setOnPreferenceClickListener(onPreferenceClicked);
@@ -49,7 +49,7 @@ public class WebsearchPreference extends Preference {
setOrder(ORDER_START + websearchSetting.getOrder());
return this;
}
-
+
/**
* Set a listener that will be notified of click events on this preference
* @param onWebsearchClickedListener The click listener to register
@@ -68,9 +68,9 @@ public class WebsearchPreference extends Preference {
return true;
}
};
-
+
public interface OnWebsearchClickedListener {
- public void onWebsearchClicked(WebsearchSetting serverSetting);
+ void onWebsearchClicked(WebsearchSetting serverSetting);
}
-
+
}
diff --git a/app/src/main/java/org/transdroid/core/gui/settings/WebsearchSettingsActivity.java b/app/src/main/java/org/transdroid/core/gui/settings/WebsearchSettingsActivity.java
index 3dbe1e81..4cf11ee8 100644
--- a/app/src/main/java/org/transdroid/core/gui/settings/WebsearchSettingsActivity.java
+++ b/app/src/main/java/org/transdroid/core/gui/settings/WebsearchSettingsActivity.java
@@ -37,7 +37,7 @@ import android.os.Bundle;
* @author Eric Kok
*/
@EActivity
-@OptionsMenu(resName="activity_deleteableprefs")
+@OptionsMenu(R.menu.activity_deleteableprefs)
public class WebsearchSettingsActivity extends KeyBoundPreferencesActivity {
private static final int DIALOG_CONFIRMREMOVE = 0;
@@ -46,8 +46,8 @@ public class WebsearchSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- getActionBar().setDisplayHomeAsUpEnabled(true);
-
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+
// Load the raw preferences to show in this screen
init(R.xml.pref_websearch, ApplicationSettings_.getInstance_(this).getMaxWebsearch());
initTextPreference("websearch_name");
@@ -63,11 +63,12 @@ public class WebsearchSettingsActivity extends KeyBoundPreferencesActivity {
}
@SuppressWarnings("deprecation")
- @OptionsItem(resName = "action_removesettings")
+ @OptionsItem(R.id.action_removesettings)
protected void removeSettings() {
showDialog(DIALOG_CONFIRMREMOVE);
}
-
+
+ @Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case DIALOG_CONFIRMREMOVE:
diff --git a/app/src/main/java/org/transdroid/core/seedbox/SeedstuffSettingsActivity.java b/app/src/main/java/org/transdroid/core/seedbox/SeedstuffSettingsActivity.java
index 17433b8f..ffccd56a 100644
--- a/app/src/main/java/org/transdroid/core/seedbox/SeedstuffSettingsActivity.java
+++ b/app/src/main/java/org/transdroid/core/seedbox/SeedstuffSettingsActivity.java
@@ -42,7 +42,7 @@ public class SeedstuffSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- getActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen
init(R.xml.pref_seedbox_seedstuff,
diff --git a/app/src/main/java/org/transdroid/core/seedbox/XirvikDediSettingsActivity.java b/app/src/main/java/org/transdroid/core/seedbox/XirvikDediSettingsActivity.java
index 429fc0e8..ac54df3f 100644
--- a/app/src/main/java/org/transdroid/core/seedbox/XirvikDediSettingsActivity.java
+++ b/app/src/main/java/org/transdroid/core/seedbox/XirvikDediSettingsActivity.java
@@ -42,7 +42,7 @@ public class XirvikDediSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- getActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen
init(R.xml.pref_seedbox_xirvikdedi,
diff --git a/app/src/main/java/org/transdroid/core/seedbox/XirvikSemiSettingsActivity.java b/app/src/main/java/org/transdroid/core/seedbox/XirvikSemiSettingsActivity.java
index 79cd7ff3..fe8f0849 100644
--- a/app/src/main/java/org/transdroid/core/seedbox/XirvikSemiSettingsActivity.java
+++ b/app/src/main/java/org/transdroid/core/seedbox/XirvikSemiSettingsActivity.java
@@ -42,7 +42,7 @@ public class XirvikSemiSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- getActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen
init(R.xml.pref_seedbox_xirviksemi,
diff --git a/app/src/main/java/org/transdroid/core/seedbox/XirvikSharedSettingsActivity.java b/app/src/main/java/org/transdroid/core/seedbox/XirvikSharedSettingsActivity.java
index fd5f6389..92ed970a 100644
--- a/app/src/main/java/org/transdroid/core/seedbox/XirvikSharedSettingsActivity.java
+++ b/app/src/main/java/org/transdroid/core/seedbox/XirvikSharedSettingsActivity.java
@@ -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;
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
@@ -59,12 +60,11 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- getActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// 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 {
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 {
} 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 {
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.red));
edit.remove("seedbox_xirvikshared_rpc_" + key);
pref.setSummary("");
} else {
diff --git a/app/src/main/java/org/transdroid/core/service/ConnectivityHelper.java b/app/src/main/java/org/transdroid/core/service/ConnectivityHelper.java
index 2b00671d..39c27ff3 100644
--- a/app/src/main/java/org/transdroid/core/service/ConnectivityHelper.java
+++ b/app/src/main/java/org/transdroid/core/service/ConnectivityHelper.java
@@ -32,16 +32,8 @@ public class ConnectivityHelper {
@SystemService
protected WifiManager wifiManager;
- public ConnectivityHelper(Context context) {
- }
-
- @SuppressWarnings("deprecation")
public boolean shouldPerformBackgroundActions() {
- // First check the old background data setting (this will always be true for ICS+)
- if (!connectivityManager.getBackgroundDataSetting())
- return false;
-
- // Still good? Check the current active network instead
+ // Check the current active network whether we are connected
return connectivityManager.getActiveNetworkInfo() != null
&& connectivityManager.getActiveNetworkInfo().isConnected();
}
diff --git a/app/src/main/java/org/transdroid/core/widget/ListWidgetConfigActivity.java b/app/src/main/java/org/transdroid/core/widget/ListWidgetConfigActivity.java
index 783b46a4..b2f1bb78 100644
--- a/app/src/main/java/org/transdroid/core/widget/ListWidgetConfigActivity.java
+++ b/app/src/main/java/org/transdroid/core/widget/ListWidgetConfigActivity.java
@@ -17,12 +17,12 @@
package org.transdroid.core.widget;
import android.annotation.TargetApi;
-import android.app.ActionBar;
-import android.app.Activity;
import android.appwidget.AppWidgetManager;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.CheckBox;
@@ -66,7 +66,7 @@ import java.util.List;
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@EActivity(resName = "activity_widgetconfig")
-public class ListWidgetConfigActivity extends Activity {
+public class ListWidgetConfigActivity extends ActionBarActivity {
// Views and adapters
@ViewById
@@ -182,11 +182,11 @@ public class ListWidgetConfigActivity extends Activity {
// Set up action bar with a done button
// Inspired by NoNonsenseNotes's ListWidgetConfig.java (Apache License, Version 2.0)
- getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM,
+ getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM,
ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE);
View doneButtonFrame = getLayoutInflater().inflate(R.layout.actionbar_donebutton, null);
doneButtonFrame.findViewById(R.id.actionbar_done).setOnClickListener(doneClicked);
- getActionBar().setCustomView(doneButtonFrame);
+ getSupportActionBar().setCustomView(doneButtonFrame);
}
diff --git a/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java b/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java
index d543f705..7bfb100d 100644
--- a/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java
+++ b/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java
@@ -17,20 +17,16 @@
*/
package org.transdroid.daemon.Qbittorrent;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.UnsupportedEncodingException;
-import java.net.URI;
-import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
+import com.android.internalcopy.http.multipart.FilePart;
+import com.android.internalcopy.http.multipart.MultipartEntity;
+import com.android.internalcopy.http.multipart.Part;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
+import org.apache.http.cookie.Cookie;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;
@@ -40,6 +36,7 @@ import org.json.JSONObject;
import org.transdroid.core.gui.log.Log;
import org.transdroid.daemon.Daemon;
import org.transdroid.daemon.DaemonException;
+import org.transdroid.daemon.DaemonException.ExceptionType;
import org.transdroid.daemon.DaemonSettings;
import org.transdroid.daemon.IDaemonAdapter;
import org.transdroid.daemon.Priority;
@@ -47,7 +44,6 @@ import org.transdroid.daemon.Torrent;
import org.transdroid.daemon.TorrentDetails;
import org.transdroid.daemon.TorrentFile;
import org.transdroid.daemon.TorrentStatus;
-import org.transdroid.daemon.DaemonException.ExceptionType;
import org.transdroid.daemon.task.AddByFileTask;
import org.transdroid.daemon.task.AddByMagnetUrlTask;
import org.transdroid.daemon.task.AddByUrlTask;
@@ -65,9 +61,15 @@ import org.transdroid.daemon.task.RetrieveTaskSuccessResult;
import org.transdroid.daemon.task.SetFilePriorityTask;
import org.transdroid.daemon.task.SetTransferRatesTask;
import org.transdroid.daemon.util.HttpHelper;
-import com.android.internalcopy.http.multipart.FilePart;
-import com.android.internalcopy.http.multipart.MultipartEntity;
-import com.android.internalcopy.http.multipart.Part;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.UnsupportedEncodingException;
+import java.net.URI;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
/**
* The daemon adapter for the qBittorrent torrent client.
@@ -80,53 +82,110 @@ public class QbittorrentAdapter implements IDaemonAdapter {
private DaemonSettings settings;
private DefaultHttpClient httpclient;
private int version = -1;
+ private int apiVersion = -1;
public QbittorrentAdapter(DaemonSettings settings) {
this.settings = settings;
}
private synchronized void ensureVersion(Log log) throws DaemonException {
- if (version > 0)
+ // Still need to retrieve the API and qBittorrent version numbers from the server?
+ if (version > 0 && apiVersion > 0)
return;
- // We still need to retrieve the version number from the server
- // Do this by getting the web interface about page and trying to parse the version number
- // Format is something like 'qBittorrent v2.9.7 (Web UI)'
- String about = makeRequest(log, "/about.html");
- String aboutStartText = "qBittorrent v";
- String aboutEndText = " (Web UI)";
- int aboutStart = about.indexOf(aboutStartText);
- int aboutEnd = about.indexOf(aboutEndText);
+
try {
- if (aboutStart >= 0 && aboutEnd > aboutStart) {
- // String found: now parse a version like 2.9.7 as a number like 20907 (allowing 10 places for each .)
- String[] parts = about.substring(aboutStart + aboutStartText.length(), aboutEnd).split("\\.");
- if (parts.length > 0) {
- version = Integer.parseInt(parts[0]) * 100 * 100;
- if (parts.length > 1) {
- version += Integer.parseInt(parts[1]) * 100;
- if (parts.length > 2) {
- // For the last part only read until a non-numeric character is read
- // For example version 3.0.0-alpha5 is read as version code 30000
- String numbers = "";
- for (char c : parts[2].toCharArray()) {
- if (Character.isDigit(c))
- // Still a number; add it to the numbers string
- numbers += Character.toString(c);
- else {
- // No longer reading numbers; stop reading
- break;
- }
+
+ // The API version is only supported since qBittorrent 3.2, so otherwise we assume version 1
+ try {
+ String apiVerText = makeRequest(log, "/version/api");
+ apiVersion = Integer.parseInt(apiVerText.trim());
+ } catch (DaemonException | NumberFormatException e) {
+ apiVersion = 1;
+ }
+ log.d(LOG_NAME, "qBittorrent API version is " + apiVersion);
+
+ // The qBittorent version is only supported since 3.2; for earlier versions we parse the about dialog and parse it
+ String versionText = "";
+ if (apiVersion > 1) {
+ // Format is something like 'v3.2.0'
+ versionText = makeRequest(log, "/version/qbittorrent").substring(1);
+ } else {
+ // Format is something like 'qBittorrent v2.9.7 (Web UI)' or 'qBittorrent v3.0.0-alpha5 (Web UI)'
+ String about = makeRequest(log, "/about.html");
+ String aboutStartText = "qBittorrent v";
+ String aboutEndText = " (Web UI)";
+ int aboutStart = about.indexOf(aboutStartText);
+ int aboutEnd = about.indexOf(aboutEndText);
+ if (aboutStart >= 0 && aboutEnd > aboutStart) {
+ versionText = about.substring(aboutStart + aboutStartText.length(), aboutEnd);
+ }
+ }
+
+ // String found: now parse a version like 2.9.7 as a number like 20907 (allowing 10 places for each .)
+ String[] parts = versionText.split("\\.");
+ if (parts.length > 0) {
+ version = Integer.parseInt(parts[0]) * 100 * 100;
+ if (parts.length > 1) {
+ version += Integer.parseInt(parts[1]) * 100;
+ if (parts.length > 2) {
+ // For the last part only read until a non-numeric character is read
+ // For example version 3.0.0-alpha5 is read as version code 30000
+ String numbers = "";
+ for (char c : parts[2].toCharArray()) {
+ if (Character.isDigit(c))
+ // Still a number; add it to the numbers string
+ numbers += Character.toString(c);
+ else {
+ // No longer reading numbers; stop reading
+ break;
}
- version += Integer.parseInt(numbers);
- return;
}
+ version += Integer.parseInt(numbers);
+ return;
}
}
}
- } catch (NumberFormatException e) {
+
+ } catch (Exception e) {
+ // Unable to establish version number; assume an old version by setting it to version 1
+ version = 10000;
+ apiVersion = 1;
}
- // Unable to establish version number; assume an old version by setting it to version 1
- version = 10000;
+
+ }
+
+ private synchronized void ensureAuthenticated(Log log) throws DaemonException {
+ // API changed in 3.2.0, login is now handled by its own request, which provides you a cookie.
+ // If we don't have that cookie, let's try and get it.
+
+ if (apiVersion < 2) {
+ return;
+ }
+
+ // Have we already authenticated? Check if we have the cookie that we need
+ List cookies = httpclient.getCookieStore().getCookies();
+ for (Cookie c : cookies) {
+ if (c.getName().equals("SID")) {
+ // And here it is! Okay, no need authenticate again.
+ return;
+ }
+ }
+
+ makeRequest(log, "/login", new BasicNameValuePair("username", settings.getUsername()),
+ new BasicNameValuePair("password", settings.getPassword()));
+ // The HttpClient will automatically remember the cookie for us, no need to parse it out.
+
+ // However, we would like to see if authentication was successful or not...
+ cookies = httpclient.getCookieStore().getCookies();
+ for (Cookie c : cookies) {
+ if (c.getName().equals("SID")) {
+ // Good. Let's get out of here.
+ return;
+ }
+ }
+
+ // No cookie found, we didn't authenticate.
+ throw new DaemonException(ExceptionType.AuthenticationFailure, "Server rejected our login");
}
@Override
@@ -134,120 +193,129 @@ public class QbittorrentAdapter implements IDaemonAdapter {
try {
ensureVersion(log);
+ ensureAuthenticated(log);
+
switch (task.getMethod()) {
- case Retrieve:
+ case Retrieve:
+ String path;
+ if (version >= 30200) {
+ path = "/query/torrents";
+ } else if (version >= 30000) {
+ path = "/json/torrents";
+ } else {
+ path = "/json/events";
+ }
- // Request all torrents from server
- JSONArray result = new JSONArray(makeRequest(log, version >= 30000 ? "/json/torrents" : "/json/events"));
- return new RetrieveTaskSuccessResult((RetrieveTask) task, parseJsonTorrents(result), null);
+ // Request all torrents from server
+ JSONArray result = new JSONArray(makeRequest(log, path));
+ return new RetrieveTaskSuccessResult((RetrieveTask) task, parseJsonTorrents(result), null);
- case GetTorrentDetails:
+ case GetTorrentDetails:
- // Request tracker and error details for a specific teacher
- String mhash = task.getTargetTorrent().getUniqueID();
- JSONArray messages = new JSONArray(makeRequest(log, "/json/propertiesTrackers/" + mhash));
- return new GetTorrentDetailsTaskSuccessResult((GetTorrentDetailsTask) task,
- parseJsonTorrentDetails(messages));
+ // Request tracker and error details for a specific teacher
+ String mhash = task.getTargetTorrent().getUniqueID();
+ JSONArray messages =
+ new JSONArray(makeRequest(log, (version >= 30200 ? "/query/propertiesTrackers/" : "/json/propertiesTrackers/") + mhash));
+ return new GetTorrentDetailsTaskSuccessResult((GetTorrentDetailsTask) task, parseJsonTorrentDetails(messages));
- case GetFileList:
+ case GetFileList:
- // Request files listing for a specific torrent
- String fhash = task.getTargetTorrent().getUniqueID();
- JSONArray files = new JSONArray(makeRequest(log, "/json/propertiesFiles/" + fhash));
- return new GetFileListTaskSuccessResult((GetFileListTask) task, parseJsonFiles(files));
+ // Request files listing for a specific torrent
+ String fhash = task.getTargetTorrent().getUniqueID();
+ JSONArray files =
+ new JSONArray(makeRequest(log, (version >= 30200 ? "/query/propertiesFiles/" : "/json/propertiesFiles/") + fhash));
+ return new GetFileListTaskSuccessResult((GetFileListTask) task, parseJsonFiles(files));
- case AddByFile:
+ case AddByFile:
- // Upload a local .torrent file
- String ufile = ((AddByFileTask) task).getFile();
- makeUploadRequest("/command/upload", ufile, log);
- return new DaemonTaskSuccessResult(task);
+ // Upload a local .torrent file
+ String ufile = ((AddByFileTask) task).getFile();
+ makeUploadRequest("/command/upload", ufile, log);
+ return new DaemonTaskSuccessResult(task);
- case AddByUrl:
+ case AddByUrl:
- // Request to add a torrent by URL
- String url = ((AddByUrlTask) task).getUrl();
- makeRequest(log, "/command/download", new BasicNameValuePair("urls", url));
- return new DaemonTaskSuccessResult(task);
+ // Request to add a torrent by URL
+ String url = ((AddByUrlTask) task).getUrl();
+ makeRequest(log, "/command/download", new BasicNameValuePair("urls", url));
+ return new DaemonTaskSuccessResult(task);
- case AddByMagnetUrl:
+ case AddByMagnetUrl:
- // Request to add a magnet link by URL
- String magnet = ((AddByMagnetUrlTask) task).getUrl();
- makeRequest(log, "/command/download", new BasicNameValuePair("urls", magnet));
- return new DaemonTaskSuccessResult(task);
+ // Request to add a magnet link by URL
+ String magnet = ((AddByMagnetUrlTask) task).getUrl();
+ makeRequest(log, "/command/download", new BasicNameValuePair("urls", magnet));
+ return new DaemonTaskSuccessResult(task);
- case Remove:
+ case Remove:
- // Remove a torrent
- RemoveTask removeTask = (RemoveTask) task;
- makeRequest(log, (removeTask.includingData() ? "/command/deletePerm" : "/command/delete"),
- new BasicNameValuePair("hashes", removeTask.getTargetTorrent().getUniqueID()));
- return new DaemonTaskSuccessResult(task);
+ // Remove a torrent
+ RemoveTask removeTask = (RemoveTask) task;
+ makeRequest(log, (removeTask.includingData() ? "/command/deletePerm" : "/command/delete"),
+ new BasicNameValuePair("hashes", removeTask.getTargetTorrent().getUniqueID()));
+ return new DaemonTaskSuccessResult(task);
- case Pause:
+ case Pause:
- // Pause a torrent
- makeRequest(log, "/command/pause", new BasicNameValuePair("hash", task.getTargetTorrent().getUniqueID()));
- return new DaemonTaskSuccessResult(task);
+ // Pause a torrent
+ makeRequest(log, "/command/pause", new BasicNameValuePair("hash", task.getTargetTorrent().getUniqueID()));
+ return new DaemonTaskSuccessResult(task);
- case PauseAll:
+ case PauseAll:
- // Resume all torrents
- makeRequest(log, "/command/pauseall");
- return new DaemonTaskSuccessResult(task);
+ // Resume all torrents
+ makeRequest(log, "/command/pauseall");
+ return new DaemonTaskSuccessResult(task);
- case Resume:
+ case Resume:
- // Resume a torrent
- makeRequest(log, "/command/resume", new BasicNameValuePair("hash", task.getTargetTorrent().getUniqueID()));
- return new DaemonTaskSuccessResult(task);
+ // Resume a torrent
+ makeRequest(log, "/command/resume", new BasicNameValuePair("hash", task.getTargetTorrent().getUniqueID()));
+ return new DaemonTaskSuccessResult(task);
- case ResumeAll:
+ case ResumeAll:
- // Resume all torrents
- makeRequest(log, "/command/resumeall");
- return new DaemonTaskSuccessResult(task);
+ // Resume all torrents
+ makeRequest(log, "/command/resumeall");
+ return new DaemonTaskSuccessResult(task);
- case SetFilePriorities:
+ case SetFilePriorities:
- // Update the priorities to a set of files
- SetFilePriorityTask setPrio = (SetFilePriorityTask) task;
- String newPrio = "0";
- if (setPrio.getNewPriority() == Priority.Low) {
- newPrio = "1";
- } else if (setPrio.getNewPriority() == Priority.Normal) {
- newPrio = "2";
- } else if (setPrio.getNewPriority() == Priority.High) {
- newPrio = "7";
- }
- // We have to make a separate request per file, it seems
- for (TorrentFile file : setPrio.getForFiles()) {
- makeRequest(log, "/command/setFilePrio", new BasicNameValuePair("hash", task.getTargetTorrent()
- .getUniqueID()), new BasicNameValuePair("id", file.getKey()), new BasicNameValuePair(
- "priority", newPrio));
- }
- return new DaemonTaskSuccessResult(task);
-
- case SetTransferRates:
-
- // TODO: This doesn't seem to work yet
- // Request to set the maximum transfer rates
- SetTransferRatesTask ratesTask = (SetTransferRatesTask) task;
- int dl = (ratesTask.getDownloadRate() == null ? -1 : ratesTask.getDownloadRate());
- int ul = (ratesTask.getUploadRate() == null ? -1 : ratesTask.getUploadRate());
-
- // First get the preferences
- JSONObject prefs = new JSONObject(makeRequest(log, "/json/preferences"));
- prefs.put("dl_limit", dl);
- prefs.put("up_limit", ul);
- makeRequest(log, "/command/setPreferences",
- new BasicNameValuePair("json", URLEncoder.encode(prefs.toString(), HTTP.UTF_8)));
- return new DaemonTaskSuccessResult(task);
-
- default:
- return new DaemonTaskFailureResult(task, new DaemonException(ExceptionType.MethodUnsupported,
- task.getMethod() + " is not supported by " + getType()));
+ // Update the priorities to a set of files
+ SetFilePriorityTask setPrio = (SetFilePriorityTask) task;
+ String newPrio = "0";
+ if (setPrio.getNewPriority() == Priority.Low) {
+ newPrio = "1";
+ } else if (setPrio.getNewPriority() == Priority.Normal) {
+ newPrio = "2";
+ } else if (setPrio.getNewPriority() == Priority.High) {
+ newPrio = "7";
+ }
+ // We have to make a separate request per file, it seems
+ for (TorrentFile file : setPrio.getForFiles()) {
+ makeRequest(log, "/command/setFilePrio", new BasicNameValuePair("hash", task.getTargetTorrent().getUniqueID()),
+ new BasicNameValuePair("id", file.getKey()), new BasicNameValuePair("priority", newPrio));
+ }
+ return new DaemonTaskSuccessResult(task);
+
+ case SetTransferRates:
+
+ // TODO: This doesn't seem to work yet
+ // Request to set the maximum transfer rates
+ SetTransferRatesTask ratesTask = (SetTransferRatesTask) task;
+ int dl = (ratesTask.getDownloadRate() == null ? -1 : ratesTask.getDownloadRate());
+ int ul = (ratesTask.getUploadRate() == null ? -1 : ratesTask.getUploadRate());
+
+ // First get the preferences
+ JSONObject prefs = new JSONObject(makeRequest(log, "/json/preferences"));
+ prefs.put("dl_limit", dl);
+ prefs.put("up_limit", ul);
+ makeRequest(log, "/command/setPreferences", new BasicNameValuePair("json", URLEncoder.encode(prefs.toString(), HTTP.UTF_8)));
+ return new DaemonTaskSuccessResult(task);
+
+ default:
+ return new DaemonTaskFailureResult(task,
+ new DaemonException(ExceptionType.MethodUnsupported, task.getMethod() + " is not supported by " + getType()));
}
} catch (JSONException e) {
return new DaemonTaskFailureResult(task, new DaemonException(ExceptionType.ParsingFailed, e.toString()));
@@ -264,7 +332,7 @@ public class QbittorrentAdapter implements IDaemonAdapter {
// Setup request using POST
HttpPost httppost = new HttpPost(buildWebUIUrl(path));
- List nvps = new ArrayList();
+ List nvps = new ArrayList<>();
Collections.addAll(nvps, params);
httppost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
return makeWebRequest(httppost, log);
@@ -282,7 +350,7 @@ public class QbittorrentAdapter implements IDaemonAdapter {
// Setup request using POST
HttpPost httppost = new HttpPost(buildWebUIUrl(path));
File upload = new File(URI.create(file));
- Part[] parts = { new FilePart("torrentfile", upload) };
+ Part[] parts = {new FilePart("torrentfile", upload)};
httppost.setEntity(new MultipartEntity(parts, httppost.getParams()));
return makeWebRequest(httppost, log);
@@ -347,8 +415,8 @@ public class QbittorrentAdapter implements IDaemonAdapter {
private TorrentDetails parseJsonTorrentDetails(JSONArray messages) throws JSONException {
- ArrayList trackers = new ArrayList();
- ArrayList errors = new ArrayList();
+ ArrayList trackers = new ArrayList<>();
+ ArrayList errors = new ArrayList<>();
// Parse response
if (messages.length() > 0) {
@@ -369,15 +437,27 @@ public class QbittorrentAdapter implements IDaemonAdapter {
private ArrayList parseJsonTorrents(JSONArray response) throws JSONException {
// Parse response
- ArrayList torrents = new ArrayList();
+ ArrayList torrents = new ArrayList<>();
for (int i = 0; i < response.length(); i++) {
JSONObject tor = response.getJSONObject(i);
int leechers[] = parsePeers(tor.getString("num_leechs"));
int seeders[] = parsePeers(tor.getString("num_seeds"));
- long size = parseSize(tor.getString("size"));
double ratio = parseRatio(tor.getString("ratio"));
double progress = tor.getDouble("progress");
- int dlspeed = parseSpeed(tor.getString("dlspeed"));
+ long size;
+ int dlspeed;
+ int upspeed;
+
+ if (apiVersion >= 2) {
+ size = tor.getLong("size");
+ dlspeed = tor.getInt("dlspeed");
+ upspeed = tor.getInt("upspeed");
+ } else {
+ size = parseSize(tor.getString("size"));
+ dlspeed = parseSpeed(tor.getString("dlspeed"));
+ upspeed = parseSpeed(tor.getString("upspeed"));
+ }
+
long eta = -1L;
if (dlspeed > 0)
eta = (long) (size - (size * progress)) / dlspeed;
@@ -391,7 +471,7 @@ public class QbittorrentAdapter implements IDaemonAdapter {
parseStatus(tor.getString("state")),
null,
dlspeed,
- parseSpeed(tor.getString("upspeed")),
+ upspeed,
seeders[0],
seeders[1],
leechers[0],
@@ -454,10 +534,9 @@ public class QbittorrentAdapter implements IDaemonAdapter {
// In some situations it it just a "6" string
String[] parts = seeds.split(" ");
if (parts.length > 1) {
- return new int[] { Integer.parseInt(parts[0]),
- Integer.parseInt(parts[1].substring(1, parts[1].length() - 1)) };
+ return new int[]{Integer.parseInt(parts[0]), Integer.parseInt(parts[1].substring(1, parts[1].length() - 1))};
}
- return new int[] { Integer.parseInt(parts[0]), Integer.parseInt(parts[0]) };
+ return new int[]{Integer.parseInt(parts[0]), Integer.parseInt(parts[0])};
}
private int parseSpeed(String speed) {
@@ -525,9 +604,16 @@ public class QbittorrentAdapter implements IDaemonAdapter {
ArrayList torrentfiles = new ArrayList();
for (int i = 0; i < response.length(); i++) {
JSONObject file = response.getJSONObject(i);
- long size = parseSize(file.getString("size"));
- torrentfiles.add(new TorrentFile("" + i, file.getString("name"), null, null, size, (long) (size * file
- .getDouble("progress")), parsePriority(file.getInt("priority"))));
+
+ long size;
+ if (apiVersion >= 2) {
+ size = file.getLong("size");
+ } else {
+ size = parseSize(file.getString("size"));
+ }
+
+ torrentfiles.add(new TorrentFile("" + i, file.getString("name"), null, null, size, (long) (size * file.getDouble("progress")),
+ parsePriority(file.getInt("priority"))));
}
// Return the list
diff --git a/app/src/main/java/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java b/app/src/main/java/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java
index c4ad22f3..8ee42de8 100644
--- a/app/src/main/java/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java
+++ b/app/src/main/java/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java
@@ -95,32 +95,32 @@ public class RtorrentAdapter implements IDaemonAdapter {
case Retrieve:
// @formatter:off
- Object result = makeRtorrentCall(log,"d.multicall",
- new String[] { "main",
- "d.get_hash=",
- "d.get_name=",
- "d.get_state=",
- "d.get_down_rate=",
- "d.get_up_rate=",
- "d.get_peers_connected=",
- "d.get_peers_not_connected=",
- "d.get_peers_accounted=",
- "d.get_bytes_done=",
- "d.get_up_total=",
- "d.get_size_bytes=",
- "d.get_creation_date=",
- "d.get_left_bytes=",
- "d.get_complete=",
+ Object result = makeRtorrentCall(log,"d.multicall2",
+ new String[] { "", "main",
+ "d.hash=",
+ "d.name=",
+ "d.state=",
+ "d.down.rate=",
+ "d.up.rate=",
+ "d.peers_connected=",
+ "d.peers_not_connected=",
+ "d.peers_accounted=",
+ "d.bytes_done=",
+ "d.up.total=",
+ "d.size_bytes=",
+ "d.creation_date=",
+ "d.left_bytes=",
+ "d.complete=",
"d.is_active=",
"d.is_hash_checking=",
- "d.get_base_path=",
- "d.get_base_filename=",
- "d.get_message=",
- "d.get_custom=addtime",
- "d.get_custom=seedingtime",
- "d.get_custom1=",
- "d.get_peers_complete=",
- "d.get_peers_accounted=" });
+ "d.base_path=",
+ "d.base_filename=",
+ "d.message=",
+ "d.custom=addtime",
+ "d.custom=seedingtime",
+ "d.custom1=",
+ "d.peers_complete=",
+ "d.peers_accounted=" });
// @formatter:on
return new RetrieveTaskSuccessResult((RetrieveTask) task, onTorrentsRetrieved(result),
lastKnownLabels);
@@ -131,7 +131,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
Object dresult = makeRtorrentCall(log,"t.multicall", new String[] {
task.getTargetTorrent().getUniqueID(),
"",
- "t.get_url=" });
+ "t.url=" });
// @formatter:on
return new GetTorrentDetailsTaskSuccessResult((GetTorrentDetailsTask) task,
onTorrentDetailsRetrieved(log, dresult));
@@ -142,13 +142,13 @@ public class RtorrentAdapter implements IDaemonAdapter {
Object fresult = makeRtorrentCall(log,"f.multicall", new String[] {
task.getTargetTorrent().getUniqueID(),
"",
- "f.get_path=",
- "f.get_size_bytes=",
- "f.get_priority=",
- "f.get_completed_chunks=",
- "f.get_size_chunks=",
- "f.get_priority=",
- "f.get_frozen_path=" });
+ "f.path=",
+ "f.size_bytes=",
+ "f.priority=",
+ "f.completed_chunks=",
+ "f.size_chunks=",
+ "f.priority=",
+ "f.frozen_path=" });
// @formatter:on
return new GetFileListTaskSuccessResult((GetFileListTask) task,
onTorrentFilesRetrieved(fresult, task.getTargetTorrent()));
@@ -167,22 +167,22 @@ public class RtorrentAdapter implements IDaemonAdapter {
byte[] bytes = baos.toByteArray();
int size = (int) file.length() * 2;
final int XMLRPC_EXTRA_PADDING = 1280;
- makeRtorrentCall(log, "set_xmlrpc_size_limit", new Object[]{size + XMLRPC_EXTRA_PADDING});
- makeRtorrentCall(log, "load_raw_start", new Object[]{bytes});
+ makeRtorrentCall(log, "network.xmlrpc.size_limit.set", new Object[]{size + XMLRPC_EXTRA_PADDING});
+ makeRtorrentCall(log, "load.raw_start", new Object[]{bytes});
return new DaemonTaskSuccessResult(task);
case AddByUrl:
// Request to add a torrent by URL
String url = ((AddByUrlTask) task).getUrl();
- makeRtorrentCall(log, "load_start", new String[]{url});
+ makeRtorrentCall(log, "load.start", new String[]{"",url});
return new DaemonTaskSuccessResult(task);
case AddByMagnetUrl:
// Request to add a magnet link by URL
String magnet = ((AddByMagnetUrlTask) task).getUrl();
- makeRtorrentCall(log, "load_start", new String[]{magnet});
+ makeRtorrentCall(log, "load.start", new String[]{"",magnet});
return new DaemonTaskSuccessResult(task);
case Remove:
@@ -190,7 +190,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
// Remove a torrent
RemoveTask removeTask = (RemoveTask) task;
if (removeTask.includingData()) {
- makeRtorrentCall(log, "d.set_custom5",
+ makeRtorrentCall(log, "d.custom5.set",
new String[]{task.getTargetTorrent().getUniqueID(), "1"});
}
makeRtorrentCall(log, "d.erase", new String[]{task.getTargetTorrent().getUniqueID()});
@@ -205,7 +205,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
case PauseAll:
// Resume all torrents
- makeRtorrentCall(log, "d.multicall", new String[]{"main", "d.pause="});
+ makeRtorrentCall(log, "d.multicall2", new String[]{"","main", "d.pause="});
return new DaemonTaskSuccessResult(task);
case Resume:
@@ -217,7 +217,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
case ResumeAll:
// Resume all torrents
- makeRtorrentCall(log, "d.multicall", new String[]{"main", "d.resume="});
+ makeRtorrentCall(log, "d.multicall2", new String[]{"", "main", "d.resume="});
return new DaemonTaskSuccessResult(task);
case Stop:
@@ -229,7 +229,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
case StopAll:
// Stop all torrents
- makeRtorrentCall(log, "d.multicall", new String[]{"main", "d.stop="});
+ makeRtorrentCall(log, "d.multicall2", new String[]{"", "main", "d.stop="});
return new DaemonTaskSuccessResult(task);
case Start:
@@ -241,7 +241,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
case StartAll:
// Start all torrents
- makeRtorrentCall(log, "d.multicall", new String[]{"main", "d.start="});
+ makeRtorrentCall(log, "d.multicall2", new String[]{"", "main", "d.start="});
return new DaemonTaskSuccessResult(task);
case SetFilePriorities:
@@ -251,7 +251,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
String newPriority = "" + convertPriority(prioTask.getNewPriority());
// One at a time; rTorrent doesn't seem to support a multicall on a selective number of files
for (TorrentFile forFile : prioTask.getForFiles()) {
- makeRtorrentCall(log, "f.set_priority",
+ makeRtorrentCall(log, "f.priority.set",
new String[]{task.getTargetTorrent().getUniqueID() + ":f" + forFile.getKey(),
newPriority});
}
@@ -261,16 +261,16 @@ public class RtorrentAdapter implements IDaemonAdapter {
// Request to set the maximum transfer rates
SetTransferRatesTask ratesTask = (SetTransferRatesTask) task;
- makeRtorrentCall(log, "set_download_rate", new String[]{(ratesTask.getDownloadRate() == null ? "0" :
+ makeRtorrentCall(log, "throttle.global_down.max_rate.set", new String[]{"",(ratesTask.getDownloadRate() == null ? "0" :
ratesTask.getDownloadRate().toString() + "k")});
- makeRtorrentCall(log, "set_upload_rate", new String[]{
+ makeRtorrentCall(log, "throttle.global_up.max_rate.set", new String[]{"",
(ratesTask.getUploadRate() == null ? "0" : ratesTask.getUploadRate().toString() + "k")});
return new DaemonTaskSuccessResult(task);
case SetLabel:
SetLabelTask labelTask = (SetLabelTask) task;
- makeRtorrentCall(log, "d.set_custom1",
+ makeRtorrentCall(log, "d.custom1.set",
new String[]{task.getTargetTorrent().getUniqueID(), labelTask.getNewLabel()});
return new DaemonTaskSuccessResult(task);
diff --git a/app/src/main/java/org/transdroid/daemon/util/HttpHelper.java b/app/src/main/java/org/transdroid/daemon/util/HttpHelper.java
index 90a2db9e..309b4ff1 100644
--- a/app/src/main/java/org/transdroid/daemon/util/HttpHelper.java
+++ b/app/src/main/java/org/transdroid/daemon/util/HttpHelper.java
@@ -130,7 +130,7 @@ public class HttpHelper {
// Register http and https sockets
SchemeRegistry registry = new SchemeRegistry();
SocketFactory httpsSocketFactory;
- if (sslTrustKey != null) {
+ if (sslTrustKey != null && sslTrustKey.length() != 0) {
httpsSocketFactory = new TlsSniSocketFactory(sslTrustKey);
} else if (sslTrustAll) {
httpsSocketFactory = new TlsSniSocketFactory(true);
diff --git a/app/src/main/res/drawable-hdpi/ab_bottom_solid_transdroid.9.png b/app/src/main/res/drawable-hdpi/ab_bottom_solid_transdroid.9.png
deleted file mode 100644
index 64793735..00000000
Binary files a/app/src/main/res/drawable-hdpi/ab_bottom_solid_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ab_bottom_solid_transdroid2.9.png b/app/src/main/res/drawable-hdpi/ab_bottom_solid_transdroid2.9.png
deleted file mode 100644
index af25e462..00000000
Binary files a/app/src/main/res/drawable-hdpi/ab_bottom_solid_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ab_solid_transdroid.9.png b/app/src/main/res/drawable-hdpi/ab_solid_transdroid.9.png
deleted file mode 100644
index 12ece624..00000000
Binary files a/app/src/main/res/drawable-hdpi/ab_solid_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ab_solid_transdroid2.9.png b/app/src/main/res/drawable-hdpi/ab_solid_transdroid2.9.png
deleted file mode 100644
index 6344cbc2..00000000
Binary files a/app/src/main/res/drawable-hdpi/ab_solid_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ab_stacked_solid_transdroid.9.png b/app/src/main/res/drawable-hdpi/ab_stacked_solid_transdroid.9.png
deleted file mode 100644
index 005445ac..00000000
Binary files a/app/src/main/res/drawable-hdpi/ab_stacked_solid_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ab_stacked_solid_transdroid2.9.png b/app/src/main/res/drawable-hdpi/ab_stacked_solid_transdroid2.9.png
deleted file mode 100644
index a48652d3..00000000
Binary files a/app/src/main/res/drawable-hdpi/ab_stacked_solid_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ab_texture_tile_transdroid2.png b/app/src/main/res/drawable-hdpi/ab_texture_tile_transdroid2.png
deleted file mode 100644
index 87cc8211..00000000
Binary files a/app/src/main/res/drawable-hdpi/ab_texture_tile_transdroid2.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ab_transparent_transdroid.9.png b/app/src/main/res/drawable-hdpi/ab_transparent_transdroid.9.png
deleted file mode 100644
index fc241b9f..00000000
Binary files a/app/src/main/res/drawable-hdpi/ab_transparent_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ab_transparent_transdroid2.9.png b/app/src/main/res/drawable-hdpi/ab_transparent_transdroid2.9.png
deleted file mode 100644
index e517f83b..00000000
Binary files a/app/src/main/res/drawable-hdpi/ab_transparent_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/abc_list_focused_holo.9.png b/app/src/main/res/drawable-hdpi/abc_list_focused_holo.9.png
deleted file mode 100644
index 55527084..00000000
Binary files a/app/src/main/res/drawable-hdpi/abc_list_focused_holo.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/abc_list_longpressed_holo.9.png b/app/src/main/res/drawable-hdpi/abc_list_longpressed_holo.9.png
deleted file mode 100644
index 4ea7afa0..00000000
Binary files a/app/src/main/res/drawable-hdpi/abc_list_longpressed_holo.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/abc_list_pressed_holo_dark.9.png b/app/src/main/res/drawable-hdpi/abc_list_pressed_holo_dark.9.png
deleted file mode 100644
index 5654cd69..00000000
Binary files a/app/src/main/res/drawable-hdpi/abc_list_pressed_holo_dark.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/abc_list_pressed_holo_light.9.png b/app/src/main/res/drawable-hdpi/abc_list_pressed_holo_light.9.png
deleted file mode 100644
index 5654cd69..00000000
Binary files a/app/src/main/res/drawable-hdpi/abc_list_pressed_holo_light.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/abc_list_selector_disabled_holo_dark.9.png b/app/src/main/res/drawable-hdpi/abc_list_selector_disabled_holo_dark.9.png
deleted file mode 100644
index f6fd30dc..00000000
Binary files a/app/src/main/res/drawable-hdpi/abc_list_selector_disabled_holo_dark.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/abc_list_selector_disabled_holo_light.9.png b/app/src/main/res/drawable-hdpi/abc_list_selector_disabled_holo_light.9.png
deleted file mode 100644
index ca8e9a27..00000000
Binary files a/app/src/main/res/drawable-hdpi/abc_list_selector_disabled_holo_light.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/btn_cab_done_default_transdroid2.9.png b/app/src/main/res/drawable-hdpi/btn_cab_done_default_transdroid2.9.png
deleted file mode 100644
index fc6944ea..00000000
Binary files a/app/src/main/res/drawable-hdpi/btn_cab_done_default_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/btn_cab_done_focused_transdroid2.9.png b/app/src/main/res/drawable-hdpi/btn_cab_done_focused_transdroid2.9.png
deleted file mode 100644
index 72a72d8b..00000000
Binary files a/app/src/main/res/drawable-hdpi/btn_cab_done_focused_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/btn_cab_done_pressed_transdroid2.9.png b/app/src/main/res/drawable-hdpi/btn_cab_done_pressed_transdroid2.9.png
deleted file mode 100644
index 8c69a5cf..00000000
Binary files a/app/src/main/res/drawable-hdpi/btn_cab_done_pressed_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/cab_background_bottom_transdroid2.9.png b/app/src/main/res/drawable-hdpi/cab_background_bottom_transdroid2.9.png
deleted file mode 100644
index d61abca3..00000000
Binary files a/app/src/main/res/drawable-hdpi/cab_background_bottom_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/cab_background_top_transdroid2.9.png b/app/src/main/res/drawable-hdpi/cab_background_top_transdroid2.9.png
deleted file mode 100644
index 6bc2078c..00000000
Binary files a/app/src/main/res/drawable-hdpi/cab_background_top_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_add.png b/app/src/main/res/drawable-hdpi/ic_action_add.png
new file mode 100755
index 00000000..481643ec
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_add.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_barcode.png b/app/src/main/res/drawable-hdpi/ic_action_barcode.png
new file mode 100644
index 00000000..d08b52a5
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_barcode.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_copy.png b/app/src/main/res/drawable-hdpi/ic_action_copy.png
new file mode 100755
index 00000000..03b1aac4
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_copy.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_discard_dark.png b/app/src/main/res/drawable-hdpi/ic_action_discard_dark.png
deleted file mode 100644
index ffd19d9e..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_discard_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_discard_light.png b/app/src/main/res/drawable-hdpi/ic_action_discard_light.png
deleted file mode 100644
index e9ce89e0..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_discard_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_done.png b/app/src/main/res/drawable-hdpi/ic_action_done.png
new file mode 100755
index 00000000..f42a0e2d
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_done.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_done_dark.png b/app/src/main/res/drawable-hdpi/ic_action_done_dark.png
deleted file mode 100644
index 53cf6877..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_done_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_done_light.png b/app/src/main/res/drawable-hdpi/ic_action_done_light.png
deleted file mode 100644
index 58bf9721..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_done_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_download.png b/app/src/main/res/drawable-hdpi/ic_action_download.png
new file mode 100755
index 00000000..46aeab45
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_download.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_drawer.png b/app/src/main/res/drawable-hdpi/ic_action_drawer.png
new file mode 100755
index 00000000..2e9f9153
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_drawer.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_file.png b/app/src/main/res/drawable-hdpi/ic_action_file.png
new file mode 100755
index 00000000..53d60bce
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_file.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_filter.png b/app/src/main/res/drawable-hdpi/ic_action_filter.png
new file mode 100755
index 00000000..aa516403
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_filter.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_filter_dark.png b/app/src/main/res/drawable-hdpi/ic_action_filter_dark.png
deleted file mode 100644
index afca489b..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_filter_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_filter_light.png b/app/src/main/res/drawable-hdpi/ic_action_filter_light.png
deleted file mode 100644
index 5a286103..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_filter_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_force_recheck.png b/app/src/main/res/drawable-hdpi/ic_action_force_recheck.png
new file mode 100755
index 00000000..1f6f7727
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_force_recheck.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_forcerecheck_dark.png b/app/src/main/res/drawable-hdpi/ic_action_forcerecheck_dark.png
deleted file mode 100755
index 66c441b4..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_forcerecheck_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_forcerecheck_light.png b/app/src/main/res/drawable-hdpi/ic_action_forcerecheck_light.png
deleted file mode 100755
index a7e8db88..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_forcerecheck_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_info.png b/app/src/main/res/drawable-hdpi/ic_action_info.png
new file mode 100755
index 00000000..d128e557
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_info.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_info_dark.png b/app/src/main/res/drawable-hdpi/ic_action_info_dark.png
deleted file mode 100755
index 2bc2c0c1..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_info_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_info_light.png b/app/src/main/res/drawable-hdpi/ic_action_info_light.png
deleted file mode 100755
index 3e1f5b43..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_info_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_labels.png b/app/src/main/res/drawable-hdpi/ic_action_labels.png
new file mode 100755
index 00000000..b52ac944
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_labels.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_labels_dark.png b/app/src/main/res/drawable-hdpi/ic_action_labels_dark.png
deleted file mode 100644
index 432e7c00..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_labels_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_labels_light.png b/app/src/main/res/drawable-hdpi/ic_action_labels_light.png
deleted file mode 100644
index 9b093a67..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_labels_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_link.png b/app/src/main/res/drawable-hdpi/ic_action_link.png
new file mode 100755
index 00000000..4186e00c
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_link.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_new_dark.png b/app/src/main/res/drawable-hdpi/ic_action_new_dark.png
deleted file mode 100644
index ad8ada6b..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_new_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_new_light.png b/app/src/main/res/drawable-hdpi/ic_action_new_light.png
deleted file mode 100644
index 5741995c..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_new_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_pause.png b/app/src/main/res/drawable-hdpi/ic_action_pause.png
new file mode 100755
index 00000000..b4bdbb55
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_pause.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_pause_dark.png b/app/src/main/res/drawable-hdpi/ic_action_pause_dark.png
deleted file mode 100644
index 6b435bb0..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_pause_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_pause_light.png b/app/src/main/res/drawable-hdpi/ic_action_pause_light.png
deleted file mode 100644
index 9661cfbb..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_pause_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_priority_high.png b/app/src/main/res/drawable-hdpi/ic_action_priority_high.png
new file mode 100644
index 00000000..b000cc1e
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_priority_high.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_priority_high_dark.png b/app/src/main/res/drawable-hdpi/ic_action_priority_high_dark.png
deleted file mode 100644
index 84478f76..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_priority_high_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_priority_high_light.png b/app/src/main/res/drawable-hdpi/ic_action_priority_high_light.png
deleted file mode 100644
index 4edf7a36..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_priority_high_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_priority_low.png b/app/src/main/res/drawable-hdpi/ic_action_priority_low.png
new file mode 100644
index 00000000..1f3e40e3
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_priority_low.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_priority_low_dark.png b/app/src/main/res/drawable-hdpi/ic_action_priority_low_dark.png
deleted file mode 100644
index 8802cad4..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_priority_low_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_priority_low_light.png b/app/src/main/res/drawable-hdpi/ic_action_priority_low_light.png
deleted file mode 100644
index 23ada0ca..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_priority_low_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_priority_medium.png b/app/src/main/res/drawable-hdpi/ic_action_priority_medium.png
new file mode 100644
index 00000000..58e1b2c1
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_priority_medium.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_priority_normal_dark.png b/app/src/main/res/drawable-hdpi/ic_action_priority_normal_dark.png
deleted file mode 100644
index 7f7890f2..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_priority_normal_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_priority_normal_light.png b/app/src/main/res/drawable-hdpi/ic_action_priority_normal_light.png
deleted file mode 100644
index 0246a1b7..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_priority_normal_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_priority_off.png b/app/src/main/res/drawable-hdpi/ic_action_priority_off.png
new file mode 100644
index 00000000..3800230c
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_priority_off.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_priority_off_dark.png b/app/src/main/res/drawable-hdpi/ic_action_priority_off_dark.png
deleted file mode 100644
index ab37b556..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_priority_off_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_priority_off_light.png b/app/src/main/res/drawable-hdpi/ic_action_priority_off_light.png
deleted file mode 100644
index 7bf6101d..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_priority_off_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_refresh.png b/app/src/main/res/drawable-hdpi/ic_action_refresh.png
new file mode 100755
index 00000000..cd16fdd5
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_refresh.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_refresh_dark.png b/app/src/main/res/drawable-hdpi/ic_action_refresh_dark.png
deleted file mode 100644
index bb9d855f..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_refresh_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_refresh_light.png b/app/src/main/res/drawable-hdpi/ic_action_refresh_light.png
deleted file mode 100644
index 479aca46..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_refresh_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_remove.png b/app/src/main/res/drawable-hdpi/ic_action_remove.png
new file mode 100755
index 00000000..a9eac0ca
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_remove.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_remove_dark.png b/app/src/main/res/drawable-hdpi/ic_action_remove_dark.png
deleted file mode 100644
index 094eea58..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_remove_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_remove_light.png b/app/src/main/res/drawable-hdpi/ic_action_remove_light.png
deleted file mode 100644
index cde36e1f..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_remove_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_resume.png b/app/src/main/res/drawable-hdpi/ic_action_resume.png
new file mode 100755
index 00000000..03a54ee7
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_resume.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_resume_dark.png b/app/src/main/res/drawable-hdpi/ic_action_resume_dark.png
deleted file mode 100644
index 738aae1a..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_resume_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_resume_light.png b/app/src/main/res/drawable-hdpi/ic_action_resume_light.png
deleted file mode 100644
index b4f692fc..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_resume_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_rss.png b/app/src/main/res/drawable-hdpi/ic_action_rss.png
new file mode 100644
index 00000000..d94642a2
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_rss.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_rss_dark.png b/app/src/main/res/drawable-hdpi/ic_action_rss_dark.png
deleted file mode 100644
index 02ec51ef..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_rss_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_rss_light.png b/app/src/main/res/drawable-hdpi/ic_action_rss_light.png
deleted file mode 100644
index 6aa10203..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_rss_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_save.png b/app/src/main/res/drawable-hdpi/ic_action_save.png
new file mode 100755
index 00000000..8c9e9cec
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_save.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_save_dark.png b/app/src/main/res/drawable-hdpi/ic_action_save_dark.png
deleted file mode 100644
index 0fe36a1e..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_save_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_save_light.png b/app/src/main/res/drawable-hdpi/ic_action_save_light.png
deleted file mode 100644
index c4b7783c..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_save_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_search.png b/app/src/main/res/drawable-hdpi/ic_action_search.png
new file mode 100755
index 00000000..a2fc5b2e
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_search.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_search_dark.png b/app/src/main/res/drawable-hdpi/ic_action_search_dark.png
deleted file mode 100644
index f12e005e..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_search_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_search_light.png b/app/src/main/res/drawable-hdpi/ic_action_search_light.png
deleted file mode 100644
index e6b70451..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_search_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_sort.png b/app/src/main/res/drawable-hdpi/ic_action_sort.png
new file mode 100755
index 00000000..25c2dad6
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_sort.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_sort_by_size_dark.png b/app/src/main/res/drawable-hdpi/ic_action_sort_by_size_dark.png
deleted file mode 100644
index cbb5f451..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_sort_by_size_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_sort_by_size_light.png b/app/src/main/res/drawable-hdpi/ic_action_sort_by_size_light.png
deleted file mode 100644
index 3b34aaf8..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_sort_by_size_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_start.png b/app/src/main/res/drawable-hdpi/ic_action_start.png
new file mode 100755
index 00000000..164385d0
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_start.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_start_dark.png b/app/src/main/res/drawable-hdpi/ic_action_start_dark.png
deleted file mode 100644
index df8a2ca2..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_start_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_start_light.png b/app/src/main/res/drawable-hdpi/ic_action_start_light.png
deleted file mode 100644
index e70f0413..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_start_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_stop.png b/app/src/main/res/drawable-hdpi/ic_action_stop.png
new file mode 100755
index 00000000..135d367c
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_stop.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_stop_dark.png b/app/src/main/res/drawable-hdpi/ic_action_stop_dark.png
deleted file mode 100644
index dd5d6a1c..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_stop_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_stop_light.png b/app/src/main/res/drawable-hdpi/ic_action_stop_light.png
deleted file mode 100644
index 9c2f96da..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_stop_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_trackers.png b/app/src/main/res/drawable-hdpi/ic_action_trackers.png
new file mode 100755
index 00000000..60ae0f1d
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_trackers.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_trackers_dark.png b/app/src/main/res/drawable-hdpi/ic_action_trackers_dark.png
deleted file mode 100644
index 97231b91..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_trackers_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_trackers_light.png b/app/src/main/res/drawable-hdpi/ic_action_trackers_light.png
deleted file mode 100644
index 89fa0cd0..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_trackers_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_turtle_disabled.png b/app/src/main/res/drawable-hdpi/ic_action_turtle_disabled.png
new file mode 100644
index 00000000..deb0dc4c
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_turtle_disabled.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_turtle_disabled_light.png b/app/src/main/res/drawable-hdpi/ic_action_turtle_disabled_light.png
deleted file mode 100644
index a99cd104..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_turtle_disabled_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_turtle_enabled.png b/app/src/main/res/drawable-hdpi/ic_action_turtle_enabled.png
index 1532eb39..801397db 100644
Binary files a/app/src/main/res/drawable-hdpi/ic_action_turtle_enabled.png and b/app/src/main/res/drawable-hdpi/ic_action_turtle_enabled.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_website_dark.png b/app/src/main/res/drawable-hdpi/ic_action_website_dark.png
deleted file mode 100644
index e154afdb..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_website_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_website_light.png b/app/src/main/res/drawable-hdpi/ic_action_website_light.png
deleted file mode 100644
index 6a2bc885..00000000
Binary files a/app/src/main/res/drawable-hdpi/ic_action_website_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_empty_details_dark.png b/app/src/main/res/drawable-hdpi/ic_empty_details_dark.png
index 718615e5..d5b04b0d 100644
Binary files a/app/src/main/res/drawable-hdpi/ic_empty_details_dark.png and b/app/src/main/res/drawable-hdpi/ic_empty_details_dark.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_empty_details_light.png b/app/src/main/res/drawable-hdpi/ic_empty_details_light.png
index 6a1b5aa9..3580a27e 100644
Binary files a/app/src/main/res/drawable-hdpi/ic_empty_details_light.png and b/app/src/main/res/drawable-hdpi/ic_empty_details_light.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_launcher.png b/app/src/main/res/drawable-hdpi/ic_launcher.png
index d6181101..ec31e810 100644
Binary files a/app/src/main/res/drawable-hdpi/ic_launcher.png and b/app/src/main/res/drawable-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/drawable-hdpi/list_focused.9.png b/app/src/main/res/drawable-hdpi/list_focused.9.png
new file mode 100755
index 00000000..956dc975
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/list_focused.9.png differ
diff --git a/app/src/main/res/drawable-hdpi/list_focused_transdroid.9.png b/app/src/main/res/drawable-hdpi/list_focused_transdroid.9.png
deleted file mode 100644
index b342ccbb..00000000
Binary files a/app/src/main/res/drawable-hdpi/list_focused_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/list_focused_transdroid2.9.png b/app/src/main/res/drawable-hdpi/list_focused_transdroid2.9.png
deleted file mode 100644
index 411da949..00000000
Binary files a/app/src/main/res/drawable-hdpi/list_focused_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/list_pressed.9.png b/app/src/main/res/drawable-hdpi/list_pressed.9.png
new file mode 100755
index 00000000..7ca36255
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/list_pressed.9.png differ
diff --git a/app/src/main/res/drawable-hdpi/menu_dropdown_panel_transdroid.9.png b/app/src/main/res/drawable-hdpi/menu_dropdown_panel_transdroid.9.png
deleted file mode 100644
index bab5e3ba..00000000
Binary files a/app/src/main/res/drawable-hdpi/menu_dropdown_panel_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/menu_dropdown_panel_transdroid2.9.png b/app/src/main/res/drawable-hdpi/menu_dropdown_panel_transdroid2.9.png
deleted file mode 100644
index a1148598..00000000
Binary files a/app/src/main/res/drawable-hdpi/menu_dropdown_panel_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/menu_hardkey_panel_transdroid.9.png b/app/src/main/res/drawable-hdpi/menu_hardkey_panel_transdroid.9.png
deleted file mode 100644
index 40a8f3eb..00000000
Binary files a/app/src/main/res/drawable-hdpi/menu_hardkey_panel_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/progress_bg_transdroid.9.png b/app/src/main/res/drawable-hdpi/progress_bg_transdroid.9.png
deleted file mode 100644
index 3d5c707d..00000000
Binary files a/app/src/main/res/drawable-hdpi/progress_bg_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/progress_bg_transdroid2.9.png b/app/src/main/res/drawable-hdpi/progress_bg_transdroid2.9.png
deleted file mode 100644
index 3b183e07..00000000
Binary files a/app/src/main/res/drawable-hdpi/progress_bg_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/progress_primary_transdroid.9.png b/app/src/main/res/drawable-hdpi/progress_primary_transdroid.9.png
deleted file mode 100644
index 44a3c436..00000000
Binary files a/app/src/main/res/drawable-hdpi/progress_primary_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/progress_primary_transdroid2.9.png b/app/src/main/res/drawable-hdpi/progress_primary_transdroid2.9.png
deleted file mode 100644
index 8a6b5208..00000000
Binary files a/app/src/main/res/drawable-hdpi/progress_primary_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/progress_secondary_transdroid.9.png b/app/src/main/res/drawable-hdpi/progress_secondary_transdroid.9.png
deleted file mode 100644
index 32196b2b..00000000
Binary files a/app/src/main/res/drawable-hdpi/progress_secondary_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/progress_secondary_transdroid2.9.png b/app/src/main/res/drawable-hdpi/progress_secondary_transdroid2.9.png
deleted file mode 100644
index 34d2c6ea..00000000
Binary files a/app/src/main/res/drawable-hdpi/progress_secondary_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/spinner_ab_default_transdroid.9.png b/app/src/main/res/drawable-hdpi/spinner_ab_default_transdroid.9.png
deleted file mode 100644
index 4fd4aeba..00000000
Binary files a/app/src/main/res/drawable-hdpi/spinner_ab_default_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/spinner_ab_default_transdroid2.9.png b/app/src/main/res/drawable-hdpi/spinner_ab_default_transdroid2.9.png
deleted file mode 100644
index e518eb7d..00000000
Binary files a/app/src/main/res/drawable-hdpi/spinner_ab_default_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/spinner_ab_disabled_transdroid.9.png b/app/src/main/res/drawable-hdpi/spinner_ab_disabled_transdroid.9.png
deleted file mode 100644
index d42c97b8..00000000
Binary files a/app/src/main/res/drawable-hdpi/spinner_ab_disabled_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/spinner_ab_disabled_transdroid2.9.png b/app/src/main/res/drawable-hdpi/spinner_ab_disabled_transdroid2.9.png
deleted file mode 100644
index b6febf96..00000000
Binary files a/app/src/main/res/drawable-hdpi/spinner_ab_disabled_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/spinner_ab_focused_transdroid.9.png b/app/src/main/res/drawable-hdpi/spinner_ab_focused_transdroid.9.png
deleted file mode 100644
index 4761bd26..00000000
Binary files a/app/src/main/res/drawable-hdpi/spinner_ab_focused_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/spinner_ab_focused_transdroid2.9.png b/app/src/main/res/drawable-hdpi/spinner_ab_focused_transdroid2.9.png
deleted file mode 100644
index 544ae6ae..00000000
Binary files a/app/src/main/res/drawable-hdpi/spinner_ab_focused_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/spinner_ab_pressed_transdroid.9.png b/app/src/main/res/drawable-hdpi/spinner_ab_pressed_transdroid.9.png
deleted file mode 100644
index bddc913e..00000000
Binary files a/app/src/main/res/drawable-hdpi/spinner_ab_pressed_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/spinner_ab_pressed_transdroid2.9.png b/app/src/main/res/drawable-hdpi/spinner_ab_pressed_transdroid2.9.png
deleted file mode 100644
index 7d207c52..00000000
Binary files a/app/src/main/res/drawable-hdpi/spinner_ab_pressed_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/tab_selected_focused_transdroid.9.png b/app/src/main/res/drawable-hdpi/tab_selected_focused_transdroid.9.png
deleted file mode 100644
index 36fec49a..00000000
Binary files a/app/src/main/res/drawable-hdpi/tab_selected_focused_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/tab_selected_focused_transdroid2.9.png b/app/src/main/res/drawable-hdpi/tab_selected_focused_transdroid2.9.png
deleted file mode 100644
index 15e12068..00000000
Binary files a/app/src/main/res/drawable-hdpi/tab_selected_focused_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/tab_selected_pressed_transdroid.9.png b/app/src/main/res/drawable-hdpi/tab_selected_pressed_transdroid.9.png
deleted file mode 100644
index aa07ad6f..00000000
Binary files a/app/src/main/res/drawable-hdpi/tab_selected_pressed_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/tab_selected_pressed_transdroid2.9.png b/app/src/main/res/drawable-hdpi/tab_selected_pressed_transdroid2.9.png
deleted file mode 100644
index cca1aeb2..00000000
Binary files a/app/src/main/res/drawable-hdpi/tab_selected_pressed_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/tab_selected_transdroid.9.png b/app/src/main/res/drawable-hdpi/tab_selected_transdroid.9.png
deleted file mode 100644
index d59bde58..00000000
Binary files a/app/src/main/res/drawable-hdpi/tab_selected_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/tab_selected_transdroid2.9.png b/app/src/main/res/drawable-hdpi/tab_selected_transdroid2.9.png
deleted file mode 100644
index ca828066..00000000
Binary files a/app/src/main/res/drawable-hdpi/tab_selected_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/tab_unselected_focused_transdroid.9.png b/app/src/main/res/drawable-hdpi/tab_unselected_focused_transdroid.9.png
deleted file mode 100644
index 40613b47..00000000
Binary files a/app/src/main/res/drawable-hdpi/tab_unselected_focused_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/tab_unselected_focused_transdroid2.9.png b/app/src/main/res/drawable-hdpi/tab_unselected_focused_transdroid2.9.png
deleted file mode 100644
index d8ed7709..00000000
Binary files a/app/src/main/res/drawable-hdpi/tab_unselected_focused_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/tab_unselected_pressed_transdroid.9.png b/app/src/main/res/drawable-hdpi/tab_unselected_pressed_transdroid.9.png
deleted file mode 100644
index ef83039c..00000000
Binary files a/app/src/main/res/drawable-hdpi/tab_unselected_pressed_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/tab_unselected_pressed_transdroid2.9.png b/app/src/main/res/drawable-hdpi/tab_unselected_pressed_transdroid2.9.png
deleted file mode 100644
index bd9026bc..00000000
Binary files a/app/src/main/res/drawable-hdpi/tab_unselected_pressed_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/tab_unselected_transdroid2.9.png b/app/src/main/res/drawable-hdpi/tab_unselected_transdroid2.9.png
deleted file mode 100644
index c442c393..00000000
Binary files a/app/src/main/res/drawable-hdpi/tab_unselected_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ab_bottom_solid_transdroid.9.png b/app/src/main/res/drawable-mdpi/ab_bottom_solid_transdroid.9.png
deleted file mode 100644
index 135904dc..00000000
Binary files a/app/src/main/res/drawable-mdpi/ab_bottom_solid_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ab_bottom_solid_transdroid2.9.png b/app/src/main/res/drawable-mdpi/ab_bottom_solid_transdroid2.9.png
deleted file mode 100644
index 77ef47fe..00000000
Binary files a/app/src/main/res/drawable-mdpi/ab_bottom_solid_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ab_solid_transdroid.9.png b/app/src/main/res/drawable-mdpi/ab_solid_transdroid.9.png
deleted file mode 100644
index fa3d4284..00000000
Binary files a/app/src/main/res/drawable-mdpi/ab_solid_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ab_solid_transdroid2.9.png b/app/src/main/res/drawable-mdpi/ab_solid_transdroid2.9.png
deleted file mode 100644
index 9b1e02aa..00000000
Binary files a/app/src/main/res/drawable-mdpi/ab_solid_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ab_stacked_solid_transdroid.9.png b/app/src/main/res/drawable-mdpi/ab_stacked_solid_transdroid.9.png
deleted file mode 100644
index fd09cb18..00000000
Binary files a/app/src/main/res/drawable-mdpi/ab_stacked_solid_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ab_stacked_solid_transdroid2.9.png b/app/src/main/res/drawable-mdpi/ab_stacked_solid_transdroid2.9.png
deleted file mode 100644
index 3c78f52c..00000000
Binary files a/app/src/main/res/drawable-mdpi/ab_stacked_solid_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ab_texture_tile_transdroid2.png b/app/src/main/res/drawable-mdpi/ab_texture_tile_transdroid2.png
deleted file mode 100644
index 87cc8211..00000000
Binary files a/app/src/main/res/drawable-mdpi/ab_texture_tile_transdroid2.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ab_transparent_transdroid.9.png b/app/src/main/res/drawable-mdpi/ab_transparent_transdroid.9.png
deleted file mode 100644
index 8c3b514f..00000000
Binary files a/app/src/main/res/drawable-mdpi/ab_transparent_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ab_transparent_transdroid2.9.png b/app/src/main/res/drawable-mdpi/ab_transparent_transdroid2.9.png
deleted file mode 100644
index f24375ca..00000000
Binary files a/app/src/main/res/drawable-mdpi/ab_transparent_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/abc_list_focused_holo.9.png b/app/src/main/res/drawable-mdpi/abc_list_focused_holo.9.png
deleted file mode 100644
index 00f05d8c..00000000
Binary files a/app/src/main/res/drawable-mdpi/abc_list_focused_holo.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/abc_list_longpressed_holo.9.png b/app/src/main/res/drawable-mdpi/abc_list_longpressed_holo.9.png
deleted file mode 100644
index 3bf8e036..00000000
Binary files a/app/src/main/res/drawable-mdpi/abc_list_longpressed_holo.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/abc_list_pressed_holo_dark.9.png b/app/src/main/res/drawable-mdpi/abc_list_pressed_holo_dark.9.png
deleted file mode 100644
index 6e77525d..00000000
Binary files a/app/src/main/res/drawable-mdpi/abc_list_pressed_holo_dark.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/abc_list_pressed_holo_light.9.png b/app/src/main/res/drawable-mdpi/abc_list_pressed_holo_light.9.png
deleted file mode 100644
index 6e77525d..00000000
Binary files a/app/src/main/res/drawable-mdpi/abc_list_pressed_holo_light.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/abc_list_selector_disabled_holo_dark.9.png b/app/src/main/res/drawable-mdpi/abc_list_selector_disabled_holo_dark.9.png
deleted file mode 100644
index 92da2f0d..00000000
Binary files a/app/src/main/res/drawable-mdpi/abc_list_selector_disabled_holo_dark.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/abc_list_selector_disabled_holo_light.9.png b/app/src/main/res/drawable-mdpi/abc_list_selector_disabled_holo_light.9.png
deleted file mode 100644
index 42cb6463..00000000
Binary files a/app/src/main/res/drawable-mdpi/abc_list_selector_disabled_holo_light.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/btn_cab_done_default_transdroid2.9.png b/app/src/main/res/drawable-mdpi/btn_cab_done_default_transdroid2.9.png
deleted file mode 100644
index da14cdbc..00000000
Binary files a/app/src/main/res/drawable-mdpi/btn_cab_done_default_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/btn_cab_done_focused_transdroid2.9.png b/app/src/main/res/drawable-mdpi/btn_cab_done_focused_transdroid2.9.png
deleted file mode 100644
index 89b06832..00000000
Binary files a/app/src/main/res/drawable-mdpi/btn_cab_done_focused_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/btn_cab_done_pressed_transdroid2.9.png b/app/src/main/res/drawable-mdpi/btn_cab_done_pressed_transdroid2.9.png
deleted file mode 100644
index 767cf60e..00000000
Binary files a/app/src/main/res/drawable-mdpi/btn_cab_done_pressed_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/cab_background_bottom_transdroid2.9.png b/app/src/main/res/drawable-mdpi/cab_background_bottom_transdroid2.9.png
deleted file mode 100644
index df024689..00000000
Binary files a/app/src/main/res/drawable-mdpi/cab_background_bottom_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/cab_background_top_transdroid2.9.png b/app/src/main/res/drawable-mdpi/cab_background_top_transdroid2.9.png
deleted file mode 100644
index 02b6f3b6..00000000
Binary files a/app/src/main/res/drawable-mdpi/cab_background_top_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_discard.png b/app/src/main/res/drawable-mdpi/ic_action_discard.png
deleted file mode 100644
index a8ee5f25..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_discard.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_discard_light.png b/app/src/main/res/drawable-mdpi/ic_action_discard_light.png
deleted file mode 100644
index cedb1085..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_discard_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_done_dark.png b/app/src/main/res/drawable-mdpi/ic_action_done_dark.png
deleted file mode 100644
index 35cda8e1..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_done_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_done_light.png b/app/src/main/res/drawable-mdpi/ic_action_done_light.png
deleted file mode 100644
index cf5fab3a..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_done_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_filter_dark.png b/app/src/main/res/drawable-mdpi/ic_action_filter_dark.png
deleted file mode 100644
index 603ca549..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_filter_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_filter_light.png b/app/src/main/res/drawable-mdpi/ic_action_filter_light.png
deleted file mode 100644
index 4a6c23ef..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_filter_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_forcerecheck_dark.png b/app/src/main/res/drawable-mdpi/ic_action_forcerecheck_dark.png
deleted file mode 100755
index bf1a6d4d..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_forcerecheck_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_forcerecheck_light.png b/app/src/main/res/drawable-mdpi/ic_action_forcerecheck_light.png
deleted file mode 100755
index d62250f6..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_forcerecheck_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_info_dark.png b/app/src/main/res/drawable-mdpi/ic_action_info_dark.png
deleted file mode 100755
index 7be15b95..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_info_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_info_light.png b/app/src/main/res/drawable-mdpi/ic_action_info_light.png
deleted file mode 100755
index 715ffcc3..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_info_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_labels_dark.png b/app/src/main/res/drawable-mdpi/ic_action_labels_dark.png
deleted file mode 100644
index b85d7c58..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_labels_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_labels_light.png b/app/src/main/res/drawable-mdpi/ic_action_labels_light.png
deleted file mode 100644
index 8567d5e4..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_labels_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_new_dark.png b/app/src/main/res/drawable-mdpi/ic_action_new_dark.png
deleted file mode 100644
index 4d5d484b..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_new_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_new_light.png b/app/src/main/res/drawable-mdpi/ic_action_new_light.png
deleted file mode 100644
index 884c9d27..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_new_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_overflow.png b/app/src/main/res/drawable-mdpi/ic_action_overflow.png
deleted file mode 100755
index b6d614fc..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_overflow.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_pause_dark.png b/app/src/main/res/drawable-mdpi/ic_action_pause_dark.png
deleted file mode 100644
index a5aee6f2..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_pause_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_pause_light.png b/app/src/main/res/drawable-mdpi/ic_action_pause_light.png
deleted file mode 100644
index 01858e34..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_pause_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_priority_high_dark.png b/app/src/main/res/drawable-mdpi/ic_action_priority_high_dark.png
deleted file mode 100644
index 9cfeeebc..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_priority_high_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_priority_high_light.png b/app/src/main/res/drawable-mdpi/ic_action_priority_high_light.png
deleted file mode 100644
index bef007c6..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_priority_high_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_priority_low_dark.png b/app/src/main/res/drawable-mdpi/ic_action_priority_low_dark.png
deleted file mode 100644
index 89927f63..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_priority_low_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_priority_low_light.png b/app/src/main/res/drawable-mdpi/ic_action_priority_low_light.png
deleted file mode 100644
index 44e768fa..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_priority_low_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_priority_normal_dark.png b/app/src/main/res/drawable-mdpi/ic_action_priority_normal_dark.png
deleted file mode 100644
index 7dd2c7bd..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_priority_normal_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_priority_normal_light.png b/app/src/main/res/drawable-mdpi/ic_action_priority_normal_light.png
deleted file mode 100644
index 4a471f36..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_priority_normal_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_priority_off_dark.png b/app/src/main/res/drawable-mdpi/ic_action_priority_off_dark.png
deleted file mode 100644
index 8d9c72d5..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_priority_off_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_priority_off_light.png b/app/src/main/res/drawable-mdpi/ic_action_priority_off_light.png
deleted file mode 100644
index d7766bc2..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_priority_off_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_refresh_dark.png b/app/src/main/res/drawable-mdpi/ic_action_refresh_dark.png
deleted file mode 100644
index bd611e8e..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_refresh_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_refresh_light.png b/app/src/main/res/drawable-mdpi/ic_action_refresh_light.png
deleted file mode 100644
index 63e70e17..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_refresh_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_remove_dark.png b/app/src/main/res/drawable-mdpi/ic_action_remove_dark.png
deleted file mode 100644
index 3336760d..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_remove_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_remove_light.png b/app/src/main/res/drawable-mdpi/ic_action_remove_light.png
deleted file mode 100644
index 9f4c3d6a..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_remove_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_resume_dark.png b/app/src/main/res/drawable-mdpi/ic_action_resume_dark.png
deleted file mode 100644
index 28e81379..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_resume_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_resume_light.png b/app/src/main/res/drawable-mdpi/ic_action_resume_light.png
deleted file mode 100644
index 937e0299..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_resume_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_rss_dark.png b/app/src/main/res/drawable-mdpi/ic_action_rss_dark.png
deleted file mode 100644
index 2de867b8..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_rss_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_rss_light.png b/app/src/main/res/drawable-mdpi/ic_action_rss_light.png
deleted file mode 100644
index 2c5d0933..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_rss_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_save_dark.png b/app/src/main/res/drawable-mdpi/ic_action_save_dark.png
deleted file mode 100644
index ea339162..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_save_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_save_light.png b/app/src/main/res/drawable-mdpi/ic_action_save_light.png
deleted file mode 100644
index 61304a68..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_save_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_search_dark.png b/app/src/main/res/drawable-mdpi/ic_action_search_dark.png
deleted file mode 100644
index 587d9e0b..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_search_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_search_light.png b/app/src/main/res/drawable-mdpi/ic_action_search_light.png
deleted file mode 100644
index 3aa64404..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_search_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_sort_by_size_dark.png b/app/src/main/res/drawable-mdpi/ic_action_sort_by_size_dark.png
deleted file mode 100644
index aa921e76..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_sort_by_size_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_sort_by_size_light.png b/app/src/main/res/drawable-mdpi/ic_action_sort_by_size_light.png
deleted file mode 100644
index af004e5f..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_sort_by_size_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_start_dark.png b/app/src/main/res/drawable-mdpi/ic_action_start_dark.png
deleted file mode 100644
index 6a40cd5f..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_start_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_start_light.png b/app/src/main/res/drawable-mdpi/ic_action_start_light.png
deleted file mode 100644
index 1e3bc97a..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_start_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_stop_dark.png b/app/src/main/res/drawable-mdpi/ic_action_stop_dark.png
deleted file mode 100644
index 20df4158..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_stop_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_stop_light.png b/app/src/main/res/drawable-mdpi/ic_action_stop_light.png
deleted file mode 100644
index 0c1a0a97..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_stop_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_trackers_dark.png b/app/src/main/res/drawable-mdpi/ic_action_trackers_dark.png
deleted file mode 100644
index 539bad7d..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_trackers_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_trackers_light.png b/app/src/main/res/drawable-mdpi/ic_action_trackers_light.png
deleted file mode 100644
index f9c51464..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_trackers_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_turtle_disabled.png b/app/src/main/res/drawable-mdpi/ic_action_turtle_disabled.png
deleted file mode 100644
index 70155517..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_turtle_disabled.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_turtle_enabled.png b/app/src/main/res/drawable-mdpi/ic_action_turtle_enabled.png
deleted file mode 100644
index fedbfc9b..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_turtle_enabled.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_website_dark.png b/app/src/main/res/drawable-mdpi/ic_action_website_dark.png
deleted file mode 100644
index 41b56ec9..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_website_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_website_light.png b/app/src/main/res/drawable-mdpi/ic_action_website_light.png
deleted file mode 100644
index f146cf99..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_action_website_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_activity_torrents.png b/app/src/main/res/drawable-mdpi/ic_activity_torrents.png
deleted file mode 100644
index ce606a71..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_activity_torrents.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_empty_details_dark.png b/app/src/main/res/drawable-mdpi/ic_empty_details_dark.png
deleted file mode 100644
index 5bd58335..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_empty_details_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_empty_details_light.png b/app/src/main/res/drawable-mdpi/ic_empty_details_light.png
deleted file mode 100644
index 92ed5fa0..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_empty_details_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_launcher.png b/app/src/main/res/drawable-mdpi/ic_launcher.png
deleted file mode 100644
index c153fddf..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_launcher.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_stat_notification.png b/app/src/main/res/drawable-mdpi/ic_stat_notification.png
deleted file mode 100644
index a598474c..00000000
Binary files a/app/src/main/res/drawable-mdpi/ic_stat_notification.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/list_focused_transdroid.9.png b/app/src/main/res/drawable-mdpi/list_focused_transdroid.9.png
deleted file mode 100644
index cc6c75f9..00000000
Binary files a/app/src/main/res/drawable-mdpi/list_focused_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/list_focused_transdroid2.9.png b/app/src/main/res/drawable-mdpi/list_focused_transdroid2.9.png
deleted file mode 100644
index 469e1e0e..00000000
Binary files a/app/src/main/res/drawable-mdpi/list_focused_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/menu_dropdown_panel_transdroid.9.png b/app/src/main/res/drawable-mdpi/menu_dropdown_panel_transdroid.9.png
deleted file mode 100644
index 2b2458ef..00000000
Binary files a/app/src/main/res/drawable-mdpi/menu_dropdown_panel_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/menu_dropdown_panel_transdroid2.9.png b/app/src/main/res/drawable-mdpi/menu_dropdown_panel_transdroid2.9.png
deleted file mode 100644
index ea341b50..00000000
Binary files a/app/src/main/res/drawable-mdpi/menu_dropdown_panel_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/menu_hardkey_panel_transdroid.9.png b/app/src/main/res/drawable-mdpi/menu_hardkey_panel_transdroid.9.png
deleted file mode 100644
index 19b2feb5..00000000
Binary files a/app/src/main/res/drawable-mdpi/menu_hardkey_panel_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/progress_bg_transdroid.9.png b/app/src/main/res/drawable-mdpi/progress_bg_transdroid.9.png
deleted file mode 100644
index 9372a60f..00000000
Binary files a/app/src/main/res/drawable-mdpi/progress_bg_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/progress_bg_transdroid2.9.png b/app/src/main/res/drawable-mdpi/progress_bg_transdroid2.9.png
deleted file mode 100644
index 71753a4b..00000000
Binary files a/app/src/main/res/drawable-mdpi/progress_bg_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/progress_primary_transdroid.9.png b/app/src/main/res/drawable-mdpi/progress_primary_transdroid.9.png
deleted file mode 100644
index 27192ef1..00000000
Binary files a/app/src/main/res/drawable-mdpi/progress_primary_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/progress_primary_transdroid2.9.png b/app/src/main/res/drawable-mdpi/progress_primary_transdroid2.9.png
deleted file mode 100644
index 2bbbbb9a..00000000
Binary files a/app/src/main/res/drawable-mdpi/progress_primary_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/progress_secondary_transdroid.9.png b/app/src/main/res/drawable-mdpi/progress_secondary_transdroid.9.png
deleted file mode 100644
index 2b240eae..00000000
Binary files a/app/src/main/res/drawable-mdpi/progress_secondary_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/progress_secondary_transdroid2.9.png b/app/src/main/res/drawable-mdpi/progress_secondary_transdroid2.9.png
deleted file mode 100644
index 9dd0f6cb..00000000
Binary files a/app/src/main/res/drawable-mdpi/progress_secondary_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/spinner_ab_default_transdroid.9.png b/app/src/main/res/drawable-mdpi/spinner_ab_default_transdroid.9.png
deleted file mode 100644
index 9aeafee2..00000000
Binary files a/app/src/main/res/drawable-mdpi/spinner_ab_default_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/spinner_ab_default_transdroid2.9.png b/app/src/main/res/drawable-mdpi/spinner_ab_default_transdroid2.9.png
deleted file mode 100644
index 5e1dd470..00000000
Binary files a/app/src/main/res/drawable-mdpi/spinner_ab_default_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/spinner_ab_disabled_transdroid.9.png b/app/src/main/res/drawable-mdpi/spinner_ab_disabled_transdroid.9.png
deleted file mode 100644
index 88dd4415..00000000
Binary files a/app/src/main/res/drawable-mdpi/spinner_ab_disabled_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/spinner_ab_disabled_transdroid2.9.png b/app/src/main/res/drawable-mdpi/spinner_ab_disabled_transdroid2.9.png
deleted file mode 100644
index 38025ad3..00000000
Binary files a/app/src/main/res/drawable-mdpi/spinner_ab_disabled_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/spinner_ab_focused_transdroid.9.png b/app/src/main/res/drawable-mdpi/spinner_ab_focused_transdroid.9.png
deleted file mode 100644
index 63a0fda5..00000000
Binary files a/app/src/main/res/drawable-mdpi/spinner_ab_focused_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/spinner_ab_focused_transdroid2.9.png b/app/src/main/res/drawable-mdpi/spinner_ab_focused_transdroid2.9.png
deleted file mode 100644
index e8c8b0f7..00000000
Binary files a/app/src/main/res/drawable-mdpi/spinner_ab_focused_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/spinner_ab_pressed_transdroid.9.png b/app/src/main/res/drawable-mdpi/spinner_ab_pressed_transdroid.9.png
deleted file mode 100644
index 15652b11..00000000
Binary files a/app/src/main/res/drawable-mdpi/spinner_ab_pressed_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/spinner_ab_pressed_transdroid2.9.png b/app/src/main/res/drawable-mdpi/spinner_ab_pressed_transdroid2.9.png
deleted file mode 100644
index c9d4e8b6..00000000
Binary files a/app/src/main/res/drawable-mdpi/spinner_ab_pressed_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/tab_selected_focused_transdroid.9.png b/app/src/main/res/drawable-mdpi/tab_selected_focused_transdroid.9.png
deleted file mode 100644
index ac6ffee0..00000000
Binary files a/app/src/main/res/drawable-mdpi/tab_selected_focused_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/tab_selected_focused_transdroid2.9.png b/app/src/main/res/drawable-mdpi/tab_selected_focused_transdroid2.9.png
deleted file mode 100644
index 87a5b7c6..00000000
Binary files a/app/src/main/res/drawable-mdpi/tab_selected_focused_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/tab_selected_pressed_transdroid.9.png b/app/src/main/res/drawable-mdpi/tab_selected_pressed_transdroid.9.png
deleted file mode 100644
index 690f41de..00000000
Binary files a/app/src/main/res/drawable-mdpi/tab_selected_pressed_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/tab_selected_pressed_transdroid2.9.png b/app/src/main/res/drawable-mdpi/tab_selected_pressed_transdroid2.9.png
deleted file mode 100644
index 5cfe08f0..00000000
Binary files a/app/src/main/res/drawable-mdpi/tab_selected_pressed_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/tab_selected_transdroid.9.png b/app/src/main/res/drawable-mdpi/tab_selected_transdroid.9.png
deleted file mode 100644
index 1aa38d48..00000000
Binary files a/app/src/main/res/drawable-mdpi/tab_selected_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/tab_selected_transdroid2.9.png b/app/src/main/res/drawable-mdpi/tab_selected_transdroid2.9.png
deleted file mode 100644
index 79e55713..00000000
Binary files a/app/src/main/res/drawable-mdpi/tab_selected_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/tab_unselected_focused_transdroid.9.png b/app/src/main/res/drawable-mdpi/tab_unselected_focused_transdroid.9.png
deleted file mode 100644
index f9c9c6bd..00000000
Binary files a/app/src/main/res/drawable-mdpi/tab_unselected_focused_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/tab_unselected_focused_transdroid2.9.png b/app/src/main/res/drawable-mdpi/tab_unselected_focused_transdroid2.9.png
deleted file mode 100644
index 1a55fa4b..00000000
Binary files a/app/src/main/res/drawable-mdpi/tab_unselected_focused_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/tab_unselected_pressed_transdroid.9.png b/app/src/main/res/drawable-mdpi/tab_unselected_pressed_transdroid.9.png
deleted file mode 100644
index 2acd0bbe..00000000
Binary files a/app/src/main/res/drawable-mdpi/tab_unselected_pressed_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/tab_unselected_pressed_transdroid2.9.png b/app/src/main/res/drawable-mdpi/tab_unselected_pressed_transdroid2.9.png
deleted file mode 100644
index 57a75c8c..00000000
Binary files a/app/src/main/res/drawable-mdpi/tab_unselected_pressed_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/tab_unselected_transdroid2.9.png b/app/src/main/res/drawable-mdpi/tab_unselected_transdroid2.9.png
deleted file mode 100644
index 7f723870..00000000
Binary files a/app/src/main/res/drawable-mdpi/tab_unselected_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ab_bottom_solid_transdroid.9.png b/app/src/main/res/drawable-xhdpi/ab_bottom_solid_transdroid.9.png
deleted file mode 100644
index abf5694b..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ab_bottom_solid_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ab_bottom_solid_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/ab_bottom_solid_transdroid2.9.png
deleted file mode 100644
index b1a11071..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ab_bottom_solid_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ab_solid_transdroid.9.png b/app/src/main/res/drawable-xhdpi/ab_solid_transdroid.9.png
deleted file mode 100644
index 143a16f4..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ab_solid_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ab_solid_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/ab_solid_transdroid2.9.png
deleted file mode 100644
index 550ceee8..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ab_solid_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ab_stacked_solid_transdroid.9.png b/app/src/main/res/drawable-xhdpi/ab_stacked_solid_transdroid.9.png
deleted file mode 100644
index f9a1e1f2..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ab_stacked_solid_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ab_stacked_solid_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/ab_stacked_solid_transdroid2.9.png
deleted file mode 100644
index 61130d91..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ab_stacked_solid_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ab_texture_tile_transdroid2.png b/app/src/main/res/drawable-xhdpi/ab_texture_tile_transdroid2.png
deleted file mode 100644
index 4cd50792..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ab_texture_tile_transdroid2.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ab_transparent_transdroid.9.png b/app/src/main/res/drawable-xhdpi/ab_transparent_transdroid.9.png
deleted file mode 100644
index 24020e23..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ab_transparent_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ab_transparent_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/ab_transparent_transdroid2.9.png
deleted file mode 100644
index 78739156..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ab_transparent_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/abc_list_focused_holo.9.png b/app/src/main/res/drawable-xhdpi/abc_list_focused_holo.9.png
deleted file mode 100644
index b545f8e5..00000000
Binary files a/app/src/main/res/drawable-xhdpi/abc_list_focused_holo.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/abc_list_longpressed_holo.9.png b/app/src/main/res/drawable-xhdpi/abc_list_longpressed_holo.9.png
deleted file mode 100644
index eda10e61..00000000
Binary files a/app/src/main/res/drawable-xhdpi/abc_list_longpressed_holo.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/abc_list_pressed_holo_dark.9.png b/app/src/main/res/drawable-xhdpi/abc_list_pressed_holo_dark.9.png
deleted file mode 100644
index e4b33935..00000000
Binary files a/app/src/main/res/drawable-xhdpi/abc_list_pressed_holo_dark.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/abc_list_pressed_holo_light.9.png b/app/src/main/res/drawable-xhdpi/abc_list_pressed_holo_light.9.png
deleted file mode 100644
index e4b33935..00000000
Binary files a/app/src/main/res/drawable-xhdpi/abc_list_pressed_holo_light.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/abc_list_selector_disabled_holo_dark.9.png b/app/src/main/res/drawable-xhdpi/abc_list_selector_disabled_holo_dark.9.png
deleted file mode 100644
index 88726b69..00000000
Binary files a/app/src/main/res/drawable-xhdpi/abc_list_selector_disabled_holo_dark.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/abc_list_selector_disabled_holo_light.9.png b/app/src/main/res/drawable-xhdpi/abc_list_selector_disabled_holo_light.9.png
deleted file mode 100644
index c6a7d4d8..00000000
Binary files a/app/src/main/res/drawable-xhdpi/abc_list_selector_disabled_holo_light.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/btn_cab_done_default_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/btn_cab_done_default_transdroid2.9.png
deleted file mode 100644
index 5d9632ed..00000000
Binary files a/app/src/main/res/drawable-xhdpi/btn_cab_done_default_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/btn_cab_done_focused_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/btn_cab_done_focused_transdroid2.9.png
deleted file mode 100644
index 57e1c92e..00000000
Binary files a/app/src/main/res/drawable-xhdpi/btn_cab_done_focused_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/btn_cab_done_pressed_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/btn_cab_done_pressed_transdroid2.9.png
deleted file mode 100644
index 56b13fa9..00000000
Binary files a/app/src/main/res/drawable-xhdpi/btn_cab_done_pressed_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/cab_background_bottom_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/cab_background_bottom_transdroid2.9.png
deleted file mode 100644
index 9272cc29..00000000
Binary files a/app/src/main/res/drawable-xhdpi/cab_background_bottom_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/cab_background_top_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/cab_background_top_transdroid2.9.png
deleted file mode 100644
index ca1b570b..00000000
Binary files a/app/src/main/res/drawable-xhdpi/cab_background_top_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_add.png b/app/src/main/res/drawable-xhdpi/ic_action_add.png
new file mode 100755
index 00000000..67042105
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_add.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_barcode.png b/app/src/main/res/drawable-xhdpi/ic_action_barcode.png
new file mode 100644
index 00000000..aad3f6c9
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_barcode.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_copy.png b/app/src/main/res/drawable-xhdpi/ic_action_copy.png
new file mode 100755
index 00000000..04a0cc94
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_copy.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_discard_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_discard_dark.png
deleted file mode 100644
index 412b3335..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_discard_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_discard_light.png b/app/src/main/res/drawable-xhdpi/ic_action_discard_light.png
deleted file mode 100644
index 98c73da1..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_discard_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_done.png b/app/src/main/res/drawable-xhdpi/ic_action_done.png
new file mode 100755
index 00000000..e5024472
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_done.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_done_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_done_dark.png
deleted file mode 100644
index b52dc370..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_done_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_done_light.png b/app/src/main/res/drawable-xhdpi/ic_action_done_light.png
deleted file mode 100644
index b8915716..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_done_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_download.png b/app/src/main/res/drawable-xhdpi/ic_action_download.png
new file mode 100755
index 00000000..990dfb82
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_download.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_drawer.png b/app/src/main/res/drawable-xhdpi/ic_action_drawer.png
new file mode 100755
index 00000000..ceadb182
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_drawer.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_file.png b/app/src/main/res/drawable-xhdpi/ic_action_file.png
new file mode 100755
index 00000000..dbf80e33
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_file.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_filter.png b/app/src/main/res/drawable-xhdpi/ic_action_filter.png
new file mode 100755
index 00000000..99099080
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_filter.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_filter_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_filter_dark.png
deleted file mode 100644
index 391234fe..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_filter_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_filter_light.png b/app/src/main/res/drawable-xhdpi/ic_action_filter_light.png
deleted file mode 100644
index d9575c20..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_filter_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_force_recheck.png b/app/src/main/res/drawable-xhdpi/ic_action_force_recheck.png
new file mode 100755
index 00000000..851e73a2
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_force_recheck.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_forcerecheck_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_forcerecheck_dark.png
deleted file mode 100755
index 07ee5e42..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_forcerecheck_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_forcerecheck_light.png b/app/src/main/res/drawable-xhdpi/ic_action_forcerecheck_light.png
deleted file mode 100755
index a58fa96d..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_forcerecheck_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_info.png b/app/src/main/res/drawable-xhdpi/ic_action_info.png
new file mode 100755
index 00000000..0701c46f
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_info.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_info_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_info_dark.png
deleted file mode 100755
index 86ec02dc..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_info_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_info_light.png b/app/src/main/res/drawable-xhdpi/ic_action_info_light.png
deleted file mode 100755
index 13490fd0..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_info_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_labels.png b/app/src/main/res/drawable-xhdpi/ic_action_labels.png
new file mode 100755
index 00000000..20b9355e
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_labels.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_labels_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_labels_dark.png
deleted file mode 100644
index 8fdcd1a2..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_labels_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_labels_light.png b/app/src/main/res/drawable-xhdpi/ic_action_labels_light.png
deleted file mode 100644
index c1ec9727..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_labels_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_link.png b/app/src/main/res/drawable-xhdpi/ic_action_link.png
new file mode 100755
index 00000000..984b572a
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_link.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_new_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_new_dark.png
deleted file mode 100644
index 23b9a1c1..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_new_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_new_light.png b/app/src/main/res/drawable-xhdpi/ic_action_new_light.png
deleted file mode 100644
index 9b48a63d..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_new_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_pause.png b/app/src/main/res/drawable-xhdpi/ic_action_pause.png
new file mode 100755
index 00000000..14b6d17d
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_pause.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_pause_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_pause_dark.png
deleted file mode 100644
index 333c1b24..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_pause_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_pause_light.png b/app/src/main/res/drawable-xhdpi/ic_action_pause_light.png
deleted file mode 100644
index 97d6f91a..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_pause_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_priority_high.png b/app/src/main/res/drawable-xhdpi/ic_action_priority_high.png
new file mode 100644
index 00000000..e55633f4
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_priority_high.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_priority_high_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_priority_high_dark.png
deleted file mode 100644
index 5932124c..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_priority_high_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_priority_high_light.png b/app/src/main/res/drawable-xhdpi/ic_action_priority_high_light.png
deleted file mode 100644
index c20807d6..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_priority_high_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_priority_low.png b/app/src/main/res/drawable-xhdpi/ic_action_priority_low.png
new file mode 100644
index 00000000..fc4de4ce
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_priority_low.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_priority_low_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_priority_low_dark.png
deleted file mode 100644
index d0b6ba5f..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_priority_low_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_priority_low_light.png b/app/src/main/res/drawable-xhdpi/ic_action_priority_low_light.png
deleted file mode 100644
index abf14070..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_priority_low_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_priority_medium.png b/app/src/main/res/drawable-xhdpi/ic_action_priority_medium.png
new file mode 100644
index 00000000..cb75e8f0
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_priority_medium.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_priority_normal_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_priority_normal_dark.png
deleted file mode 100644
index 8c1f81af..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_priority_normal_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_priority_normal_light.png b/app/src/main/res/drawable-xhdpi/ic_action_priority_normal_light.png
deleted file mode 100644
index 9405ed21..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_priority_normal_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_priority_off.png b/app/src/main/res/drawable-xhdpi/ic_action_priority_off.png
new file mode 100644
index 00000000..867e2fff
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_priority_off.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_priority_off_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_priority_off_dark.png
deleted file mode 100644
index f6b9ff22..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_priority_off_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_priority_off_light.png b/app/src/main/res/drawable-xhdpi/ic_action_priority_off_light.png
deleted file mode 100644
index 4424a0c3..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_priority_off_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_refresh.png b/app/src/main/res/drawable-xhdpi/ic_action_refresh.png
new file mode 100755
index 00000000..5f89fc25
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_refresh.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_refresh_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_refresh_dark.png
deleted file mode 100644
index a7fdc0df..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_refresh_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_refresh_light.png b/app/src/main/res/drawable-xhdpi/ic_action_refresh_light.png
deleted file mode 100644
index e6212cf6..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_refresh_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_remove.png b/app/src/main/res/drawable-xhdpi/ic_action_remove.png
new file mode 100755
index 00000000..cdb230c2
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_remove.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_remove_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_remove_dark.png
deleted file mode 100644
index f391760e..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_remove_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_remove_light.png b/app/src/main/res/drawable-xhdpi/ic_action_remove_light.png
deleted file mode 100644
index ca7d159f..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_remove_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_resume.png b/app/src/main/res/drawable-xhdpi/ic_action_resume.png
new file mode 100755
index 00000000..b7c86059
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_resume.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_resume_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_resume_dark.png
deleted file mode 100644
index fe6b5588..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_resume_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_resume_light.png b/app/src/main/res/drawable-xhdpi/ic_action_resume_light.png
deleted file mode 100644
index 61b8d595..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_resume_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_rss.png b/app/src/main/res/drawable-xhdpi/ic_action_rss.png
new file mode 100644
index 00000000..b4dc31be
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_rss.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_rss_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_rss_dark.png
deleted file mode 100644
index dcd88e1c..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_rss_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_rss_light.png b/app/src/main/res/drawable-xhdpi/ic_action_rss_light.png
deleted file mode 100644
index 03365510..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_rss_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_save.png b/app/src/main/res/drawable-xhdpi/ic_action_save.png
new file mode 100755
index 00000000..aa033209
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_save.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_save_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_save_dark.png
deleted file mode 100644
index dde278b5..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_save_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_save_light.png b/app/src/main/res/drawable-xhdpi/ic_action_save_light.png
deleted file mode 100644
index 29c5f4d3..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_save_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_search.png b/app/src/main/res/drawable-xhdpi/ic_action_search.png
new file mode 100755
index 00000000..043759ac
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_search.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_search_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_search_dark.png
deleted file mode 100644
index 3549f84d..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_search_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_search_light.png b/app/src/main/res/drawable-xhdpi/ic_action_search_light.png
deleted file mode 100644
index 804420ae..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_search_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_sort.png b/app/src/main/res/drawable-xhdpi/ic_action_sort.png
new file mode 100755
index 00000000..89008555
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_sort.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_sort_by_size_light.png b/app/src/main/res/drawable-xhdpi/ic_action_sort_by_size_light.png
deleted file mode 100644
index 59da08e4..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_sort_by_size_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_start.png b/app/src/main/res/drawable-xhdpi/ic_action_start.png
new file mode 100755
index 00000000..a55d1992
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_start.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_start_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_start_dark.png
deleted file mode 100644
index 51124993..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_start_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_start_light.png b/app/src/main/res/drawable-xhdpi/ic_action_start_light.png
deleted file mode 100644
index 2d67d31e..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_start_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_stop.png b/app/src/main/res/drawable-xhdpi/ic_action_stop.png
new file mode 100755
index 00000000..9a6e57b6
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_stop.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_stop_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_stop_dark.png
deleted file mode 100644
index ee5eda25..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_stop_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_stop_light.png b/app/src/main/res/drawable-xhdpi/ic_action_stop_light.png
deleted file mode 100644
index 9a23e3d4..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_stop_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_stat_notification.png b/app/src/main/res/drawable-xhdpi/ic_action_trackers.png
similarity index 100%
rename from app/src/main/res/drawable-xhdpi/ic_stat_notification.png
rename to app/src/main/res/drawable-xhdpi/ic_action_trackers.png
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_trackers_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_trackers_dark.png
deleted file mode 100644
index 2caf74c9..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_trackers_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_trackers_light.png b/app/src/main/res/drawable-xhdpi/ic_action_trackers_light.png
deleted file mode 100644
index b607e604..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_trackers_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_turtle_disabled.png b/app/src/main/res/drawable-xhdpi/ic_action_turtle_disabled.png
index 12068f67..3b5dd9fa 100644
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_turtle_disabled.png and b/app/src/main/res/drawable-xhdpi/ic_action_turtle_disabled.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_turtle_enabled.png b/app/src/main/res/drawable-xhdpi/ic_action_turtle_enabled.png
index 8bfedf1e..23c98464 100644
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_turtle_enabled.png and b/app/src/main/res/drawable-xhdpi/ic_action_turtle_enabled.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_website_dark.png b/app/src/main/res/drawable-xhdpi/ic_action_website_dark.png
deleted file mode 100644
index 9b77be96..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_website_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_website_light.png b/app/src/main/res/drawable-xhdpi/ic_action_website_light.png
deleted file mode 100644
index bd6b8682..00000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_action_website_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_empty_details_dark.png b/app/src/main/res/drawable-xhdpi/ic_empty_details_dark.png
index 7b446989..85bf358c 100644
Binary files a/app/src/main/res/drawable-xhdpi/ic_empty_details_dark.png and b/app/src/main/res/drawable-xhdpi/ic_empty_details_dark.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_empty_details_light.png b/app/src/main/res/drawable-xhdpi/ic_empty_details_light.png
index 055caa04..7a347bcf 100644
Binary files a/app/src/main/res/drawable-xhdpi/ic_empty_details_light.png and b/app/src/main/res/drawable-xhdpi/ic_empty_details_light.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_launcher.png b/app/src/main/res/drawable-xhdpi/ic_launcher.png
index 258c1fe5..b1235387 100644
Binary files a/app/src/main/res/drawable-xhdpi/ic_launcher.png and b/app/src/main/res/drawable-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/drawable-xhdpi/list_focused.9.png b/app/src/main/res/drawable-xhdpi/list_focused.9.png
new file mode 100755
index 00000000..55eca815
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/list_focused.9.png differ
diff --git a/app/src/main/res/drawable-xhdpi/list_focused_transdroid.9.png b/app/src/main/res/drawable-xhdpi/list_focused_transdroid.9.png
deleted file mode 100644
index 368d15f6..00000000
Binary files a/app/src/main/res/drawable-xhdpi/list_focused_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/list_focused_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/list_focused_transdroid2.9.png
deleted file mode 100644
index d41b7ecd..00000000
Binary files a/app/src/main/res/drawable-xhdpi/list_focused_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/list_pressed.9.png b/app/src/main/res/drawable-xhdpi/list_pressed.9.png
new file mode 100755
index 00000000..bfab37b8
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/list_pressed.9.png differ
diff --git a/app/src/main/res/drawable-xhdpi/menu_dropdown_panel_transdroid.9.png b/app/src/main/res/drawable-xhdpi/menu_dropdown_panel_transdroid.9.png
deleted file mode 100644
index 2974663c..00000000
Binary files a/app/src/main/res/drawable-xhdpi/menu_dropdown_panel_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/menu_dropdown_panel_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/menu_dropdown_panel_transdroid2.9.png
deleted file mode 100644
index 3d9f6149..00000000
Binary files a/app/src/main/res/drawable-xhdpi/menu_dropdown_panel_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/menu_hardkey_panel_transdroid.9.png b/app/src/main/res/drawable-xhdpi/menu_hardkey_panel_transdroid.9.png
deleted file mode 100644
index 97c03063..00000000
Binary files a/app/src/main/res/drawable-xhdpi/menu_hardkey_panel_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/progress_bg_transdroid.9.png b/app/src/main/res/drawable-xhdpi/progress_bg_transdroid.9.png
deleted file mode 100644
index 8b4853aa..00000000
Binary files a/app/src/main/res/drawable-xhdpi/progress_bg_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/progress_bg_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/progress_bg_transdroid2.9.png
deleted file mode 100644
index 5ffc2acc..00000000
Binary files a/app/src/main/res/drawable-xhdpi/progress_bg_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/progress_primary_transdroid.9.png b/app/src/main/res/drawable-xhdpi/progress_primary_transdroid.9.png
deleted file mode 100644
index b1c9444a..00000000
Binary files a/app/src/main/res/drawable-xhdpi/progress_primary_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/progress_primary_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/progress_primary_transdroid2.9.png
deleted file mode 100644
index e6d5511a..00000000
Binary files a/app/src/main/res/drawable-xhdpi/progress_primary_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/progress_secondary_transdroid.9.png b/app/src/main/res/drawable-xhdpi/progress_secondary_transdroid.9.png
deleted file mode 100644
index 48cc8e57..00000000
Binary files a/app/src/main/res/drawable-xhdpi/progress_secondary_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/progress_secondary_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/progress_secondary_transdroid2.9.png
deleted file mode 100644
index 8676a0fd..00000000
Binary files a/app/src/main/res/drawable-xhdpi/progress_secondary_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/spinner_ab_default_transdroid.9.png b/app/src/main/res/drawable-xhdpi/spinner_ab_default_transdroid.9.png
deleted file mode 100644
index 14b1401d..00000000
Binary files a/app/src/main/res/drawable-xhdpi/spinner_ab_default_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/spinner_ab_default_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/spinner_ab_default_transdroid2.9.png
deleted file mode 100644
index f738a44c..00000000
Binary files a/app/src/main/res/drawable-xhdpi/spinner_ab_default_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/spinner_ab_disabled_transdroid.9.png b/app/src/main/res/drawable-xhdpi/spinner_ab_disabled_transdroid.9.png
deleted file mode 100644
index c9dfbd60..00000000
Binary files a/app/src/main/res/drawable-xhdpi/spinner_ab_disabled_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/spinner_ab_disabled_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/spinner_ab_disabled_transdroid2.9.png
deleted file mode 100644
index 79d24c9f..00000000
Binary files a/app/src/main/res/drawable-xhdpi/spinner_ab_disabled_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/spinner_ab_focused_transdroid.9.png b/app/src/main/res/drawable-xhdpi/spinner_ab_focused_transdroid.9.png
deleted file mode 100644
index e4eddc17..00000000
Binary files a/app/src/main/res/drawable-xhdpi/spinner_ab_focused_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/spinner_ab_focused_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/spinner_ab_focused_transdroid2.9.png
deleted file mode 100644
index e52a8dd4..00000000
Binary files a/app/src/main/res/drawable-xhdpi/spinner_ab_focused_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/spinner_ab_pressed_transdroid.9.png b/app/src/main/res/drawable-xhdpi/spinner_ab_pressed_transdroid.9.png
deleted file mode 100644
index 95f9b4c6..00000000
Binary files a/app/src/main/res/drawable-xhdpi/spinner_ab_pressed_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/spinner_ab_pressed_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/spinner_ab_pressed_transdroid2.9.png
deleted file mode 100644
index ec063706..00000000
Binary files a/app/src/main/res/drawable-xhdpi/spinner_ab_pressed_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/tab_selected_focused_transdroid.9.png b/app/src/main/res/drawable-xhdpi/tab_selected_focused_transdroid.9.png
deleted file mode 100644
index 1c6ccb7b..00000000
Binary files a/app/src/main/res/drawable-xhdpi/tab_selected_focused_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/tab_selected_focused_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/tab_selected_focused_transdroid2.9.png
deleted file mode 100644
index 34fcda3b..00000000
Binary files a/app/src/main/res/drawable-xhdpi/tab_selected_focused_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/tab_selected_pressed_transdroid.9.png b/app/src/main/res/drawable-xhdpi/tab_selected_pressed_transdroid.9.png
deleted file mode 100644
index bed352bd..00000000
Binary files a/app/src/main/res/drawable-xhdpi/tab_selected_pressed_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/tab_selected_pressed_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/tab_selected_pressed_transdroid2.9.png
deleted file mode 100644
index bfb3d453..00000000
Binary files a/app/src/main/res/drawable-xhdpi/tab_selected_pressed_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/tab_selected_transdroid.9.png b/app/src/main/res/drawable-xhdpi/tab_selected_transdroid.9.png
deleted file mode 100644
index 794323de..00000000
Binary files a/app/src/main/res/drawable-xhdpi/tab_selected_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/tab_selected_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/tab_selected_transdroid2.9.png
deleted file mode 100644
index 0c90c530..00000000
Binary files a/app/src/main/res/drawable-xhdpi/tab_selected_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/tab_unselected_focused_transdroid.9.png b/app/src/main/res/drawable-xhdpi/tab_unselected_focused_transdroid.9.png
deleted file mode 100644
index 564f40f5..00000000
Binary files a/app/src/main/res/drawable-xhdpi/tab_unselected_focused_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/tab_unselected_focused_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/tab_unselected_focused_transdroid2.9.png
deleted file mode 100644
index 90d55085..00000000
Binary files a/app/src/main/res/drawable-xhdpi/tab_unselected_focused_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/tab_unselected_pressed_transdroid.9.png b/app/src/main/res/drawable-xhdpi/tab_unselected_pressed_transdroid.9.png
deleted file mode 100644
index 3f885d60..00000000
Binary files a/app/src/main/res/drawable-xhdpi/tab_unselected_pressed_transdroid.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/tab_unselected_pressed_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/tab_unselected_pressed_transdroid2.9.png
deleted file mode 100644
index b5d5335c..00000000
Binary files a/app/src/main/res/drawable-xhdpi/tab_unselected_pressed_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/tab_unselected_transdroid2.9.png b/app/src/main/res/drawable-xhdpi/tab_unselected_transdroid2.9.png
deleted file mode 100644
index 6fd9a251..00000000
Binary files a/app/src/main/res/drawable-xhdpi/tab_unselected_transdroid2.9.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_add.png b/app/src/main/res/drawable-xxhdpi/ic_action_add.png
new file mode 100755
index 00000000..72cedcad
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_add.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_barcode.png b/app/src/main/res/drawable-xxhdpi/ic_action_barcode.png
new file mode 100644
index 00000000..cb6189e2
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_barcode.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_copy.png b/app/src/main/res/drawable-xxhdpi/ic_action_copy.png
new file mode 100755
index 00000000..5fc17a4d
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_copy.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_done.png b/app/src/main/res/drawable-xxhdpi/ic_action_done.png
new file mode 100755
index 00000000..f801e7ab
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_done.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_download.png b/app/src/main/res/drawable-xxhdpi/ic_action_download.png
new file mode 100755
index 00000000..95502de3
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_download.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_drawer.png b/app/src/main/res/drawable-xxhdpi/ic_action_drawer.png
new file mode 100755
index 00000000..22c82ea5
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_drawer.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_file.png b/app/src/main/res/drawable-xxhdpi/ic_action_file.png
new file mode 100755
index 00000000..58b208df
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_file.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_filter.png b/app/src/main/res/drawable-xxhdpi/ic_action_filter.png
new file mode 100755
index 00000000..f45bcc67
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_filter.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_filter_dark.png b/app/src/main/res/drawable-xxhdpi/ic_action_filter_dark.png
deleted file mode 100644
index bc4e8d7f..00000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_action_filter_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_filter_light.png b/app/src/main/res/drawable-xxhdpi/ic_action_filter_light.png
deleted file mode 100644
index 085b2c86..00000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_action_filter_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_force_recheck.png b/app/src/main/res/drawable-xxhdpi/ic_action_force_recheck.png
new file mode 100755
index 00000000..dbb3cf30
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_force_recheck.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_forcerecheck_dark.png b/app/src/main/res/drawable-xxhdpi/ic_action_forcerecheck_dark.png
deleted file mode 100755
index a1106388..00000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_action_forcerecheck_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_forcerecheck_light.png b/app/src/main/res/drawable-xxhdpi/ic_action_forcerecheck_light.png
deleted file mode 100644
index 08fa9c84..00000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_action_forcerecheck_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_info.png b/app/src/main/res/drawable-xxhdpi/ic_action_info.png
new file mode 100755
index 00000000..bdbde04c
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_info.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_info_dark.png b/app/src/main/res/drawable-xxhdpi/ic_action_info_dark.png
deleted file mode 100755
index 2c168948..00000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_action_info_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_info_light.png b/app/src/main/res/drawable-xxhdpi/ic_action_info_light.png
deleted file mode 100755
index 26bd0768..00000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_action_info_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_labels.png b/app/src/main/res/drawable-xxhdpi/ic_action_labels.png
new file mode 100755
index 00000000..2f9dc43d
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_labels.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_link.png b/app/src/main/res/drawable-xxhdpi/ic_action_link.png
new file mode 100755
index 00000000..8e96c356
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_link.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_pause.png b/app/src/main/res/drawable-xxhdpi/ic_action_pause.png
new file mode 100755
index 00000000..72dfa9fa
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_pause.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_priority_high.png b/app/src/main/res/drawable-xxhdpi/ic_action_priority_high.png
new file mode 100644
index 00000000..a14cdf26
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_priority_high.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_priority_low.png b/app/src/main/res/drawable-xxhdpi/ic_action_priority_low.png
new file mode 100644
index 00000000..13784d02
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_priority_low.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_priority_medium.png b/app/src/main/res/drawable-xxhdpi/ic_action_priority_medium.png
new file mode 100644
index 00000000..9998950d
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_priority_medium.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_priority_off.png b/app/src/main/res/drawable-xxhdpi/ic_action_priority_off.png
new file mode 100644
index 00000000..c829a561
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_priority_off.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_refresh.png b/app/src/main/res/drawable-xxhdpi/ic_action_refresh.png
new file mode 100755
index 00000000..72128fe6
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_refresh.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_remove.png b/app/src/main/res/drawable-xxhdpi/ic_action_remove.png
new file mode 100755
index 00000000..0e95e9b1
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_remove.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_resume.png b/app/src/main/res/drawable-xxhdpi/ic_action_resume.png
new file mode 100755
index 00000000..8aec1abb
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_resume.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_rss.png b/app/src/main/res/drawable-xxhdpi/ic_action_rss.png
new file mode 100644
index 00000000..23705b27
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_rss.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_save.png b/app/src/main/res/drawable-xxhdpi/ic_action_save.png
new file mode 100755
index 00000000..6c87e135
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_save.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_save_dark.png b/app/src/main/res/drawable-xxhdpi/ic_action_save_dark.png
deleted file mode 100644
index ccf8c82c..00000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_action_save_dark.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_save_light.png b/app/src/main/res/drawable-xxhdpi/ic_action_save_light.png
deleted file mode 100644
index 74435004..00000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_action_save_light.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_search.png b/app/src/main/res/drawable-xxhdpi/ic_action_search.png
new file mode 100755
index 00000000..0bbeab15
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_search.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_sort.png b/app/src/main/res/drawable-xxhdpi/ic_action_sort.png
new file mode 100755
index 00000000..d1127ebc
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_sort.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_start.png b/app/src/main/res/drawable-xxhdpi/ic_action_start.png
new file mode 100755
index 00000000..043acd80
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_start.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_stop.png b/app/src/main/res/drawable-xxhdpi/ic_action_stop.png
new file mode 100755
index 00000000..bfa39f3e
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_stop.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_trackers.png b/app/src/main/res/drawable-xxhdpi/ic_action_trackers.png
new file mode 100755
index 00000000..cca0d995
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_trackers.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_turtle_disabled.png b/app/src/main/res/drawable-xxhdpi/ic_action_turtle_disabled.png
new file mode 100644
index 00000000..b87699e4
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_turtle_disabled.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_turtle_enabled.png b/app/src/main/res/drawable-xxhdpi/ic_action_turtle_enabled.png
new file mode 100644
index 00000000..29233de2
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_turtle_enabled.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_empty_details_dark.png b/app/src/main/res/drawable-xxhdpi/ic_empty_details_dark.png
new file mode 100644
index 00000000..0ef4226d
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_empty_details_dark.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_empty_details_light.png b/app/src/main/res/drawable-xxhdpi/ic_empty_details_light.png
new file mode 100644
index 00000000..18b52844
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_empty_details_light.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_launcher.png b/app/src/main/res/drawable-xxhdpi/ic_launcher.png
index 6f6ea1ce..ad7b0678 100644
Binary files a/app/src/main/res/drawable-xxhdpi/ic_launcher.png and b/app/src/main/res/drawable-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/list_focused.9.png b/app/src/main/res/drawable-xxhdpi/list_focused.9.png
new file mode 100755
index 00000000..a9ceddab
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/list_focused.9.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/list_pressed.9.png b/app/src/main/res/drawable-xxhdpi/list_pressed.9.png
new file mode 100755
index 00000000..59505243
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/list_pressed.9.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_action_barcode.png b/app/src/main/res/drawable-xxxhdpi/ic_action_barcode.png
new file mode 100644
index 00000000..7bc409c6
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_action_barcode.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_action_drawer.png b/app/src/main/res/drawable-xxxhdpi/ic_action_drawer.png
new file mode 100755
index 00000000..8d522872
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_action_drawer.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_action_file.png b/app/src/main/res/drawable-xxxhdpi/ic_action_file.png
new file mode 100755
index 00000000..fd24777d
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_action_file.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_launcher.png b/app/src/main/res/drawable-xxxhdpi/ic_launcher.png
new file mode 100644
index 00000000..92513c6d
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/drawable/ab_background_textured_transdroid2.xml b/app/src/main/res/drawable/ab_background_textured_transdroid2.xml
deleted file mode 100644
index d08217b4..00000000
--- a/app/src/main/res/drawable/ab_background_textured_transdroid2.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/abc_list_selector_background_transition_holo_dark.xml b/app/src/main/res/drawable/abc_list_selector_background_transition_holo_dark.xml
deleted file mode 100644
index 0add58c8..00000000
--- a/app/src/main/res/drawable/abc_list_selector_background_transition_holo_dark.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/abc_list_selector_background_transition_holo_light.xml b/app/src/main/res/drawable/abc_list_selector_background_transition_holo_light.xml
deleted file mode 100644
index 0c1d3e67..00000000
--- a/app/src/main/res/drawable/abc_list_selector_background_transition_holo_light.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/activatable_background_transdroid.xml b/app/src/main/res/drawable/activatable_background.xml
similarity index 61%
rename from app/src/main/res/drawable/activatable_background_transdroid.xml
rename to app/src/main/res/drawable/activatable_background.xml
index 20757ad7..c75ab6b4 100644
--- a/app/src/main/res/drawable/activatable_background_transdroid.xml
+++ b/app/src/main/res/drawable/activatable_background.xml
@@ -1,9 +1,7 @@
-
-
-
-
+ android:exitFadeDuration="@android:integer/config_shortAnimTime" >
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/activatable_background_transdroid2.xml b/app/src/main/res/drawable/activatable_background_transdroid2.xml
deleted file mode 100644
index c6c078b0..00000000
--- a/app/src/main/res/drawable/activatable_background_transdroid2.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/btn_cab_done_transdroid2.xml b/app/src/main/res/drawable/btn_cab_done_transdroid2.xml
deleted file mode 100644
index ba1783fc..00000000
--- a/app/src/main/res/drawable/btn_cab_done_transdroid2.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/elevation_shadow.xml b/app/src/main/res/drawable/elevation_shadow.xml
new file mode 100644
index 00000000..5f4221cd
--- /dev/null
+++ b/app/src/main/res/drawable/elevation_shadow.xml
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/elevation_shadow_reverse.xml b/app/src/main/res/drawable/elevation_shadow_reverse.xml
new file mode 100644
index 00000000..55e2c943
--- /dev/null
+++ b/app/src/main/res/drawable/elevation_shadow_reverse.xml
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/pressed_background_transdroid.xml b/app/src/main/res/drawable/pressed_background_transdroid.xml
deleted file mode 100644
index d59067c2..00000000
--- a/app/src/main/res/drawable/pressed_background_transdroid.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/pressed_background_transdroid2.xml b/app/src/main/res/drawable/pressed_background_transdroid2.xml
deleted file mode 100644
index 4998b8fd..00000000
--- a/app/src/main/res/drawable/pressed_background_transdroid2.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/section_header.xml b/app/src/main/res/drawable/section_header.xml
deleted file mode 100644
index d6094f63..00000000
--- a/app/src/main/res/drawable/section_header.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/selectable_background_holo_light.xml b/app/src/main/res/drawable/selectable_background_holo_light.xml
deleted file mode 100644
index 1c180b2e..00000000
--- a/app/src/main/res/drawable/selectable_background_holo_light.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/selectable_background_transdroid.xml b/app/src/main/res/drawable/selectable_background_transdroid.xml
deleted file mode 100644
index 77db9571..00000000
--- a/app/src/main/res/drawable/selectable_background_transdroid.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/selectable_background_transdroid2.xml b/app/src/main/res/drawable/selectable_background_transdroid2.xml
deleted file mode 100644
index 4fbef81c..00000000
--- a/app/src/main/res/drawable/selectable_background_transdroid2.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/spinner_background_ab_transdroid.xml b/app/src/main/res/drawable/spinner_background_ab_transdroid.xml
deleted file mode 100644
index 32edfe7b..00000000
--- a/app/src/main/res/drawable/spinner_background_ab_transdroid.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/spinner_background_ab_transdroid2.xml b/app/src/main/res/drawable/spinner_background_ab_transdroid2.xml
deleted file mode 100644
index d1adeb93..00000000
--- a/app/src/main/res/drawable/spinner_background_ab_transdroid2.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/tab_indicator_ab_transdroid.xml b/app/src/main/res/drawable/tab_indicator_ab_transdroid.xml
deleted file mode 100644
index 5345f3e5..00000000
--- a/app/src/main/res/drawable/tab_indicator_ab_transdroid.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/tab_indicator_ab_transdroid2.xml b/app/src/main/res/drawable/tab_indicator_ab_transdroid2.xml
deleted file mode 100644
index c940e202..00000000
--- a/app/src/main/res/drawable/tab_indicator_ab_transdroid2.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/layout-w600dp/activity_search.xml b/app/src/main/res/layout-w600dp/activity_search.xml
index df073660..610665eb 100644
--- a/app/src/main/res/layout-w600dp/activity_search.xml
+++ b/app/src/main/res/layout-w600dp/activity_search.xml
@@ -15,42 +15,62 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+ android:orientation="horizontal"
+ tools:context=".core.gui.search.SearchActivity_">
-
-
-
+
+
+ android:layout_below="@id/search_toolbar"
+ android:orientation="horizontal">
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout-w600dp/activity_torrents.xml b/app/src/main/res/layout-w600dp/activity_torrents.xml
index 8ff1071a..27c6503c 100644
--- a/app/src/main/res/layout-w600dp/activity_torrents.xml
+++ b/app/src/main/res/layout-w600dp/activity_torrents.xml
@@ -1,27 +1,111 @@
+
-
+ android:orientation="vertical"
+ tools:context=".core.gui.TorrentsActivity_">
+
+
+
+
+
+
+
+
-
+ tools:listitem="@layout/list_item_filter" />
+
-
\ No newline at end of file
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout-w900dp/activity_rssfeeds.xml b/app/src/main/res/layout-w900dp/activity_rssfeeds.xml
index 5937d8fd..6e95698b 100644
--- a/app/src/main/res/layout-w900dp/activity_rssfeeds.xml
+++ b/app/src/main/res/layout-w900dp/activity_rssfeeds.xml
@@ -15,28 +15,45 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+ tools:context=".core.gui.rss.RssfeedsActivity_">
-
-
-
+
+
+
+
-
-
+ android:layout_below="@id/rssfeeds_toolbar"
+ android:baselineAligned="false"
+ android:orientation="horizontal">
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout-w900dp/activity_torrents.xml b/app/src/main/res/layout-w900dp/activity_torrents.xml
index 1571f6a6..23a20447 100644
--- a/app/src/main/res/layout-w900dp/activity_torrents.xml
+++ b/app/src/main/res/layout-w900dp/activity_torrents.xml
@@ -1,35 +1,144 @@
+
-
+ tools:context=".core.gui.TorrentsActivity_">
+
+
+
+
-
-
+ tools:listitem="@layout/list_item_filter" />
-
-
-
\ No newline at end of file
+ android:layout_toEndOf="@id/filters_list"
+ android:layout_toRightOf="@id/filters_list">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/actionbar_addbutton.xml b/app/src/main/res/layout/actionbar_addbutton.xml
new file mode 100644
index 00000000..ec584dfb
--- /dev/null
+++ b/app/src/main/res/layout/actionbar_addbutton.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/actionbar_donebutton.xml b/app/src/main/res/layout/actionbar_donebutton.xml
index 5f0769e7..52f5bb5a 100644
--- a/app/src/main/res/layout/actionbar_donebutton.xml
+++ b/app/src/main/res/layout/actionbar_donebutton.xml
@@ -16,22 +16,25 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+ android:layout_weight="1">
+ android:text="@string/widget_done"
+ android:textColor="?attr/text_actionbar" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/actionbar_navigation.xml b/app/src/main/res/layout/actionbar_navigation.xml
deleted file mode 100644
index 208bbe27..00000000
--- a/app/src/main/res/layout/actionbar_navigation.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/layout/actionbar_searchsite.xml b/app/src/main/res/layout/actionbar_searchsite.xml
index 4ac8d683..7f8abddd 100644
--- a/app/src/main/res/layout/actionbar_searchsite.xml
+++ b/app/src/main/res/layout/actionbar_searchsite.xml
@@ -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">
+ android:textSize="18sp" />
diff --git a/app/src/main/res/layout/actionbar_serverselection.xml b/app/src/main/res/layout/actionbar_serverselection.xml
new file mode 100644
index 00000000..14823b18
--- /dev/null
+++ b/app/src/main/res/layout/actionbar_serverselection.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/actionbar_serverstatus.xml b/app/src/main/res/layout/actionbar_serverstatus.xml
index 0e1f52a9..182dcf57 100644
--- a/app/src/main/res/layout/actionbar_serverstatus.xml
+++ b/app/src/main/res/layout/actionbar_serverstatus.xml
@@ -15,95 +15,107 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+ android:orientation="horizontal">
+
+
+ android:padding="@dimen/ui_serverstatus_margin">
+
+
+ tools:ignore="HardcodedText"
+ tools:visibility="visible"/>
+ android:gravity="end"
+ android:textColor="?attr/text_actionbar"
+ android:textSize="@dimen/ui_serverstatus_bignumber"
+ tools:text="128"/>
+ tools:ignore="HardcodedText"
+ tools:visibility="visible"/>
+ android:gravity="end"
+ android:textColor="?attr/text_actionbar"
+ android:textSize="@dimen/ui_serverstatus_smallnumber"
+ tools:text="1.2 MB/s"/>
+ android:gravity="end"
+ android:textColor="?attr/text_actionbar"
+ android:textSize="@dimen/ui_serverstatus_smallnumber"
+ tools:text="678 KB/s"/>
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_details.xml b/app/src/main/res/layout/activity_details.xml
index 0683e292..50cb593f 100644
--- a/app/src/main/res/layout/activity_details.xml
+++ b/app/src/main/res/layout/activity_details.xml
@@ -1,16 +1,28 @@
-
+ tools:context=".DetailsActivity">
+
+
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_rssfeeds.xml b/app/src/main/res/layout/activity_rssfeeds.xml
index 6517460e..d10a4994 100644
--- a/app/src/main/res/layout/activity_rssfeeds.xml
+++ b/app/src/main/res/layout/activity_rssfeeds.xml
@@ -15,17 +15,29 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+ tools:context=".core.gui.rss.RssfeedsActivity_">
+
+
+
+
-
+
diff --git a/app/src/main/res/layout/activity_rssitems.xml b/app/src/main/res/layout/activity_rssitems.xml
index b233ad1f..c5276b65 100644
--- a/app/src/main/res/layout/activity_rssitems.xml
+++ b/app/src/main/res/layout/activity_rssitems.xml
@@ -15,17 +15,29 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+ tools:context=".core.gui.rss.RssitemsActivity_">
+
+
+
+
+ android:layout_below="@id/rssfeeds_toolbar"
+ tools:layout="@layout/fragment_rssitems"/>
-
+
diff --git a/app/src/main/res/layout/activity_search.xml b/app/src/main/res/layout/activity_search.xml
index 585d5856..d4a93c52 100644
--- a/app/src/main/res/layout/activity_search.xml
+++ b/app/src/main/res/layout/activity_search.xml
@@ -15,31 +15,49 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+ tools:context=".core.gui.search.SearchActivity_">
-
+
+
+ android:layout_below="@id/search_toolbar">
-
+
+
+
+
+
+
+
-
+
diff --git a/app/src/main/res/layout/activity_torrents.xml b/app/src/main/res/layout/activity_torrents.xml
index ab99ebe6..50743180 100644
--- a/app/src/main/res/layout/activity_torrents.xml
+++ b/app/src/main/res/layout/activity_torrents.xml
@@ -1,16 +1,124 @@
-
- .
+-->
+
+
+ tools:context=".core.gui.TorrentsActivity_">
-
+
+ android:orientation="vertical">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/dialog_about.xml b/app/src/main/res/layout/dialog_about.xml
index 2e01e4ee..b5bb81c9 100644
--- a/app/src/main/res/layout/dialog_about.xml
+++ b/app/src/main/res/layout/dialog_about.xml
@@ -35,6 +35,7 @@
android:drawableLeft="@drawable/ic_launcher"
android:drawablePadding="@dimen/margin_half"
android:fontFamily="sans-serif-condensed"
+ android:gravity="center_vertical"
android:text="@string/app_name"
android:textColor="@android:color/white"
android:textSize="36sp" />
diff --git a/app/src/main/res/layout/dialog_setlabel.xml b/app/src/main/res/layout/dialog_setlabel.xml
index 0ccfc84d..5829c3c8 100644
--- a/app/src/main/res/layout/dialog_setlabel.xml
+++ b/app/src/main/res/layout/dialog_setlabel.xml
@@ -16,44 +16,35 @@
along with Transdroid. If not, see .
-->
+ android:padding="@dimen/margin_default"
+ android:orientation="vertical">
-
-
+ android:layout_marginBottom="@dimen/margin_half"
+ style="@style/SectionHeader"/>
-
-
-
+ tools:listitem="@layout/list_item_simple"/>
+
-
+ android:layout_marginBottom="@dimen/margin_half"
+ style="@style/SectionHeader"/>
+
+ android:padding="@dimen/margin_default">
+ android:padding="@dimen/margin_default">
+ android:layout_height="0.75dp"
+ android:background="@color/green_light" />
+ android:layout_height="0.75dp"
+ android:background="@color/green_light" />
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:layout_height="0.75dp"
+ android:background="@color/green_light" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_filters.xml b/app/src/main/res/layout/dialog_url.xml
similarity index 76%
rename from app/src/main/res/layout/fragment_filters.xml
rename to app/src/main/res/layout/dialog_url.xml
index 50d8606f..4ec7f4bc 100644
--- a/app/src/main/res/layout/fragment_filters.xml
+++ b/app/src/main/res/layout/dialog_url.xml
@@ -17,13 +17,15 @@
-->
+ android:layout_height="match_parent"
+ android:padding="@dimen/margin_default">
-
+ android:layout_height="wrap_content"
+ android:hint="@string/navigation_url_hint"
+ android:inputType="textUri"
+ android:singleLine="true" />
diff --git a/app/src/main/res/layout/fragment_details.xml b/app/src/main/res/layout/fragment_details.xml
index 02356267..f6d86ad0 100644
--- a/app/src/main/res/layout/fragment_details.xml
+++ b/app/src/main/res/layout/fragment_details.xml
@@ -15,36 +15,65 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+ android:layout_height="match_parent"
+ tools:context=".core.gui.DetailsActivity_">
-
+
+
+
+
+ android:layout_above="@id/details_menu">
+
+
+
+
+ android:visibility="gone"
+ tools:visibility="visible" />
-
-
+ android:visibility="gone"
+ tools:visibility="visible"/>
+
+
+
+
diff --git a/app/src/main/res/layout/fragment_rssfeeds.xml b/app/src/main/res/layout/fragment_rssfeeds.xml
index 845020ea..2c3c1421 100644
--- a/app/src/main/res/layout/fragment_rssfeeds.xml
+++ b/app/src/main/res/layout/fragment_rssfeeds.xml
@@ -16,16 +16,16 @@
along with Transdroid. If not, see .
-->
+ android:layout_height="match_parent">
+ android:visibility="gone"/>
+ android:visibility="gone"
+ tools:visibility="visible"/>
diff --git a/app/src/main/res/layout/fragment_rssitems.xml b/app/src/main/res/layout/fragment_rssitems.xml
index 4dd073fc..bc81587d 100644
--- a/app/src/main/res/layout/fragment_rssitems.xml
+++ b/app/src/main/res/layout/fragment_rssitems.xml
@@ -17,14 +17,13 @@
-->
+ android:layout_height="match_parent">
.
-->
+ android:layout_height="match_parent">
+ android:visibility="gone"
+ tools:listitem="@layout/list_item_searchresult"
+ tools:visibility="visible" />
-
+
.
-->
+ android:layout_height="match_parent">
-
+ android:layout_height="match_parent">
+
+
+
+
+ android:visibility="visible"
+ tools:visibility="gone" />
.
-->
+ android:paddingTop="@dimen/margin_half">
+ android:padding="@dimen/margin_default" >
+ android:gravity="center_vertical"
+ android:textIsSelectable="false"
+ tools:text="Custom RSS Feed"/>
+ android:textIsSelectable="false"
+ tools:text="28"/>
.
-->
+ android:paddingTop="@dimen/margin_default">
+ android:textSize="@dimen/text_enlarged"
+ tools:text="Test RSS Item Text Here"/>
+ android:textSize="@dimen/text_small"
+ tools:text="25-12-2015"/>
diff --git a/app/src/main/res/layout/list_item_searchresult.xml b/app/src/main/res/layout/list_item_searchresult.xml
index 85f572d4..a9c0b158 100644
--- a/app/src/main/res/layout/list_item_searchresult.xml
+++ b/app/src/main/res/layout/list_item_searchresult.xml
@@ -16,13 +16,14 @@
along with Transdroid. If not, see .
-->
+ android:paddingTop="@dimen/margin_half">
+ android:textSize="@dimen/text_enlarged"
+ tools:text="Torrent.Title.2016.1080p.mkv" />
-
+ android:textSize="@dimen/text_small"
+ tools:text="@string/search_seeders" />
+
-
+ android:textSize="@dimen/text_small"
+ tools:text="@string/search_leechers" />
+
+ android:textSize="@dimen/text_small"
+ tools:text="1.5GB" />
-
+ android:textSize="@dimen/text_small"
+ tools:text="0 weeks ago" />
+
diff --git a/app/src/main/res/layout/list_item_searchsite.xml b/app/src/main/res/layout/list_item_searchsite.xml
index 18bbd480..23cb163e 100644
--- a/app/src/main/res/layout/list_item_searchsite.xml
+++ b/app/src/main/res/layout/list_item_searchsite.xml
@@ -19,17 +19,18 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:background="?attr/activatable_background_transdroid"
+ android:background="?attr/activatable_background"
android:orientation="horizontal"
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">
@@ -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" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/list_item_separator.xml b/app/src/main/res/layout/list_item_separator.xml
index 322c093d..1cd501a8 100644
--- a/app/src/main/res/layout/list_item_separator.xml
+++ b/app/src/main/res/layout/list_item_separator.xml
@@ -18,8 +18,8 @@
+ android:paddingLeft="@dimen/margin_default"
+ android:paddingRight="@dimen/margin_default">
+ android:paddingTop="4dip">
+ android:textIsSelectable="false"
+ android:textSize="@dimen/text_default" />
diff --git a/app/src/main/res/layout/list_item_torrent.xml b/app/src/main/res/layout/list_item_torrent.xml
index d1e3a095..24a5e052 100644
--- a/app/src/main/res/layout/list_item_torrent.xml
+++ b/app/src/main/res/layout/list_item_torrent.xml
@@ -16,34 +16,41 @@
along with Transdroid. If not, see .
-->
+ android:paddingEnd="@dimen/margin_default"
+ android:paddingBottom="@dimen/margin_half">
+ android:textSize="@dimen/text_enlarged"
+ tools:text="Torrent.Title.That.Can-Be.Long.2015.1080p.Group.Release.mkv" />
+ android:textSize="@dimen/text_small"
+ tools:text="RATIO 2.3" />
+ android:textSize="@dimen/text_small"
+ tools:text="6.6GB, UPLOADED 15GB"/>
+ android:textSize="@dimen/text_small"
+ tools:text="280 KB/s" />
+ android:textSize="@dimen/text_small"
+ tools:text="28 OF 102 SEEDERS" />
diff --git a/app/src/main/res/layout/list_item_torrentfile.xml b/app/src/main/res/layout/list_item_torrentfile.xml
index 8decf552..815750f0 100644
--- a/app/src/main/res/layout/list_item_torrentfile.xml
+++ b/app/src/main/res/layout/list_item_torrentfile.xml
@@ -16,14 +16,15 @@
along with Transdroid. If not, see .
-->
+ android:paddingTop="@dimen/margin_half">
+ android:textSize="@dimen/text_enlarged"
+ tools:text="File.In.Torrent.Title.Which.Can.Be.Long.2016.1080p.Release.mkv" />
+ android:textSize="@dimen/text_small"
+ tools:text="41%" />
+ android:textSize="@dimen/text_small"
+ tools:text="3.4GB / 8.2GB" />
diff --git a/app/src/main/res/layout/list_item_widget_dark.xml b/app/src/main/res/layout/list_item_widget_dark.xml
index 0b1aa4a0..506f72fd 100644
--- a/app/src/main/res/layout/list_item_widget_dark.xml
+++ b/app/src/main/res/layout/list_item_widget_dark.xml
@@ -19,7 +19,7 @@
android:id="@+id/widget_line_layout"
android:layout_width="fill_parent"
android:layout_height="@dimen/widget_list_item_height"
- android:background="@drawable/selectable_background_transdroid"
+ android:background="?android:attr/selectableItemBackground"
android:paddingRight="@dimen/widget_list_item_padding" >
diff --git a/app/src/main/res/layout/widget_torrents_dark.xml b/app/src/main/res/layout/widget_torrents_dark.xml
index 412b6d86..70b4856b 100644
--- a/app/src/main/res/layout/widget_torrents_dark.xml
+++ b/app/src/main/res/layout/widget_torrents_dark.xml
@@ -20,13 +20,13 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background_dark"
- android:padding="@dimen/margin_widget" >
+ android:padding="@dimen/margin_widget">
+ android:src="@drawable/ic_action_refresh" />
-
+ android:src="@drawable/ic_action_pause" />
+
-
+ android:src="@drawable/ic_action_resume" />
+
+ android:paddingTop="3dp">
+ android:visibility="gone">
-
+
+ android:src="@drawable/ic_action_refresh" />
+ android:src="@drawable/ic_action_pause" />
+ android:src="@drawable/ic_action_resume" />
diff --git a/app/src/main/res/menu/activity_deleteableprefs.xml b/app/src/main/res/menu/activity_deleteableprefs.xml
index a45ae1d6..8441ab6e 100644
--- a/app/src/main/res/menu/activity_deleteableprefs.xml
+++ b/app/src/main/res/menu/activity_deleteableprefs.xml
@@ -14,12 +14,13 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+
+ android:icon="@drawable/ic_action_remove"
+ android:title="@string/action_removesettings"
+ app:showAsAction="always" />
diff --git a/app/src/main/res/menu/activity_details.xml b/app/src/main/res/menu/activity_details.xml
index 7d5314cb..5aedcb11 100644
--- a/app/src/main/res/menu/activity_details.xml
+++ b/app/src/main/res/menu/activity_details.xml
@@ -14,13 +14,14 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+
+ app:showAsAction="always" />
diff --git a/app/src/main/res/menu/activity_search.xml b/app/src/main/res/menu/activity_search.xml
index 0f3e5c90..1d81b7fd 100644
--- a/app/src/main/res/menu/activity_search.xml
+++ b/app/src/main/res/menu/activity_search.xml
@@ -14,21 +14,23 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+
+ android:icon="@drawable/ic_action_search"
+ android:title="@string/action_search"
+ app:actionViewClass="android.support.v7.widget.SearchView"
+ app:showAsAction="collapseActionView|ifRoom" />
+ android:icon="@drawable/ic_action_refresh"
+ android:title="@string/action_refresh"
+ app:showAsAction="ifRoom" />
+ android:title="@string/search_download"
+ app:showAsAction="always" />
diff --git a/app/src/main/res/menu/activity_torrents.xml b/app/src/main/res/menu/activity_torrents.xml
deleted file mode 100644
index 3e7d2c81..00000000
--- a/app/src/main/res/menu/activity_torrents.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/menu/activity_torrents_main.xml b/app/src/main/res/menu/activity_torrents_main.xml
new file mode 100644
index 00000000..e0e49386
--- /dev/null
+++ b/app/src/main/res/menu/activity_torrents_main.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/menu/activity_torrents_secondary.xml b/app/src/main/res/menu/activity_torrents_secondary.xml
new file mode 100644
index 00000000..484ded52
--- /dev/null
+++ b/app/src/main/res/menu/activity_torrents_secondary.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/menu/dialog_about.xml b/app/src/main/res/menu/dialog_about.xml
index 4ee783d6..26f31d46 100644
--- a/app/src/main/res/menu/dialog_about.xml
+++ b/app/src/main/res/menu/dialog_about.xml
@@ -14,12 +14,13 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+
+ android:icon="@drawable/ic_action_link"
+ android:title="@string/action_visitwebsite"
+ app:showAsAction="always" />
diff --git a/app/src/main/res/menu/fragment_details.xml b/app/src/main/res/menu/fragment_details.xml
index 75a6043f..25f0ad5f 100644
--- a/app/src/main/res/menu/fragment_details.xml
+++ b/app/src/main/res/menu/fragment_details.xml
@@ -14,77 +14,86 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+
+ app:showAsAction="always" />
+ app:showAsAction="always" />
-
+ app:showAsAction="always">
-
-
+
+
+ app:showAsAction="always" />
+ app:showAsAction="always" />
-
+ app:showAsAction="always">
-
-
+
+
+ app:showAsAction="always" />
+ app:showAsAction="always" />
+ app:showAsAction="always" />
+ app:showAsAction="always" />
diff --git a/app/src/main/res/menu/fragment_details_cab.xml b/app/src/main/res/menu/fragment_details_cab_main.xml
similarity index 57%
rename from app/src/main/res/menu/fragment_details_cab.xml
rename to app/src/main/res/menu/fragment_details_cab_main.xml
index f0bfa6d8..793d147d 100644
--- a/app/src/main/res/menu/fragment_details_cab.xml
+++ b/app/src/main/res/menu/fragment_details_cab_main.xml
@@ -14,35 +14,33 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+
+ android:icon="@drawable/ic_action_priority_off"
+ android:title="@string/action_priority_off"
+ app:showAsAction="always" />
+ android:icon="@drawable/ic_action_priority_low"
+ android:title="@string/action_priority_low"
+ app:showAsAction="always" />
+ android:icon="@drawable/ic_action_priority_medium"
+ android:title="@string/action_priority_normal"
+ app:showAsAction="always" />
+ android:icon="@drawable/ic_action_priority_high"
+ android:title="@string/action_priority_high"
+ app:showAsAction="always" />
-
+ android:icon="@drawable/ic_action_download"
+ android:title="@string/action_download"
+ app:showAsAction="always" />
diff --git a/app/src/main/res/menu/fragment_details_cab_secondary.xml b/app/src/main/res/menu/fragment_details_cab_secondary.xml
new file mode 100644
index 00000000..75961ab7
--- /dev/null
+++ b/app/src/main/res/menu/fragment_details_cab_secondary.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/menu/fragment_rssfeeds.xml b/app/src/main/res/menu/fragment_rssfeeds.xml
index 1ba3deb3..b27802fe 100644
--- a/app/src/main/res/menu/fragment_rssfeeds.xml
+++ b/app/src/main/res/menu/fragment_rssfeeds.xml
@@ -14,16 +14,16 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+
-
+ android:icon="@drawable/ic_action_refresh"
+ android:title="@string/action_refresh"
+ app:showAsAction="ifRoom" />
+ android:title="@string/action_settings" />
diff --git a/app/src/main/res/menu/fragment_rssitems_cab.xml b/app/src/main/res/menu/fragment_rssitems_cab.xml
index 6e0f14df..d2b110d5 100644
--- a/app/src/main/res/menu/fragment_rssitems_cab.xml
+++ b/app/src/main/res/menu/fragment_rssitems_cab.xml
@@ -14,31 +14,32 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+
+ android:icon="@drawable/ic_action_add"
+ android:title="@string/action_addall"
+ app:showAsAction="always" />
+ android:icon="@drawable/ic_action_info"
+ android:title="@string/action_showdetails"
+ app:showAsAction="ifRoom" />
+ android:icon="@drawable/ic_action_link"
+ android:title="@string/action_openwebsite"
+ app:showAsAction="ifRoom" />
+ android:icon="@drawable/ic_action_search"
+ android:title="@string/action_useassearch"
+ app:showAsAction="ifRoom" />
+ android:title="@string/action_copytoclipboard"
+ app:showAsAction="never" />
\ No newline at end of file
diff --git a/app/src/main/res/menu/fragment_searchresults_cab.xml b/app/src/main/res/menu/fragment_searchresults_cab.xml
index 5bdbe14c..743afe70 100644
--- a/app/src/main/res/menu/fragment_searchresults_cab.xml
+++ b/app/src/main/res/menu/fragment_searchresults_cab.xml
@@ -14,18 +14,18 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+
-
+ android:icon="@drawable/ic_action_add"
+ android:title="@string/action_addall"
+ app:showAsAction="ifRoom" />
-
+ android:icon="@drawable/ic_action_link"
+ android:title="@string/action_showdetails"
+ app:showAsAction="ifRoom" />
+
diff --git a/app/src/main/res/menu/fragment_torrents_cab.xml b/app/src/main/res/menu/fragment_torrents_cab.xml
index 91fd0a8a..aeaabece 100644
--- a/app/src/main/res/menu/fragment_torrents_cab.xml
+++ b/app/src/main/res/menu/fragment_torrents_cab.xml
@@ -14,42 +14,47 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see .
-->
-
+
+ android:icon="@drawable/ic_action_resume"
+ android:title="@string/action_resume"
+ app:showAsAction="always" />
+ android:icon="@drawable/ic_action_pause"
+ android:title="@string/action_pause"
+ app:showAsAction="always" />
+ android:icon="@drawable/ic_action_start"
+ android:title="@string/action_start"
+ app:showAsAction="always" />
+ android:icon="@drawable/ic_action_stop"
+ android:title="@string/action_stop"
+ app:showAsAction="always" />
-
+ android:icon="@drawable/ic_action_remove"
+ android:title="@string/action_remove"
+ app:showAsAction="always">
-
-
+
+
+ android:icon="@drawable/ic_action_labels"
+ android:title="@string/action_setlabel"
+ app:showAsAction="always" />
diff --git a/app/src/main/res/values-v16/styles.xml b/app/src/main/res/values-v16/styles.xml
index ac7e73c9..9415bbe4 100644
--- a/app/src/main/res/values-v16/styles.xml
+++ b/app/src/main/res/values-v16/styles.xml
@@ -16,33 +16,21 @@
-->
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values-w600dp/dimens.xml b/app/src/main/res/values-w600dp/dimens.xml
new file mode 100644
index 00000000..a5411a8f
--- /dev/null
+++ b/app/src/main/res/values-w600dp/dimens.xml
@@ -0,0 +1,7 @@
+
+
+
+
+ 180dp
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml
index 71ca0075..93b23a5d 100644
--- a/app/src/main/res/values/attrs.xml
+++ b/app/src/main/res/values/attrs.xml
@@ -21,33 +21,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index d9096474..0dbf30ee 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -16,22 +16,25 @@
along with Transdroid. If not, see .
-->
-
-
- #8acc12
+
+
+ #A5D6A7
+ #388E3C
+ #1B5E20
+ #757575
#7dbb21
- #c81113
- #aada62
-
+ #C62828
+
- #42a8fa
- #a759d4
- #8acc12
- #de3939
- #9e9e9e
- #c8e88e
- #8acc12
- #4b6617
- #9e9e9e
-
+ #1E88E5
+ #AB47BC
+ #66BB6A
+ #C62828
+ #757575
+ #BDBDBD
+ #A5D6A7
+ #66BB6A
+ #1B5E20
+ #757575
+
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 2526d1d3..9ab53fc4 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -31,13 +31,15 @@
14sp
+ 220dp
17sp
14sp
+ 75dp
105dp
2dp
3dp
21sp
- 15dp
+ 17dp
13dp
56dp
20sp
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 19556cc4..6d47642e 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -70,13 +70,15 @@
Remove settings
Visit transdroid.org
Close
-
+
+ Select server and filter
+ Close filters list
%1$s allows you to monitor and manage the torrent client you run at home or on your seedbox. Setting things up can be a bit tricky, but we offer step-by-step guides and promise it\'ll be worth it!
Connected, but no torrents are active within the current filter
Select a torrent to view its details
- SERVERS
- STATUS
- LABELS
+ Servers
+ Status
+ Labels
All
Downloading
Uploading
@@ -94,6 +96,7 @@
Select finished
Invert selection
Add torrent to…
+ http://…
STATUS: %1$s
Waiting to check…
@@ -219,6 +222,7 @@
Servers
Add new server
+ Add normal, custom server
Add seedbox
Default server
Last used
@@ -365,7 +369,8 @@
- BitTorrent 6+
- Buffalo NAS -1.31
- Deluge 1.2+
- - DLink Router BT
+ - DLink Router BT
+ - Dummy
- Ktorrent
- qBittorrent
- rTorrent
@@ -382,7 +387,8 @@
- daemon_bittorrent
- daemon_buffalonas
- daemon_deluge
- - daemon_dlinkrouterbt
+ - daemon_dlinkrouterbt
+ - daemon_dummy
- daemon_ktorrent
- daemon_qbittorrent
- daemon_rtorrent
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 6f662670..84f7f90d 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -17,76 +17,14 @@
-
+
-
+
+
+
+
+
+
+
-
-
-
-
-
diff --git a/app/src/main/res/values/styles_transdroid_dark.xml b/app/src/main/res/values/styles_transdroid_dark.xml
index 9af553e7..5cda3e43 100644
--- a/app/src/main/res/values/styles_transdroid_dark.xml
+++ b/app/src/main/res/values/styles_transdroid_dark.xml
@@ -18,38 +18,17 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/values/styles_transdroid_light.xml b/app/src/main/res/values/styles_transdroid_light.xml
index d45b464d..68902f36 100644
--- a/app/src/main/res/values/styles_transdroid_light.xml
+++ b/app/src/main/res/values/styles_transdroid_light.xml
@@ -17,50 +17,20 @@
limitations under the License.
-->
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/xml/pref_main.xml b/app/src/main/res/xml/pref_main.xml
index 584b1cab..3555ea98 100644
--- a/app/src/main/res/xml/pref_main.xml
+++ b/app/src/main/res/xml/pref_main.xml
@@ -21,7 +21,7 @@
android:key="header_servers"
android:title="@string/pref_servers"
android:order="0">
-
diff --git a/build.gradle b/build.gradle
index d01cceaa..38dcdda5 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,16 +1,16 @@
buildscript {
repositories {
- mavenCentral()
+ jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:0.12.2'
- classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4+'
+ classpath 'com.android.tools.build:gradle:1.1.0'
+ classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
allprojects {
repositories {
- mavenCentral()
+ jcenter()
mavenLocal()
}
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 1e61d1fd..7255ecf6 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Wed Apr 10 15:27:10 PDT 2013
+#Tue Dec 09 09:45:38 CET 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip