diff options
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/OpmlImportFromPathActivity.java | 27 | ||||
-rw-r--r-- | core/src/main/res/values/strings.xml | 1 |
2 files changed, 9 insertions, 19 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportFromPathActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportFromPathActivity.java index 2ec987d1a..6e3991739 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportFromPathActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportFromPathActivity.java @@ -8,7 +8,6 @@ import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; @@ -51,23 +50,13 @@ public class OpmlImportFromPathActivity extends OpmlImportBaseActivity { final TextView txtvHeaderExplanation3 = (TextView) findViewById(R.id.txtvHeadingExplanation3); Button butChooseFilesystem = (Button) findViewById(R.id.butChooseFileFromFilesystem); - butChooseFilesystem.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - chooseFileFromFilesystem(); - } - - }); + butChooseFilesystem.setOnClickListener(v -> chooseFileFromFilesystem()); Button butChooseExternal = (Button) findViewById(R.id.butChooseFileFromExternal); - butChooseExternal.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - chooseFileFromExternal(); - } - }); - - int nextOption = 1; + butChooseExternal.setOnClickListener(v -> chooseFileFromExternal()); + + int nextOption = 1; + String optionLabel = getString(R.string.opml_import_option); intentPickAction = new Intent(Intent.ACTION_PICK); intentPickAction.setData(Uri.parse("file://")); @@ -81,7 +70,7 @@ public class OpmlImportFromPathActivity extends OpmlImportBaseActivity { } } if(txtvExplanation1.getVisibility() == View.VISIBLE) { - txtvHeaderExplanation1.setText("Option " + nextOption); + txtvHeaderExplanation1.setText(String.format(optionLabel, nextOption)); nextOption++; } @@ -94,11 +83,11 @@ public class OpmlImportFromPathActivity extends OpmlImportBaseActivity { findViewById(R.id.divider2).setVisibility(View.GONE); butChooseExternal.setVisibility(View.GONE); } else { - txtvHeaderExplanation2.setText("Option " + nextOption); + txtvHeaderExplanation2.setText(String.format(optionLabel, nextOption)); nextOption++; } - txtvHeaderExplanation3.setText("Option " + nextOption); + txtvHeaderExplanation3.setText(String.format(optionLabel, nextOption)); } @Override diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 00bc077e8..c8fb83e46 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -358,6 +358,7 @@ <!-- OPML import and export --> <string name="opml_import_txtv_button_lable">OPML files allow you to move your podcasts from one podcatcher to another.</string> + <string name="opml_import_option">Option %1$d</string> <string name="opml_import_explanation_1">Choose a specific file path from the local filesystem.</string> <string name="opml_import_explanation_2">Use an external applications like Dropbox, Google Drive or your favourite file manager to open an OPML file.</string> <string name="opml_import_explanation_3">Many applications like Google Mail, Dropbox, Google Drive and most file managers can <i>open</i> OPML files <i>with</i> AntennaPod.</string> <string name="start_import_label">Start import</string> |