From c8dbce4b4c2554db7662d3c0a6c4dc7554235fb7 Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Wed, 19 Jun 2013 16:55:21 +0200 Subject: [PATCH] Disable long-clicks (enabling the CAB) for list subheaders. --- core/src/org/transdroid/core/gui/DetailsActivity.java | 6 ++++++ core/src/org/transdroid/core/gui/TorrentsActivity.java | 6 ++++++ .../src/org/transdroid/core/gui/lists/DetailsAdapter.java | 8 ++++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/core/src/org/transdroid/core/gui/DetailsActivity.java b/core/src/org/transdroid/core/gui/DetailsActivity.java index 029e8611..ce514a90 100644 --- a/core/src/org/transdroid/core/gui/DetailsActivity.java +++ b/core/src/org/transdroid/core/gui/DetailsActivity.java @@ -108,6 +108,12 @@ public class DetailsActivity extends SherlockFragmentActivity implements Torrent fragmentDetails.updateTorrent(torrent); } + + @Override + protected void onDestroy() { + Crouton.cancelAllCroutons(); + super.onDestroy(); + } @TargetApi(Build.VERSION_CODES.HONEYCOMB) @OptionsItem(android.R.id.home) diff --git a/core/src/org/transdroid/core/gui/TorrentsActivity.java b/core/src/org/transdroid/core/gui/TorrentsActivity.java index 0019add9..725c5418 100644 --- a/core/src/org/transdroid/core/gui/TorrentsActivity.java +++ b/core/src/org/transdroid/core/gui/TorrentsActivity.java @@ -205,6 +205,12 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi filterSelected(lastUsed, true); } + @Override + protected void onDestroy() { + Crouton.cancelAllCroutons(); + super.onDestroy(); + } + @TargetApi(Build.VERSION_CODES.FROYO) @Override public boolean onCreateOptionsMenu(Menu menu) { diff --git a/core/src/org/transdroid/core/gui/lists/DetailsAdapter.java b/core/src/org/transdroid/core/gui/lists/DetailsAdapter.java index 5335ec7f..0eea9194 100644 --- a/core/src/org/transdroid/core/gui/lists/DetailsAdapter.java +++ b/core/src/org/transdroid/core/gui/lists/DetailsAdapter.java @@ -37,26 +37,26 @@ public class DetailsAdapter extends MergeAdapter { // Torrent details header torrentDetailsView = TorrentDetailsView_.build(context); torrentDetailsView.setVisibility(View.GONE); - addView(torrentDetailsView, true); + addView(torrentDetailsView, false); // Trackers trackersSeparatorView = FilterSeparatorView_.build(context).setText(context.getString(R.string.status_trackers)); trackersSeparatorView.setVisibility(View.GONE); - addView(trackersSeparatorView, true); + addView(trackersSeparatorView, false); this.trackersAdapter = new SimpleListItemAdapter(context, new ArrayList()); addAdapter(trackersAdapter); // Tracker errors errorsSeparatorView = FilterSeparatorView_.build(context).setText(context.getString(R.string.status_errors)); errorsSeparatorView.setVisibility(View.GONE); - addView(errorsSeparatorView, true); + addView(errorsSeparatorView, false); this.errorsAdapter = new SimpleListItemAdapter(context, new ArrayList()); addAdapter(errorsAdapter); // Torrent files torrentFilesSeparatorView = FilterSeparatorView_.build(context).setText(context.getString(R.string.status_files)); torrentFilesSeparatorView.setVisibility(View.GONE); - addView(torrentFilesSeparatorView, true); + addView(torrentFilesSeparatorView, false); this.torrentFilesAdapter = new TorrentFilesAdapter(context, new ArrayList()); addAdapter(torrentFilesAdapter);