Browse Source

Disable long-clicks (enabling the CAB) for list subheaders.

pull/11/head
Eric Kok 12 years ago
parent
commit
c8dbce4b4c
  1. 6
      core/src/org/transdroid/core/gui/DetailsActivity.java
  2. 6
      core/src/org/transdroid/core/gui/TorrentsActivity.java
  3. 8
      core/src/org/transdroid/core/gui/lists/DetailsAdapter.java

6
core/src/org/transdroid/core/gui/DetailsActivity.java

@ -109,6 +109,12 @@ public class DetailsActivity extends SherlockFragmentActivity implements Torrent @@ -109,6 +109,12 @@ public class DetailsActivity extends SherlockFragmentActivity implements Torrent
}
@Override
protected void onDestroy() {
Crouton.cancelAllCroutons();
super.onDestroy();
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@OptionsItem(android.R.id.home)
protected void navigateUp() {

6
core/src/org/transdroid/core/gui/TorrentsActivity.java

@ -205,6 +205,12 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi @@ -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) {

8
core/src/org/transdroid/core/gui/lists/DetailsAdapter.java

@ -37,26 +37,26 @@ public class DetailsAdapter extends MergeAdapter { @@ -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<SimpleListItem>());
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<SimpleListItem>());
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<TorrentFile>());
addAdapter(torrentFilesAdapter);

Loading…
Cancel
Save