Browse Source

Replacing Holo design with Material design in dialogs.

material
Eric Kok 10 years ago
parent
commit
3506705a82
  1. 5
      app/src/main/java/org/transdroid/core/gui/DetailsActivity.java
  2. 12
      app/src/main/java/org/transdroid/core/gui/DetailsFragment.java
  3. 6
      app/src/main/java/org/transdroid/core/gui/ServerStatusView.java
  4. 20
      app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
  5. 3
      app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java
  6. 106
      app/src/main/java/org/transdroid/core/gui/navigation/SetLabelDialog.java
  7. 78
      app/src/main/java/org/transdroid/core/gui/navigation/SetStorageLocationDialog.java
  8. 79
      app/src/main/java/org/transdroid/core/gui/navigation/SetTrackersDialog.java
  9. 124
      app/src/main/java/org/transdroid/core/gui/navigation/SetTransferRatesDialog.java
  10. 4
      app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java
  11. 2
      app/src/main/java/org/transdroid/core/gui/rss/RssitemsFragment.java
  12. 2
      app/src/main/java/org/transdroid/core/gui/search/SearchResultsFragment.java
  13. 1
      app/src/main/java/org/transdroid/core/gui/search/UrlEntryDialog.java
  14. 10
      app/src/main/java/org/transdroid/core/gui/settings/SystemSettingsActivity.java
  15. 2
      app/src/main/java/org/transdroid/core/seedbox/XirvikSharedSettingsActivity.java
  16. 13
      app/src/main/res/layout/actionbar_serverstatus.xml
  17. 1
      app/src/main/res/layout/dialog_setlabel.xml
  18. 2
      app/src/main/res/layout/dialog_storagelocation.xml
  19. 2
      app/src/main/res/layout/dialog_trackers.xml
  20. 57
      app/src/main/res/layout/dialog_transferrates.xml
  21. 1
      app/src/main/res/layout/dialog_url.xml
  22. 3
      app/src/main/res/values/colors.xml
  23. 1
      app/src/main/res/values/styles_transdroid_light.xml

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

@ -22,7 +22,6 @@ import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.ActionBarActivity; import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.widget.Toast;
import com.nispok.snackbar.Snackbar; import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager; import com.nispok.snackbar.SnackbarManager;
@ -260,7 +259,7 @@ public class DetailsActivity extends ActionBarActivity implements TorrentTasksEx
setResult(RESULT_OK, new Intent().putExtra("torrent_removed", true).putExtra("affected_torrent", torrent)); setResult(RESULT_OK, new Intent().putExtra("torrent_removed", true).putExtra("affected_torrent", torrent));
finish(); finish();
if (closeText != null) { if (closeText != null) {
Toast.makeText(this, closeText, Toast.LENGTH_LONG).show(); SnackbarManager.show(Snackbar.with(this).text(closeText));
} }
} }
@ -349,7 +348,7 @@ public class DetailsActivity extends ActionBarActivity implements TorrentTasksEx
String error = getString(LocalTorrent.getResourceForDaemonException(result.getException())); String error = getString(LocalTorrent.getResourceForDaemonException(result.getException()));
fragmentDetails.updateIsLoading(false, isCritical ? error : null); fragmentDetails.updateIsLoading(false, isCritical ? error : null);
SnackbarManager.show(Snackbar.with(this).text(getString(LocalTorrent.getResourceForDaemonException(result.getException()))) SnackbarManager.show(Snackbar.with(this).text(getString(LocalTorrent.getResourceForDaemonException(result.getException())))
.colorResource(R.color.crouton_error)); .colorResource(R.color.red));
} }
@UiThread @UiThread

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

@ -37,6 +37,7 @@ import android.widget.TextView;
import com.nispok.snackbar.Snackbar; import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager; import com.nispok.snackbar.SnackbarManager;
import com.nispok.snackbar.enums.SnackbarType;
import org.androidannotations.annotations.AfterViews; import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Click; import org.androidannotations.annotations.Click;
@ -406,7 +407,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
@OptionsItem(R.id.action_setlabel) @OptionsItem(R.id.action_setlabel)
protected void setLabel() { protected void setLabel() {
if (currentLabels != null) { if (currentLabels != null) {
new SetLabelDialog().setOnLabelPickedListener(this).setCurrentLabels(currentLabels).show(getFragmentManager(), "SetLabelDialog"); SetLabelDialog.show(getActivity(), this, currentLabels);
} }
} }
@ -421,14 +422,12 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
SnackbarManager.show(Snackbar.with(getActivity()).text(R.string.error_stillloadingdetails)); SnackbarManager.show(Snackbar.with(getActivity()).text(R.string.error_stillloadingdetails));
return; return;
} }
new SetTrackersDialog().setOnTrackersUpdated(this).setCurrentTrackers(torrentDetails.getTrackersText()) SetTrackersDialog.show(getActivity(), this, torrentDetails.getTrackersText());
.show(getFragmentManager(), "SetTrackersDialog");
} }
@OptionsItem(R.id.action_changelocation) @OptionsItem(R.id.action_changelocation)
protected void changeStorageLocation() { protected void changeStorageLocation() {
new SetStorageLocationDialog().setOnStorageLocationUpdated(this).setCurrentLocation(torrent.getLocationDir()) SetStorageLocationDialog.show(getActivity(), this, torrent.getLocationDir());
.show(getFragmentManager(), "SetStorageLocationDialog");
} }
@Override @Override
@ -585,7 +584,8 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
} }
// No app is available that can handle FTP downloads // No app is available that can handle FTP downloads
SnackbarManager.show(Snackbar.with(getActivity()).text(R.string.error_noftpapp).colorResource(R.color.crouton_error)); SnackbarManager.show(Snackbar.with(getActivity()).text(getString(R.string.error_noftpapp, url)).type(SnackbarType.MULTI_LINE)
.colorResource(R.color.red));
mode.finish(); mode.finish();
return true; return true;

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

@ -27,7 +27,6 @@ import com.nispok.snackbar.SnackbarManager;
import org.androidannotations.annotations.EViewGroup; import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById; import org.androidannotations.annotations.ViewById;
import org.transdroid.R; 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;
import org.transdroid.core.gui.navigation.SetTransferRatesDialog.OnRatesPickedListener; import org.transdroid.core.gui.navigation.SetTransferRatesDialog.OnRatesPickedListener;
import org.transdroid.daemon.Torrent; import org.transdroid.daemon.Torrent;
@ -99,8 +98,7 @@ public class ServerStatusView extends RelativeLayout implements OnRatesPickedLis
private OnClickListener onStartDownPickerClicked = new OnClickListener() { private OnClickListener onStartDownPickerClicked = new OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
new SetTransferRatesDialog().setOnRatesPickedListener(ServerStatusView.this) SetTransferRatesDialog.show(getContext(), ServerStatusView.this);
.show(activity.getFragmentManager(), "SetTransferRatesDialog");
} }
}; };
@ -116,7 +114,7 @@ public class ServerStatusView extends RelativeLayout implements OnRatesPickedLis
@Override @Override
public void onInvalidNumber() { public void onInvalidNumber() {
SnackbarManager.show(Snackbar.with(activity).text(R.string.error_notanumber).colorResource(R.color.crouton_error)); SnackbarManager.show(Snackbar.with(activity).text(R.string.error_notanumber).colorResource(R.color.red));
} }
} }

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

@ -648,7 +648,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
return; return;
} }
if (dataUri.getScheme() == null) { if (dataUri.getScheme() == null) {
SnackbarManager.show(Snackbar.with(this).text(R.string.error_invalid_url_form).colorResource(R.color.crouton_error)); SnackbarManager.show(Snackbar.with(this).text(R.string.error_invalid_url_form).colorResource(R.color.red));
return; return;
} }
@ -781,7 +781,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
protected void onBarcodeScanHandled(String barcode, String result) { protected void onBarcodeScanHandled(String barcode, String result) {
log.d(this, "Scanned barcode " + barcode + " and got " + result); log.d(this, "Scanned barcode " + barcode + " and got " + result);
if (TextUtils.isEmpty(result)) { if (TextUtils.isEmpty(result)) {
SnackbarManager.show(Snackbar.with(this).text(R.string.error_noproductforcode).colorResource(R.color.crouton_error) SnackbarManager.show(Snackbar.with(this).text(R.string.error_noproductforcode).colorResource(R.color.red)
.type(SnackbarType.MULTI_LINE)); .type(SnackbarType.MULTI_LINE));
} else if (result.startsWith("http") || result.startsWith("https")) { } else if (result.startsWith("http") || result.startsWith("https")) {
addTorrentByUrl(result, "QR code result"); // No torrent title known addTorrentByUrl(result, "QR code result"); // No torrent title known
@ -1044,10 +1044,10 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
} catch (SecurityException e) { } catch (SecurityException e) {
// No longer access to this file // No longer access to this file
log.e(this, "No access given to " + contentUri.toString() + ": " + e.toString()); log.e(this, "No access given to " + contentUri.toString() + ": " + e.toString());
SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.crouton_error)); SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.red));
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
log.e(this, contentUri.toString() + " does not exist: " + e.toString()); log.e(this, contentUri.toString() + " does not exist: " + e.toString());
SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.crouton_error)); SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.red));
} }
} }
@ -1059,7 +1059,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
addTorrentFromStream(input, title); addTorrentFromStream(input, title);
} catch (Exception e) { } catch (Exception e) {
log.e(this, "Can't download private site torrent " + url + " from " + source + ": " + e.toString()); log.e(this, "Can't download private site torrent " + url + " from " + source + ": " + e.toString());
SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.crouton_error)); SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.red));
} }
} }
@ -1087,14 +1087,14 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
response.getStatusLine().getStatusCode() == HttpStatus.SC_NOT_FOUND) { response.getStatusLine().getStatusCode() == HttpStatus.SC_NOT_FOUND) {
log.e(this, "Can't retrieve web torrent " + url + ": Unexpected HTTP response status code " + log.e(this, "Can't retrieve web torrent " + url + ": Unexpected HTTP response status code " +
response.getStatusLine().toString()); response.getStatusLine().toString());
SnackbarManager.show(Snackbar.with(this).text(R.string.error_401).colorResource(R.color.crouton_error)); SnackbarManager.show(Snackbar.with(this).text(R.string.error_401).colorResource(R.color.red));
return; return;
} }
InputStream input = response.getEntity().getContent(); InputStream input = response.getEntity().getContent();
addTorrentFromStream(input, title); addTorrentFromStream(input, title);
} catch (Exception e) { } catch (Exception e) {
log.e(this, "Can't retrieve web torrent " + url + ": " + e.toString()); log.e(this, "Can't retrieve web torrent " + url + ": " + e.toString());
SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.crouton_error)); SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.red));
} }
} }
@ -1120,7 +1120,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
} }
} catch (IOException e) { } catch (IOException e) {
log.e(this, "Can't write input stream to " + tempFile.toString() + ": " + e.toString()); log.e(this, "Can't write input stream to " + tempFile.toString() + ": " + e.toString());
SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.crouton_error)); SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.red));
} finally { } finally {
try { try {
if (input != null) { if (input != null) {
@ -1128,7 +1128,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
} }
} catch (IOException e) { } catch (IOException e) {
log.e(this, "Error closing the input stream " + tempFile.toString() + ": " + e.toString()); log.e(this, "Error closing the input stream " + tempFile.toString() + ": " + e.toString());
SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.crouton_error)); SnackbarManager.show(Snackbar.with(this).text(R.string.error_torrentfile).colorResource(R.color.red));
} }
} }
} }
@ -1273,7 +1273,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
//noinspection ThrowableResultOfMethodCallIgnored //noinspection ThrowableResultOfMethodCallIgnored
log.i(this, result.getException().toString()); log.i(this, result.getException().toString());
String error = getString(LocalTorrent.getResourceForDaemonException(result.getException())); String error = getString(LocalTorrent.getResourceForDaemonException(result.getException()));
SnackbarManager.show(Snackbar.with(this).text(error).colorResource(R.color.crouton_error).type(SnackbarType.MULTI_LINE)); SnackbarManager.show(Snackbar.with(this).text(error).colorResource(R.color.red).type(SnackbarType.MULTI_LINE));
fragmentTorrents.updateIsLoading(false); fragmentTorrents.updateIsLoading(false);
if (isCritical) { if (isCritical) {
fragmentTorrents.updateError(error); fragmentTorrents.updateError(error);

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

@ -355,8 +355,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
} else if (itemId == R.id.action_setlabel) { } else if (itemId == R.id.action_setlabel) {
lastMultiSelectedTorrents = checked; lastMultiSelectedTorrents = checked;
if (currentLabels != null) { if (currentLabels != null) {
new SetLabelDialog().setOnLabelPickedListener(TorrentsFragment.this).setCurrentLabels(currentLabels) SetLabelDialog.show(getActivity(), TorrentsFragment.this,currentLabels);
.show(getFragmentManager(), "SetLabelDialog");
} }
mode.finish(); mode.finish();
return true; return true;

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

@ -16,110 +16,80 @@
*/ */
package org.transdroid.core.gui.navigation; package org.transdroid.core.gui.navigation;
import android.app.AlertDialog; import android.content.Context;
import android.app.Dialog; import android.text.TextUtils;
import android.app.DialogFragment; import android.view.LayoutInflater;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.view.View; import android.view.View;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemClickListener;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ListView; import android.widget.ListView;
import com.afollestad.materialdialogs.MaterialDialog;
import com.nispok.snackbar.Snackbar; import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager; import com.nispok.snackbar.SnackbarManager;
import org.transdroid.R; import org.transdroid.R;
import org.transdroid.core.gui.lists.SimpleListItem;
import java.security.InvalidParameterException;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
/** public class SetLabelDialog {
* 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 {
private OnLabelPickedListener onLabelPickedListener = null;
private List<? extends SimpleListItem> currentLabels = null;
public SetLabelDialog() {
setRetainInstance(true);
}
/** /**
* Sets the callback for when the user is has picked a label for the target torrent. * A dialog fragment that allows picking a label or entering a new label to set this new label to the torrent.
* @param onLabelPickedListener The event listener to this dialog * @param context The activity context that opens (and owns) this dialog
* @return This dialog, for method chaining * @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 setOnLabelPickedListener(OnLabelPickedListener onLabelPickedListener) { public static void show(final Context context, final OnLabelPickedListener onLabelPickedListener, List<Label> currentLabels) {
this.onLabelPickedListener = onLabelPickedListener;
return this;
}
/**
* Sets the list of currently known labels as are active on the server. These are offered to the user to pick a new label for the target
* torrents.
* @param currentLabels The list of torrent labels
* @return This dialog, for method chaining
*/
public SetLabelDialog setCurrentLabels(List<Label> currentLabels) {
// Discard the empty label in this list before storing it locally // Discard the empty label in this list before storing it locally
for (Iterator<Label> iter = currentLabels.iterator(); iter.hasNext(); ) { for (Iterator<Label> iter = currentLabels.iterator(); iter.hasNext(); ) {
if (iter.next().isEmptyLabel()) { if (iter.next().isEmptyLabel()) {
iter.remove(); iter.remove();
} }
} }
this.currentLabels = currentLabels;
return this;
}
@Override final View setLabelLayout = LayoutInflater.from(context).inflate(R.layout.dialog_setlabel, null);
public Dialog onCreateDialog(Bundle savedInstanceState) { final ListView labelsList = (ListView) setLabelLayout.findViewById(R.id.labels_list);
if (onLabelPickedListener == null) { final EditText newLabelEdit = (EditText) setLabelLayout.findViewById(R.id.newlabel_edit);
throw new InvalidParameterException("Please first set the callback listener using setOnLabelPickedListener before opening the dialog.");
} final MaterialDialog dialog = new MaterialDialog.Builder(context).customView(setLabelLayout, false).positiveText(R.string.status_update)
if (currentLabels == null) { .neutralText(R.string.status_label_remove).negativeText(android.R.string.cancel).callback(new MaterialDialog.ButtonCallback() {
throw new InvalidParameterException( @Override
"Please first set the list of currently known labels before opening the dialog, even if the list is empty."); public void onPositive(MaterialDialog dialog) {
} // User should have provided a new label
final View setlabelFrame = getActivity().getLayoutInflater().inflate(R.layout.dialog_setlabel, null, false); if (TextUtils.isEmpty(newLabelEdit.getText())) {
final ListView labelsList = (ListView) setlabelFrame.findViewById(R.id.labels_list); SnackbarManager.show(Snackbar.with(context).text(R.string.error_notalabel).colorResource(R.color.red));
final EditText newlabelEdit = (EditText) setlabelFrame.findViewById(R.id.newlabel_edit); return;
}
onLabelPickedListener.onLabelPicked(newLabelEdit.getText().toString());
}
@Override
public void onNeutral(MaterialDialog dialog) {
onLabelPickedListener.onLabelPicked(null);
}
}).build();
if (currentLabels.size() == 0) { if (currentLabels.size() == 0) {
// Hide the list (and its label) if there are no labels yet // Hide the list (and its label) if there are no labels yet
setlabelFrame.findViewById(R.id.pick_label).setVisibility(View.GONE); setLabelLayout.findViewById(R.id.pick_label).setVisibility(View.GONE);
labelsList.setVisibility(View.GONE); labelsList.setVisibility(View.GONE);
} else { } else {
labelsList.setAdapter(new FilterListItemAdapter(getActivity(), currentLabels)); labelsList.setAdapter(new FilterListItemAdapter(context, currentLabels));
labelsList.setOnItemClickListener(new OnItemClickListener() { labelsList.setOnItemClickListener(new OnItemClickListener() {
@Override @Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
onLabelPickedListener.onLabelPicked(((Label) labelsList.getItemAtPosition(position)).getName()); 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 dialog.show();
public void onClick(DialogInterface dialog, int which) {
// User should have provided a new label
if (newlabelEdit.getText().toString().equals("")) {
SnackbarManager.show(Snackbar.with(getActivity()).text(R.string.error_notalabel).colorResource(R.color.crouton_error));
return;
}
onLabelPickedListener.onLabelPicked(newlabelEdit.getText().toString());
}
}).setNeutralButton(R.string.status_label_remove, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
onLabelPickedListener.onLabelPicked(null);
}
}).setNegativeButton(android.R.string.cancel, null).show();
} }
public interface OnLabelPickedListener { public interface OnLabelPickedListener {

78
app/src/main/java/org/transdroid/core/gui/navigation/SetStorageLocationDialog.java

@ -16,73 +16,35 @@
*/ */
package org.transdroid.core.gui.navigation; package org.transdroid.core.gui.navigation;
import java.security.InvalidParameterException; import android.content.Context;
import android.view.LayoutInflater;
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.view.View; import android.view.View;
import android.widget.EditText; import android.widget.EditText;
/** import com.afollestad.materialdialogs.MaterialDialog;
* 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;
public SetStorageLocationDialog() { import org.transdroid.R;
setRetainInstance(true);
}
/** public class SetStorageLocationDialog {
* 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;
}
/** /**
* Sets the current storage location that will be available to the user to edit * A dialog fragment that allows changing of the storage location by editing the path text directly.
* @param currentLocation The current storage location path as text * @param context The activity context that opens (and owns) this dialog
* @return This dialog, for method chaining * @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) { public static void show(final Context context, final OnStorageLocationUpdatedListener onStorageLocationUpdatedListener, String currentLocation) {
this.currentLocation = currentLocation; View locationLayout = LayoutInflater.from(context).inflate(R.layout.dialog_storagelocation, null);
return this; final EditText locationText = (EditText) locationLayout.findViewById(R.id.location_edit);
}
@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);
locationText.setText(currentLocation); locationText.setText(currentLocation);
return new AlertDialog.Builder(getActivity()).setView(locationFrame) new MaterialDialog.Builder(context).customView(locationLayout, false).positiveText(R.string.status_update)
.setPositiveButton(R.string.status_update, new OnClickListener() { .negativeText(android.R.string.cancel).callback(new MaterialDialog.ButtonCallback() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onPositive(MaterialDialog dialog) {
// User is done editing and requested to update given the text input // User is done editing and requested to update given the text input
onStorageLocationUpdatedListener.onStorageLocationUpdated(locationText.getText().toString()); onStorageLocationUpdatedListener.onStorageLocationUpdated(locationText.getText().toString());
} }
}).setNegativeButton(android.R.string.cancel, null).show(); }).show();
} }
public interface OnStorageLocationUpdatedListener { public interface OnStorageLocationUpdatedListener {

79
app/src/main/java/org/transdroid/core/gui/navigation/SetTrackersDialog.java

@ -16,74 +16,39 @@
*/ */
package org.transdroid.core.gui.navigation; 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.app.DialogFragment;
import android.content.DialogInterface; import android.content.Context;
import android.content.DialogInterface.OnClickListener; import android.view.LayoutInflater;
import android.os.Bundle;
import android.view.View; import android.view.View;
import android.widget.EditText; import android.widget.EditText;
/** import com.afollestad.materialdialogs.MaterialDialog;
* A dialog fragment that allows changing the trackers of a torrent by editing the text directly.
* @author Eric Kok
*/
public class SetTrackersDialog extends DialogFragment {
private OnTrackersUpdatedListener onTrackersUpdatedListener = null; import org.transdroid.R;
private String currentTrackers = null;
public SetTrackersDialog() { import java.util.Arrays;
setRetainInstance(true); import java.util.List;
}
/** public class SetTrackersDialog extends DialogFragment {
* 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;
}
/** /**
* Sets the current trackers text/list that will be available to the user to edit * A dialog fragment that allows changing the trackers of a torrent by editing the text directly.
* @param currentTrackers The current trackers for the target torrent * @param context The activity context that opens (and owns) this dialog
* @return This dialog, for method chaining * @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) { public static void show(final Context context, final OnTrackersUpdatedListener onTrackersUpdatedListener, String currentTrackers) {
this.currentTrackers = currentTrackers; View trackersLayout = LayoutInflater.from(context).inflate(R.layout.dialog_trackers, null);
return this; final EditText trackersText = (EditText) trackersLayout.findViewById(R.id.trackers_edit);
}
@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);
trackersText.setText(currentTrackers); trackersText.setText(currentTrackers);
return new AlertDialog.Builder(getActivity()).setView(trackersFrame) new MaterialDialog.Builder(context).customView(trackersLayout, false).positiveText(R.string.status_update)
.setPositiveButton(R.string.status_update, new OnClickListener() { .negativeText(android.R.string.cancel).callback(new MaterialDialog.ButtonCallback() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onPositive(MaterialDialog dialog) {
// User is done editing and requested to update given the text input // User is done editing and requested to update given the text input
onTrackersUpdatedListener.onTrackersUpdated(Arrays.asList(trackersText.getText().toString() onTrackersUpdatedListener.onTrackersUpdated(Arrays.asList(trackersText.getText().toString().split("\n")));
.split("\n"))); }
} }).show();
}).setNegativeButton(android.R.string.cancel, null).show();
} }
public interface OnTrackersUpdatedListener { public interface OnTrackersUpdatedListener {

124
app/src/main/java/org/transdroid/core/gui/navigation/SetTransferRatesDialog.java

@ -16,93 +16,64 @@
*/ */
package org.transdroid.core.gui.navigation; package org.transdroid.core.gui.navigation;
import java.security.InvalidParameterException; import android.content.Context;
import android.view.LayoutInflater;
import org.transdroid.R;
import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button; import android.widget.Button;
import android.widget.TextView; import android.widget.TextView;
/** import com.afollestad.materialdialogs.MaterialDialog;
* 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 {
private OnRatesPickedListener onRatesPickedListener = null; import org.transdroid.R;
private TextView maxSpeedDown, maxSpeedUp;
public SetTransferRatesDialog() { public class SetTransferRatesDialog {
setRetainInstance(true);
}
/** /**
* Sets the callback for results in this dialog (with newly selected values or a reset). * A dialog fragment that allow picking of maximum download and upload transfer rates as well as the resetting of these values.
* @param onRatesPickedListener The event listener to this dialog * @param context The activity context that opens (and owns) this dialog
* @return This dialog, for method chaining * @param onRatesPickedListener The callback for results in this dialog (with newly selected values or a reset)
*/ */
public SetTransferRatesDialog setOnRatesPickedListener(OnRatesPickedListener onRatesPickedListener) { public static void show(final Context context, final OnRatesPickedListener onRatesPickedListener) {
this.onRatesPickedListener = onRatesPickedListener;
return this; 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) { for (int i : buttonResource) {
// Keep the relevant number as reference in the view tag and bind the click listerner // Keep the relevant number as reference in the view tag and bind the click listerner
transferRatesContent.findViewById(i).setTag(numberView); 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 @Override
public void onClick(View v) { 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 // Append the text contents of the button itself as text to the current number (as reference in the view's
// tag) // tag)
TextView numberView = (TextView) v.getTag(); 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.setText(numberView.getText().toString() + ((Button) v).getText().toString()); numberView.setText(numberView.getText().toString() + ((Button) v).getText().toString());
} }
}; };

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

@ -168,11 +168,11 @@ public class RssfeedsActivity extends ActionBarActivity {
// Error message or not yet loaded? Show a toast message instead of opening the items activity // Error message or not yet loaded? Show a toast message instead of opening the items activity
if (loader.hasError()) { if (loader.hasError()) {
SnackbarManager.show(Snackbar.with(this).text(R.string.rss_error).colorResource(R.color.crouton_error)); SnackbarManager.show(Snackbar.with(this).text(R.string.rss_error).colorResource(R.color.red));
return; return;
} }
if (loader.getChannel() == null || loader.getChannel().getItems().size() == 0) { if (loader.getChannel() == null || loader.getChannel().getItems().size() == 0) {
SnackbarManager.show(Snackbar.with(this).text(R.string.rss_notloaded).colorResource(R.color.crouton_error)); SnackbarManager.show(Snackbar.with(this).text(R.string.rss_notloaded).colorResource(R.color.red));
return; return;
} }

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

@ -155,7 +155,7 @@ public class RssitemsFragment extends Fragment {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(first.getLink()))); startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(first.getLink())));
} else { } else {
// No URL was specified in the RSS feed item link tag (or no link tag was present) // No URL was specified in the RSS feed item link tag (or no link tag was present)
SnackbarManager.show(Snackbar.with(getActivity()).text(R.string.error_no_link).colorResource(R.color.crouton_error)); SnackbarManager.show(Snackbar.with(getActivity()).text(R.string.error_no_link).colorResource(R.color.red));
} }
} else if (itemId == R.id.action_useassearch) { } else if (itemId == R.id.action_useassearch) {
// Use the RSS item title to start a new search (mimicking the search manager style) // Use the RSS item title to start a new search (mimicking the search manager style)

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

@ -131,7 +131,7 @@ public class SearchResultsFragment extends Fragment {
@ItemClick(R.id.searchresults_list) @ItemClick(R.id.searchresults_list)
protected void onItemClicked(SearchResult item) { protected void onItemClicked(SearchResult item) {
if (item.getTorrentUrl() == null) { if (item.getTorrentUrl() == null) {
SnackbarManager.show(Snackbar.with(getActivity()).text(R.string.error_notorrentfile).colorResource(R.color.crouton_error)); SnackbarManager.show(Snackbar.with(getActivity()).text(R.string.error_notorrentfile).colorResource(R.color.red));
return; return;
} }
// Don't broadcast this intent; we can safely assume this is intended for Transdroid only // Don't broadcast this intent; we can safely assume this is intended for Transdroid only

1
app/src/main/java/org/transdroid/core/gui/search/UrlEntryDialog.java

@ -41,7 +41,6 @@ public class UrlEntryDialog {
public static void show(final TorrentsActivity activity) { public static void show(final TorrentsActivity activity) {
View inputLayout = LayoutInflater.from(activity).inflate(R.layout.dialog_url, null); View inputLayout = LayoutInflater.from(activity).inflate(R.layout.dialog_url, null);
final EditText urlEdit = (EditText) inputLayout.findViewById(R.id.url_edit); final EditText urlEdit = (EditText) inputLayout.findViewById(R.id.url_edit);
urlEdit.setInputType(InputType.TYPE_TEXT_VARIATION_URI);
ClipboardManager clipboard = (ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE); ClipboardManager clipboard = (ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE);
if (clipboard.hasPrimaryClip() && clipboard.getPrimaryClip().getItemCount() > 0) { if (clipboard.hasPrimaryClip() && clipboard.getPrimaryClip().getItemCount() > 0) {
CharSequence content = clipboard.getPrimaryClip().getItemAt(0).coerceToText(activity); CharSequence content = clipboard.getPrimaryClip().getItemAt(0).coerceToText(activity);

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

@ -109,10 +109,10 @@ public class SystemSettingsActivity extends PreferenceActivity {
SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.pref_import_success)); SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.pref_import_success));
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
SnackbarManager SnackbarManager
.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.error_file_not_found).colorResource(R.color.crouton_error)); .show(Snackbar.with(SystemSettingsActivity.this).text(R.string.error_file_not_found).colorResource(R.color.red));
} catch (JSONException e) { } catch (JSONException e) {
SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this) SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this)
.text(getString(R.string.error_no_valid_settings_file, getString(R.string.app_name))).colorResource(R.color.crouton_error)); .text(getString(R.string.error_no_valid_settings_file, getString(R.string.app_name))).colorResource(R.color.red));
} }
} }
}; };
@ -131,7 +131,7 @@ public class SystemSettingsActivity extends PreferenceActivity {
SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.pref_export_success)); SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.pref_export_success));
} catch (JSONException | IOException e) { } catch (JSONException | IOException e) {
SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.error_cant_write_settings_file) SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.error_cant_write_settings_file)
.colorResource(R.color.crouton_error)); .colorResource(R.color.red));
} }
} }
}; };
@ -144,7 +144,7 @@ public class SystemSettingsActivity extends PreferenceActivity {
BarcodeHelper.shareContentBarcode(SystemSettingsActivity.this, settings); BarcodeHelper.shareContentBarcode(SystemSettingsActivity.this, settings);
} catch (JSONException e) { } catch (JSONException e) {
SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.error_cant_write_settings_file) SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.error_cant_write_settings_file)
.colorResource(R.color.crouton_error)); .colorResource(R.color.red));
} }
} }
}; };
@ -188,7 +188,7 @@ public class SystemSettingsActivity extends PreferenceActivity {
SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.pref_import_success)); SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.pref_import_success));
} catch (JSONException e) { } catch (JSONException e) {
SnackbarManager SnackbarManager
.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.error_file_not_found).colorResource(R.color.crouton_error)); .show(Snackbar.with(SystemSettingsActivity.this).text(R.string.error_file_not_found).colorResource(R.color.red));
} }
} }
} }

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

@ -121,7 +121,7 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity {
Editor edit = PreferenceManager.getDefaultSharedPreferences(XirvikSharedSettingsActivity.this).edit(); Editor edit = PreferenceManager.getDefaultSharedPreferences(XirvikSharedSettingsActivity.this).edit();
EditTextPreference pref = (EditTextPreference) findPreference("seedbox_xirvikshared_rpc_" + key); EditTextPreference pref = (EditTextPreference) findPreference("seedbox_xirvikshared_rpc_" + key);
if (result == null) { if (result == null) {
SnackbarManager.show(Snackbar.with(this).text(R.string.pref_seedbox_xirviknofolder).colorResource(R.color.crouton_error)); SnackbarManager.show(Snackbar.with(this).text(R.string.pref_seedbox_xirviknofolder).colorResource(R.color.red));
edit.remove("seedbox_xirvikshared_rpc_" + key); edit.remove("seedbox_xirvikshared_rpc_" + key);
pref.setSummary(""); pref.setSummary("");
} else { } else {

13
app/src/main/res/layout/actionbar_serverstatus.xml

@ -41,7 +41,7 @@
android:layout_width="@dimen/ui_serverstatus_width" android:layout_width="@dimen/ui_serverstatus_width"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:gravity="right" android:gravity="end"
android:textColor="?attr/text_actionbar" android:textColor="?attr/text_actionbar"
android:textSize="@dimen/ui_serverstatus_bignumber" android:textSize="@dimen/ui_serverstatus_bignumber"
tools:text="7"/> tools:text="7"/>
@ -51,6 +51,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toRightOf="@id/downcount_text" android:layout_toRightOf="@id/downcount_text"
android:layout_toEndOf="@id/downcount_text"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:text="↓" android:text="↓"
android:textColor="?attr/text_actionbar" android:textColor="?attr/text_actionbar"
@ -64,8 +65,9 @@
android:layout_width="@dimen/ui_serverstatus_width" android:layout_width="@dimen/ui_serverstatus_width"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toRightOf="@id/downcount_sign" android:layout_toRightOf="@id/downcount_sign"
android:layout_toEndOf="@id/downcount_sign"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:gravity="right" android:gravity="end"
android:textColor="?attr/text_actionbar" android:textColor="?attr/text_actionbar"
android:textSize="@dimen/ui_serverstatus_bignumber" android:textSize="@dimen/ui_serverstatus_bignumber"
tools:text="128"/> tools:text="128"/>
@ -75,6 +77,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toRightOf="@id/upcount_text" android:layout_toRightOf="@id/upcount_text"
android:layout_toEndOf="@id/upcount_text"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:text="↑" android:text="↑"
android:textColor="?attr/text_actionbar" android:textColor="?attr/text_actionbar"
@ -92,7 +95,7 @@
android:layout_below="@id/downcount_text" android:layout_below="@id/downcount_text"
android:layout_marginTop="-4dip" android:layout_marginTop="-4dip"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:gravity="right" android:gravity="end"
android:textColor="?attr/text_actionbar" android:textColor="?attr/text_actionbar"
android:textSize="@dimen/ui_serverstatus_smallnumber" android:textSize="@dimen/ui_serverstatus_smallnumber"
tools:text="1.2 MB/s"/> tools:text="1.2 MB/s"/>
@ -102,11 +105,13 @@
android:layout_width="@dimen/ui_serverstatus_width" android:layout_width="@dimen/ui_serverstatus_width"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignLeft="@id/upcount_text" android:layout_alignLeft="@id/upcount_text"
android:layout_alignStart="@id/upcount_text"
android:layout_alignRight="@id/upcount_sign" android:layout_alignRight="@id/upcount_sign"
android:layout_alignEnd="@id/upcount_sign"
android:layout_below="@id/upcount_text" android:layout_below="@id/upcount_text"
android:layout_marginTop="-4dip" android:layout_marginTop="-4dip"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:gravity="right" android:gravity="end"
android:textColor="?attr/text_actionbar" android:textColor="?attr/text_actionbar"
android:textSize="@dimen/ui_serverstatus_smallnumber" android:textSize="@dimen/ui_serverstatus_smallnumber"
tools:text="678 KB/s"/> tools:text="678 KB/s"/>

1
app/src/main/res/layout/dialog_setlabel.xml

@ -35,7 +35,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dip" android:layout_height="0dip"
android:layout_weight="1" android:layout_weight="1"
android:listSelector="?attr/activatable_background"
tools:listitem="@layout/list_item_simple"/> tools:listitem="@layout/list_item_simple"/>
<TextView <TextView

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

@ -18,7 +18,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:padding="@dimen/margin_half" > android:padding="@dimen/margin_default">
<EditText <EditText
android:id="@+id/location_edit" android:id="@+id/location_edit"

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

@ -18,7 +18,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:padding="@dimen/margin_half" > android:padding="@dimen/margin_default">
<EditText <EditText
android:id="@+id/trackers_edit" android:id="@+id/trackers_edit"

57
app/src/main/res/layout/dialog_transferrates.xml

@ -55,8 +55,8 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dip" android:layout_height="0.75dp"
android:background="#28000000" /> android:background="@color/green_light" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -162,8 +162,8 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dip" android:layout_height="0.75dp"
android:background="#28000000" /> android:background="@color/green_light" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -199,7 +199,7 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dip" android:layout_height="0.75dp"
android:background="#28000000" /> android:background="#28000000" />
<LinearLayout <LinearLayout
@ -306,50 +306,7 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dip" android:layout_height="0.75dp"
android:background="#28000000" /> android:background="@color/green_light" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal" >
<Button
android:id="@+id/cancel_button"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?attr/activatable_background"
android:textSize="14sp"
android:text="@android:string/cancel" />
<View
android:layout_width="1dip"
android:layout_height="match_parent"
android:background="#28000000" />
<Button
android:id="@+id/reset_button"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="14sp"
android:background="?attr/activatable_background"
android:text="@string/status_maxspeed_reset" />
<View
android:layout_width="1dip"
android:layout_height="match_parent"
android:background="#28000000" />
<Button
android:id="@+id/ok_button"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="14sp"
android:background="?attr/activatable_background"
android:text="@android:string/ok" />
</LinearLayout>
</LinearLayout> </LinearLayout>

1
app/src/main/res/layout/dialog_url.xml

@ -18,7 +18,6 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/margin_default"> android:padding="@dimen/margin_default">
<EditText <EditText

3
app/src/main/res/values/colors.xml

@ -23,8 +23,7 @@
<color name="green_dark">#1B5E20</color> <color name="green_dark">#1B5E20</color>
<color name="grey">#757575</color> <color name="grey">#757575</color>
<color name="ledgreen">#7dbb21</color> <color name="ledgreen">#7dbb21</color>
<color name="crouton_error">#C62828</color> <color name="red">#C62828</color>
<color name="crouton_info">#A5D6A7</color>
<!-- Torrent and file status colours --> <!-- Torrent and file status colours -->
<color name="torrent_downloading">#1E88E5</color> <!-- Blue --> <color name="torrent_downloading">#1E88E5</color> <!-- Blue -->

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

@ -22,7 +22,6 @@
<style name="Theme.Transdroid.Light" parent="Theme.AppCompat.Light.NoActionBar"> <style name="Theme.Transdroid.Light" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/green</item> <item name="colorPrimary">@color/green</item>
<item name="colorPrimaryDark">@color/green_dark</item> <item name="colorPrimaryDark">@color/green_dark</item>
<item name="colorAccent">@color/green_light</item>
<item name="colorControlHighlight">@color/green_light</item> <item name="colorControlHighlight">@color/green_light</item>
<item name="windowActionModeOverlay">true</item> <item name="windowActionModeOverlay">true</item>
<item name="actionModeBackground">@color/grey</item> <item name="actionModeBackground">@color/grey</item>

Loading…
Cancel
Save