summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-07-23 13:50:08 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2012-07-23 13:50:08 +0200
commit7ce5cfc51367146a2650e35cde36d445751552ba (patch)
treec67053fa1cdad73e2045ede600489eaff628b2f4 /src/de/danoeh/antennapod
parent65505fad568e698371c9d8097e29cfeddbd30c72 (diff)
downloadAntennaPod-7ce5cfc51367146a2650e35cde36d445751552ba.zip
Created opml import activity
Diffstat (limited to 'src/de/danoeh/antennapod')
-rw-r--r--src/de/danoeh/antennapod/activity/OpmlImportActivity.java57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/de/danoeh/antennapod/activity/OpmlImportActivity.java b/src/de/danoeh/antennapod/activity/OpmlImportActivity.java
new file mode 100644
index 000000000..a84450e81
--- /dev/null
+++ b/src/de/danoeh/antennapod/activity/OpmlImportActivity.java
@@ -0,0 +1,57 @@
+package de.danoeh.antennapod.activity;
+
+import java.io.File;
+
+import android.os.Bundle;
+import android.util.Log;
+import android.widget.Button;
+import android.widget.TextView;
+
+import com.actionbarsherlock.app.SherlockActivity;
+
+import de.danoeh.antennapod.AppConfig;
+import de.danoeh.antennapod.R;
+import de.danoeh.antennapod.util.StorageUtils;
+
+public class OpmlImportActivity extends SherlockActivity {
+ private static final String TAG = "OpmlImportActivity";
+
+ private static final String IMPORT_DIR = "import/";
+
+ private TextView txtvPath;
+ private Button butStart;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ setContentView(R.layout.opml_import);
+
+ txtvPath = (TextView) findViewById(R.id.txtvPath);
+ butStart = (Button) findViewById(R.id.butStartImport);
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ StorageUtils.checkStorageAvailability(this);
+ setImportPath();
+ }
+
+ private void setImportPath() {
+ File importDir = getExternalFilesDir(IMPORT_DIR);
+ boolean success = true;
+ if (!importDir.exists()) {
+ if (AppConfig.DEBUG) Log.d(TAG, "Import directory doesn't exist. Creating...");
+ success = importDir.mkdir();
+ if (!success) {
+ Log.e(TAG, "Could not create directory");
+ }
+ }
+ if (success) {
+ txtvPath.setText(importDir.toString());
+ } else {
+ txtvPath.setText(R.string.opml_directory_error);
+ }
+ }
+}