Added OPML import option next to the export option

Fixes #2315
This commit is contained in:
ByteHamster 2018-04-05 17:09:09 +02:00
parent 43f450433e
commit 15d93f01c9
2 changed files with 10 additions and 0 deletions

View File

@ -39,6 +39,7 @@ import android.widget.Toast;
import com.afollestad.materialdialogs.MaterialDialog;
import de.danoeh.antennapod.activity.ImportExportActivity;
import de.danoeh.antennapod.activity.OpmlImportFromPathActivity;
import org.apache.commons.lang3.ArrayUtils;
import java.io.File;
@ -89,6 +90,7 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
private static final String PREF_FLATTR_REVOKE = "prefRevokeAccess";
private static final String PREF_AUTO_FLATTR_PREFS = "prefAutoFlattrPrefs";
private static final String PREF_OPML_EXPORT = "prefOpmlExport";
private static final String PREF_OPML_IMPORT = "prefOpmlImport";
private static final String PREF_HTML_EXPORT = "prefHtmlExport";
private static final String STATISTICS = "statistics";
private static final String IMPORT_EXPORT = "importExport";
@ -185,6 +187,11 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
preference -> export(new OpmlWriter()));
ui.findPreference(PreferenceController.PREF_HTML_EXPORT).setOnPreferenceClickListener(
preference -> export(new HtmlWriter()));
ui.findPreference(PreferenceController.PREF_OPML_IMPORT).setOnPreferenceClickListener(
preference -> {
activity.startActivity(new Intent(activity, OpmlImportFromPathActivity.class));
return true;
});
ui.findPreference(PreferenceController.PREF_CHOOSE_DATA_DIR).setOnPreferenceClickListener(
preference -> {
if (Build.VERSION_CODES.KITKAT <= Build.VERSION.SDK_INT &&

View File

@ -312,6 +312,9 @@
<Preference
android:key="prefOpmlExport"
android:title="@string/opml_export_label"/>
<Preference
android:key="prefOpmlImport"
android:title="@string/opml_import_label"/>
<Preference
android:key="prefHtmlExport"
android:title="@string/html_export_label"/>