diff options
author | dethstar <pcepedam92@gmail.com> | 2015-12-13 13:23:52 -0600 |
---|---|---|
committer | dethstar <pcepedam92@gmail.com> | 2015-12-20 10:50:00 -0600 |
commit | 68df2fcb012261e44cd7a8a35125fe1694652a5c (patch) | |
tree | d7467158ef05b93c69585980a075b0a1522b1f50 | |
parent | 01b4450debe6d7b7f2adcdd2bca04270fc983399 (diff) | |
download | AntennaPod-68df2fcb012261e44cd7a8a35125fe1694652a5c.zip |
allow to see time left of a podcast by tapping on the position textview
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java index febaa68e5..1f2753b10 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -51,6 +51,7 @@ public abstract class MediaplayerActivity extends ActionBarActivity protected SeekBar sbPosition; protected ImageButton butPlay; protected ImageButton butRev; + protected Boolean timeLeft = false; protected TextView txtvRev; protected ImageButton butFF; protected TextView txtvFF; @@ -411,8 +412,14 @@ public abstract class MediaplayerActivity extends ActionBarActivity if (currentPosition != PlaybackService.INVALID_TIME && duration != PlaybackService.INVALID_TIME && controller.getMedia() != null) { - txtvPosition.setText(Converter - .getDurationStringLong(currentPosition)); + if(timeLeft) { + txtvPosition.setText("-"+Converter + .getDurationStringLong(duration - currentPosition)); + } + else { + txtvPosition.setText(Converter + .getDurationStringLong(currentPosition)); + } txtvLength.setText(Converter.getDurationStringLong(duration)); updateProgressbarPosition(currentPosition, duration); } else { @@ -457,6 +464,13 @@ public abstract class MediaplayerActivity extends ActionBarActivity setContentView(getContentViewResourceId()); sbPosition = (SeekBar) findViewById(R.id.sbPosition); txtvPosition = (TextView) findViewById(R.id.txtvPosition); + + txtvPosition.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + timeLeft = !timeLeft; + } + }); txtvLength = (TextView) findViewById(R.id.txtvLength); butPlay = (ImageButton) findViewById(R.id.butPlay); butRev = (ImageButton) findViewById(R.id.butRev); |