Merge pull request #2624 from ByteHamster/opml-import

Added OPML import option next to the export option
This commit is contained in:
Martin Fietz 2018-04-05 18:47:14 +02:00 committed by GitHub
commit 3dc2fc16c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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"/>