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 c53a5257b..febaa68e5 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -1,10 +1,12 @@ package de.danoeh.antennapod.activity; +import android.annotation.TargetApi; import android.content.DialogInterface; import android.content.Intent; import android.graphics.PixelFormat; import android.media.AudioManager; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.support.v7.app.AlertDialog; @@ -12,7 +14,6 @@ import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; - import android.view.View; import android.widget.ImageButton; import android.widget.SeekBar; @@ -20,9 +21,9 @@ import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.TextView; import com.afollestad.materialdialogs.MaterialDialog; +import com.bumptech.glide.Glide; import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.service.playback.PlaybackService; @@ -239,6 +240,19 @@ public abstract class MediaplayerActivity extends ActionBarActivity Log.d(TAG, "onDestroy()"); } + @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) + @Override + public void onTrimMemory(int level) { + super.onTrimMemory(level); + Glide.get(this).trimMemory(level); + } + + @Override + public void onLowMemory() { + super.onLowMemory(); + Glide.get(this).clearMemory(); + } + @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); diff --git a/app/src/main/res/layout/new_episodes_listitem.xml b/app/src/main/res/layout/new_episodes_listitem.xml index cde1b4aa6..0f1e873f3 100644 --- a/app/src/main/res/layout/new_episodes_listitem.xml +++ b/app/src/main/res/layout/new_episodes_listitem.xml @@ -33,8 +33,8 @@