diff --git a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java index d0670b906..cd72e34e8 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java @@ -34,6 +34,7 @@ import de.danoeh.antennapod.fragment.preferences.UserInterfacePreferencesFragmen */ public class PreferenceActivity extends AppCompatActivity implements SearchPreferenceResultListener { private static final String FRAGMENT_TAG = "tag_preferences"; + public static final String OPEN_AUTO_DOWNLOAD_SETTINGS = "OpenAutoDownloadSettings"; @Override protected void onCreate(Bundle savedInstanceState) { @@ -53,6 +54,10 @@ public class PreferenceActivity extends AppCompatActivity implements SearchPrefe .replace(R.id.settingsContainer, new MainPreferencesFragment(), FRAGMENT_TAG) .commit(); } + Intent intent = getIntent(); + if (intent.getBooleanExtra(OPEN_AUTO_DOWNLOAD_SETTINGS, false)) { + openScreen(R.xml.preferences_autodownload); + } } private PreferenceFragmentCompat getPreferenceScreen(int screen) { diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java index 121f4263d..911e20aa5 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java @@ -1,6 +1,7 @@ package de.danoeh.antennapod.adapter; import android.app.Activity; +import android.content.Intent; import android.content.SharedPreferences; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; @@ -21,6 +22,7 @@ import com.bumptech.glide.request.RequestOptions; import com.joanzapata.iconify.Iconify; import com.joanzapata.iconify.widget.IconTextView; import de.danoeh.antennapod.R; +import de.danoeh.antennapod.activity.PreferenceActivity; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.glide.ApGlideSettings; import de.danoeh.antennapod.core.preferences.UserPreferences; @@ -270,7 +272,12 @@ public class NavListAdapter extends RecyclerView.Adapter new AlertDialog.Builder(context) .setTitle(R.string.episode_cache_full_title) .setMessage(R.string.episode_cache_full_message) - .setPositiveButton(android.R.string.ok, (dialog, which) -> { }) + .setPositiveButton(android.R.string.ok, null) + .setNeutralButton(R.string.open_autodownload_settings, (dialog, which) -> { + Intent intent = new Intent(context, PreferenceActivity.class); + intent.putExtra(PreferenceActivity.OPEN_AUTO_DOWNLOAD_SETTINGS, true); + context.startActivity(intent); + }) .show() ); } diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index d4e8dc7cb..90845f168 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -18,6 +18,7 @@ New Settings Downloads + Open Settings Running Completed Log