summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-12-22 23:55:35 +0100
committerdaniel oeh <daniel.oeh@gmail.com>2012-12-22 23:55:35 +0100
commit8726ea18c07e57d9cb3fd94acb5ee0c34149d305 (patch)
tree0f7687fd6f2ef7dc37d41b624141d4ca05991ca6
parentf0f68fd015768d67735759f90e609407c7fb728d (diff)
downloadAntennaPod-8726ea18c07e57d9cb3fd94acb5ee0c34149d305.zip
Created layout for directorychooser
-rw-r--r--AndroidManifest.xml1
-rwxr-xr-xres/drawable-hdpi/navigation_up.pngbin0 -> 2270 bytes
-rwxr-xr-xres/drawable-hdpi/navigation_up_dark.pngbin0 -> 2221 bytes
-rwxr-xr-xres/drawable-mdpi/navigation_up.pngbin0 -> 2123 bytes
-rwxr-xr-xres/drawable-mdpi/navigation_up_dark.pngbin0 -> 2060 bytes
-rwxr-xr-xres/drawable-xhdpi/navigation_up.pngbin0 -> 2471 bytes
-rwxr-xr-xres/drawable-xhdpi/navigation_up_dark.pngbin0 -> 2445 bytes
-rw-r--r--res/layout/directory_chooser.xml79
-rw-r--r--res/menu/directory_chooser.xml6
-rw-r--r--res/values/attrs.xml1
-rw-r--r--res/values/strings.xml7
-rw-r--r--res/values/styles.xml3
-rw-r--r--src/de/danoeh/antennapod/activity/DirectoryChooserActivity.java33
13 files changed, 127 insertions, 3 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 79fdd6523..e4618af40 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -221,6 +221,7 @@
android:screenOrientation="landscape">
</activity>
<activity android:label="@string/playback_history_label" android:name=".activity.PlaybackHistoryActivity"></activity>
+ <activity android:name=".activity.DirectoryChooserActivity" android:label="@string/choose_data_directory"></activity>
</application>
</manifest> \ No newline at end of file
diff --git a/res/drawable-hdpi/navigation_up.png b/res/drawable-hdpi/navigation_up.png
new file mode 100755
index 000000000..a2cf2ba52
--- /dev/null
+++ b/res/drawable-hdpi/navigation_up.png
Binary files differ
diff --git a/res/drawable-hdpi/navigation_up_dark.png b/res/drawable-hdpi/navigation_up_dark.png
new file mode 100755
index 000000000..f2374a323
--- /dev/null
+++ b/res/drawable-hdpi/navigation_up_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/navigation_up.png b/res/drawable-mdpi/navigation_up.png
new file mode 100755
index 000000000..1ee248a79
--- /dev/null
+++ b/res/drawable-mdpi/navigation_up.png
Binary files differ
diff --git a/res/drawable-mdpi/navigation_up_dark.png b/res/drawable-mdpi/navigation_up_dark.png
new file mode 100755
index 000000000..8ef44cbac
--- /dev/null
+++ b/res/drawable-mdpi/navigation_up_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/navigation_up.png b/res/drawable-xhdpi/navigation_up.png
new file mode 100755
index 000000000..f8c3e6f75
--- /dev/null
+++ b/res/drawable-xhdpi/navigation_up.png
Binary files differ
diff --git a/res/drawable-xhdpi/navigation_up_dark.png b/res/drawable-xhdpi/navigation_up_dark.png
new file mode 100755
index 000000000..6964e069b
--- /dev/null
+++ b/res/drawable-xhdpi/navigation_up_dark.png
Binary files differ
diff --git a/res/layout/directory_chooser.xml b/res/layout/directory_chooser.xml
new file mode 100644
index 000000000..cf53962ef
--- /dev/null
+++ b/res/layout/directory_chooser.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <LinearLayout
+ android:id="@+id/footer"
+ style="@android:style/ButtonBar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:orientation="horizontal" >
+
+ <Button
+ android:id="@+id/butConfirm"
+ android:layout_width="0px"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="@string/confirm_label" />
+
+ <Button
+ android:id="@+id/butCancel"
+ android:layout_width="0px"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="@string/cancel_label" />
+ </LinearLayout>
+
+ <RelativeLayout
+ android:id="@+id/directory_info"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true" >
+
+ <ImageButton
+ android:id="@+id/butNavUp"
+ android:layout_width="60dp"
+ android:layout_height="60dp"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:background="@drawable/borderless_button"
+ android:src="@attr/navigation_up" />
+
+ <TextView
+ android:id="@+id/txtvSelectedFolderLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:layout_marginLeft="8dp"
+ android:layout_marginRight="8dp"
+ android:layout_marginTop="8dp"
+ android:layout_toRightOf="@id/butNavUp"
+ android:text="@string/selected_folder_label"
+ android:textStyle="bold" >
+ </TextView>
+
+ <TextView
+ android:id="@+id/txtvSelectedFolder"
+ android:layout_below="@id/txtvSelectedFolderLabel"
+ android:layout_margin="8dp"
+ android:layout_toRightOf="@id/butNavUp"
+ android:ellipsize="middle" />
+
+ <View
+ android:id="@+id/divider"
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_below="@id/butNavUp"
+ android:background="@color/bright_blue" />
+ </RelativeLayout>
+
+ <ListView
+ android:id="@+id/directory_list"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_above="@id/footer"
+ android:layout_below="@id/directory_info" />
+
+</RelativeLayout> \ No newline at end of file
diff --git a/res/menu/directory_chooser.xml b/res/menu/directory_chooser.xml
new file mode 100644
index 000000000..04711407d
--- /dev/null
+++ b/res/menu/directory_chooser.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item android:id="@+id/new_folder_item" android:title="@string/new_folder_label" android:showAsAction="ifRoom|withText"></item>
+
+
+</menu> \ No newline at end of file
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 4c77a9ff0..883db802a 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -19,6 +19,7 @@
<attr name="navigation_cancel" format="reference" />
<attr name="navigation_expand" format="reference" />
<attr name="navigation_refresh" format="reference" />
+ <attr name="navigation_up" format="reference" />
<attr name="social_share" format="reference" />
<attr name="stat_playlist" format="reference" />
<attr name="type_audio" format="reference" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index fd4ec57a6..743bf5760 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -214,5 +214,10 @@
<string name="best_rating_label">Best rating</string>
<string name="add_feed_label">Add feed</string>
<string name="miro_feed_added">Feed is being added</string>
-
+
+ <!-- Directory chooser -->
+ <string name="selected_folder_label">Selected folder:</string>
+ <string name="new_folder_label">New folder</string>
+ <string name="create_folder_label">Create folder</string>
+ <string name="choose_data_directory">Choose data folder</string>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 8fdeed718..38b37692d 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -21,6 +21,7 @@
<item name="attr/navigation_cancel">@drawable/navigation_cancel</item>
<item name="attr/navigation_expand">@drawable/navigation_expand</item>
<item name="attr/navigation_refresh">@drawable/navigation_refresh</item>
+ <item name="attr/navigation_up">@drawable/navigation_up</item>
<item name="attr/social_share">@drawable/social_share</item>
<item name="attr/stat_playlist">@drawable/stat_playlist</item>
<item name="attr/type_audio">@drawable/type_audio</item>
@@ -28,7 +29,6 @@
<item name="attr/non_transparent_background">@color/white</item>
<item name="attr/borderless_button">@drawable/borderless_button</item>
<item name="attr/video_overlay_background">@color/video_overlay_light</item>
-
</style>
<style name="AntennaPod.LightTabPageIndicator" parent="Widget.TabPageIndicator">
@@ -55,6 +55,7 @@
<item name="attr/navigation_cancel">@drawable/navigation_cancel_dark</item>
<item name="attr/navigation_expand">@drawable/navigation_expand_dark</item>
<item name="attr/navigation_refresh">@drawable/navigation_refresh_dark</item>
+ <item name="attr/navigation_up">@drawable/navigation_up_dark</item>
<item name="attr/social_share">@drawable/social_share_dark</item>
<item name="attr/stat_playlist">@drawable/stat_playlist_dark</item>
<item name="attr/type_audio">@drawable/type_audio_dark</item>
diff --git a/src/de/danoeh/antennapod/activity/DirectoryChooserActivity.java b/src/de/danoeh/antennapod/activity/DirectoryChooserActivity.java
index cc3168e15..f6c2583ea 100644
--- a/src/de/danoeh/antennapod/activity/DirectoryChooserActivity.java
+++ b/src/de/danoeh/antennapod/activity/DirectoryChooserActivity.java
@@ -1,16 +1,47 @@
package de.danoeh.antennapod.activity;
import android.os.Bundle;
+import android.widget.Button;
+import android.widget.ListView;
+import android.widget.TextView;
import com.actionbarsherlock.app.SherlockActivity;
+import com.actionbarsherlock.view.Menu;
+import com.actionbarsherlock.view.MenuInflater;
+
+import de.danoeh.antennapod.PodcastApp;
+import de.danoeh.antennapod.R;
/** Let's the user choose a directory on the storage device. */
-public abstract class DirectoryChooserActivity extends SherlockActivity {
+public class DirectoryChooserActivity extends SherlockActivity {
private static final String TAG = "DirectoryChooserActivity";
+ private Button butConfirm;
+ private Button butCancel;
+ private Button butNavUp;
+ private TextView txtvSelectedFolder;
+ private ListView listDirectories;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
+ setTheme(PodcastApp.getThemeResourceId());
super.onCreate(savedInstanceState);
+
+ setContentView(R.layout.directory_chooser);
+ butConfirm = (Button) findViewById(R.id.butConfirm);
+ butCancel = (Button) findViewById(R.id.butCancel);
+ butNavUp = (Button) findViewById(R.id.butNavUp);
+ txtvSelectedFolder = (TextView) findViewById(R.id.txtvSelectedFolder);
+ listDirectories = (ListView) findViewById(R.id.directory_list);
}
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ MenuInflater inflater = new MenuInflater(this);
+ inflater.inflate(R.menu.directory_chooser, menu);
+ return true;
+ }
+
+
}