diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2016-03-24 16:43:41 +0100 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2016-03-25 13:14:33 +0100 |
commit | 96634c42b3f0d9a16ddf5b43a2cb1eb8b8ee0570 (patch) | |
tree | efd1074c074ffc0eef64cdb897454a8b4d9239b7 /app/src/main/java/de/danoeh/antennapod/activity | |
parent | 0564988357c3b6e31915a37276250c405c95482e (diff) | |
download | AntennaPod-96634c42b3f0d9a16ddf5b43a2cb1eb8b8ee0570.zip |
React to enabling sonic mediaplayer
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/activity')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java | 38 |
1 files changed, 25 insertions, 13 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 8088caec9..cad414118 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -173,8 +173,17 @@ public abstract class MediaplayerActivity extends AppCompatActivity implements O super.setScreenOn(enable); MediaplayerActivity.this.setScreenOn(enable); } + + @Override + public void onPlaybackSpeedAvailableChanged() { + MediaplayerActivity.this.onPlaybackSpeedAvailableChanged(); + } }; + } + protected void onPlaybackSpeedAvailableChanged() { + Log.d(TAG, "onPlaybackSpeedAvailableChanged()"); + updatePlaybackSpeedButton(); } protected void onPlaybackSpeedChange() { @@ -628,25 +637,28 @@ public abstract class MediaplayerActivity extends AppCompatActivity implements O if (media != null) { onPositionObserverUpdate(); checkFavorite(); - if(butPlaybackSpeed != null) { - if (controller == null) { - butPlaybackSpeed.setVisibility(View.GONE); - } else { - butPlaybackSpeed.setVisibility(View.VISIBLE); - if (controller.canSetPlaybackSpeed()) { - ViewCompat.setAlpha(butPlaybackSpeed, 1.0f); - } else { - ViewCompat.setAlpha(butPlaybackSpeed, 0.5f); - } - } - updateButPlaybackSpeed(); - } + updatePlaybackSpeedButton(); return true; } else { return false; } } + private void updatePlaybackSpeedButton() { + if(butPlaybackSpeed != null) { + if (controller == null) { + butPlaybackSpeed.setVisibility(View.GONE); + } else { + butPlaybackSpeed.setVisibility(View.VISIBLE); + if (controller.canSetPlaybackSpeed()) { + ViewCompat.setAlpha(butPlaybackSpeed, 1.0f); + } else { + ViewCompat.setAlpha(butPlaybackSpeed, 0.5f); + } + } + updatePlaybackSpeedButtonText(); + } + } private void updatePlaybackSpeedButtonText() { if (controller != null && butPlaybackSpeed != null) { |