summaryrefslogtreecommitdiff
path: root/src/de/podfetcher/activity
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-07-02 17:29:18 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2012-07-02 17:29:18 +0200
commit4882a5ff920d41ba5d7a32998cf89ab29b5fda2f (patch)
tree612eb42787744c8d97ee51bdedc1efa3e6e6caeb /src/de/podfetcher/activity
parent92c32662ca363c1e8dc85c327405c09d084028dc (diff)
downloadAntennaPod-4882a5ff920d41ba5d7a32998cf89ab29b5fda2f.zip
Added buffer update listeners
Diffstat (limited to 'src/de/podfetcher/activity')
-rw-r--r--src/de/podfetcher/activity/MediaplayerActivity.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/de/podfetcher/activity/MediaplayerActivity.java b/src/de/podfetcher/activity/MediaplayerActivity.java
index d74833446..4b3b04278 100644
--- a/src/de/podfetcher/activity/MediaplayerActivity.java
+++ b/src/de/podfetcher/activity/MediaplayerActivity.java
@@ -529,15 +529,24 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements
@Override
public void onReceive(Context context, Intent intent) {
- Log.d(TAG, "Received notification intent");
int type = intent.getIntExtra(
PlaybackService.EXTRA_NOTIFICATION_TYPE, -1);
int code = intent.getIntExtra(
PlaybackService.EXTRA_NOTIFICATION_CODE, -1);
if (code != -1 && type != -1) {
- if (type == PlaybackService.NOTIFICATION_TYPE_ERROR) {
+ switch (type) {
+ case PlaybackService.NOTIFICATION_TYPE_ERROR:
handleError(code);
+ break;
+ case PlaybackService.NOTIFICATION_TYPE_BUFFER_UPDATE:
+ if (sbPosition != null) {
+ float progress = ((float) code) / 100;
+ sbPosition.setSecondaryProgress((int) progress
+ * sbPosition.getMax());
+ }
+ break;
}
+
} else {
Log.d(TAG, "Bad arguments. Won't handle intent");
}