Add link to relevant settings screen in 'Episode cache full' dialog (#5088)

This commit is contained in:
tamizh143 2021-04-07 02:22:39 +05:30 committed by GitHub
parent 79c79efce5
commit d8ca965e0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -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) {

View File

@ -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<NavListAdapter.Holder>
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()
);
}

View File

@ -18,6 +18,7 @@
<string name="new_label">New</string>
<string name="settings_label">Settings</string>
<string name="downloads_label">Downloads</string>
<string name="open_autodownload_settings">Open Settings</string>
<string name="downloads_running_label">Running</string>
<string name="downloads_completed_label">Completed</string>
<string name="downloads_log_label">Log</string>