use of butter.droid.base.torrent.TorrentHealth in project butter-android by butterproject.
the class MediaDetailPresenterImpl method healthClicked.
@Override
public void healthClicked() {
Torrent torrent;
if (selectedTorrent != null) {
torrent = selectedTorrent;
} else {
Movie movie = (Movie) this.media.getMedia();
torrent = movie.getTorrents()[0];
}
int seeds = torrent.getSeeds();
int peers = torrent.getPeers();
TorrentHealth health = TorrentHealth.calculate(seeds, peers);
view.displayHealthInfo(health, seeds, peers);
}
use of butter.droid.base.torrent.TorrentHealth in project butter-android by butterproject.
the class StreamableDetailFragment method renderHealth.
@Override
public void renderHealth(Torrent torrent) {
int seeds = torrent.getSeeds();
int peers = torrent.getPeers();
if (seeds >= 0 && peers >= 0) {
TorrentHealth health = TorrentHealth.calculate(seeds, peers);
this.health.setImageResource(health.getImageResource());
this.health.setVisibility(View.VISIBLE);
} else {
health.setVisibility(View.GONE);
}
}
Aggregations