diff options
Diffstat (limited to 'app/src/main/java')
5 files changed, 25 insertions, 6 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java index 805d82cf9..d4356719e 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java @@ -239,7 +239,11 @@ public class FeedInfoActivity extends ActionBarActivity { } } }; - loadTask.execute(feedId); + if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { + loadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, feedId); + } else { + loadTask.execute(feedId); + } } diff --git a/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java index e980764ec..f22507f4c 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java @@ -132,7 +132,8 @@ public class StorageErrorActivity extends AppCompatActivity { List<String> folders = new ArrayList<>(mediaDirs.length); List<CharSequence> choices = new ArrayList<>(mediaDirs.length); for(int i=0; i < mediaDirs.length; i++) { - if(mediaDirs[i] == null) { + File dir = mediaDirs[i]; + if(dir == null || !dir.exists() || !dir.canRead() || !dir.canWrite()) { continue; } String path = mediaDirs[i].getAbsolutePath(); diff --git a/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java index 738fefb24..d46a3d6c2 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java @@ -121,7 +121,7 @@ public class GpodnetAuthenticationActivity extends ActionBarActivity { final String passwordStr = password.getText().toString(); if (BuildConfig.DEBUG) Log.d(TAG, "Checking login credentials"); - new AsyncTask<GpodnetService, Void, Void>() { + AsyncTask<GpodnetService, Void, Void> authTask = new AsyncTask<GpodnetService, Void, Void>() { volatile Exception exception; @@ -143,7 +143,7 @@ public class GpodnetAuthenticationActivity extends ActionBarActivity { if (exception == null) { advance(); } else { - txtvError.setText(exception.getMessage()); + txtvError.setText(exception.getCause().getMessage()); txtvError.setVisibility(View.VISIBLE); } } @@ -160,7 +160,12 @@ public class GpodnetAuthenticationActivity extends ActionBarActivity { } return null; } - }.execute(service); + }; + if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { + authTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, service); + } else { + authTask.execute(); + } } }); } diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java index 2fd4fc186..43a00f7c5 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java @@ -15,6 +15,7 @@ import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; @@ -81,6 +82,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR .inflate(R.layout.new_episodes_listitem, parent, false); Holder holder = new Holder(view); holder.container = (FrameLayout) view.findViewById(R.id.container); + holder.content = (LinearLayout) view.findViewById(R.id.content); holder.placeholder = (TextView) view.findViewById(R.id.txtvPlaceholder); holder.title = (TextView) view.findViewById(R.id.txtvTitle); if(Build.VERSION.SDK_INT >= 23) { @@ -126,6 +128,11 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR } else { holder.statusUnread.setVisibility(View.VISIBLE); } + if(item.isPlayed()) { + ViewHelper.setAlpha(holder.content, 0.5f); + } else { + ViewHelper.setAlpha(holder.content, 1.0f); + } FeedMedia media = item.getMedia(); if (media != null) { @@ -233,6 +240,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR implements View.OnClickListener, View.OnCreateContextMenuListener, ItemTouchHelperViewHolder { + LinearLayout content; FrameLayout container; TextView placeholder; TextView title; diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java index b8d721e26..6c03dc7ae 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java @@ -837,7 +837,8 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc List<String> folders = new ArrayList<>(mediaDirs.length); List<CharSequence> choices = new ArrayList<>(mediaDirs.length); for(int i=0; i < mediaDirs.length; i++) { - if(mediaDirs[i] == null) { + File dir = mediaDirs[i]; + if(dir == null || !dir.exists() || !dir.canRead() || !dir.canWrite()) { continue; } String path = mediaDirs[i].getAbsolutePath(); |