diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 968cadd..cd908c0 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,44 +1,46 @@
-
+ android:versionCode="5"
+ android:versionName="1.4">
+
+
-
-
-
-
+ android:theme="@style/AppTheme" >
+
+
-
+
-
+ android:name=".EditPlaylistActivity"
+ android:label="@string/app_name"
+ android:screenOrientation="landscape"
+ android:theme="@style/AppTheme.NoTitleBar" />
+
-
+ android:name=".HelpActivity"
+ android:label="@string/help"
+ android:screenOrientation="landscape" />
+
+
+
-
\ No newline at end of file
+
diff --git a/libs/GoogleAdMobAdsSdk-6.2.1.jar b/libs/GoogleAdMobAdsSdk-6.2.1.jar
deleted file mode 100644
index f7bae2c..0000000
Binary files a/libs/GoogleAdMobAdsSdk-6.2.1.jar and /dev/null differ
diff --git a/libs/GoogleAdMobAdsSdk-6.4.1.jar b/libs/GoogleAdMobAdsSdk-6.4.1.jar
new file mode 100644
index 0000000..de66754
Binary files /dev/null and b/libs/GoogleAdMobAdsSdk-6.4.1.jar differ
diff --git a/res/drawable-hdpi/help1.png b/res/drawable-hdpi/help1.png
new file mode 100644
index 0000000..586cf64
Binary files /dev/null and b/res/drawable-hdpi/help1.png differ
diff --git a/res/drawable-hdpi/help2.png b/res/drawable-hdpi/help2.png
new file mode 100644
index 0000000..69c23be
Binary files /dev/null and b/res/drawable-hdpi/help2.png differ
diff --git a/res/drawable-hdpi/logo.png b/res/drawable-hdpi/logo.png
new file mode 100644
index 0000000..56dd8cf
Binary files /dev/null and b/res/drawable-hdpi/logo.png differ
diff --git a/res/layout/editor_menu.xml b/res/layout/editor_menu.xml
new file mode 100644
index 0000000..7a0a0ba
--- /dev/null
+++ b/res/layout/editor_menu.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout/help.xml b/res/layout/help.xml
new file mode 100644
index 0000000..03456b7
--- /dev/null
+++ b/res/layout/help.xml
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout/playlist_editor.xml b/res/layout/playlist_editor.xml
index e7730ac..a214bd3 100644
--- a/res/layout/playlist_editor.xml
+++ b/res/layout/playlist_editor.xml
@@ -19,16 +19,15 @@
-
+ android:drawableLeft="@android:drawable/ic_menu_more"
+ android:text="@string/menu" />
+
+
- Введите имя
Готово!
Все треки
-
+ Меню
+ Сортировать по id
+ Сортировать по исполнителю
+ Сортировать по названию
+ В обратном порядке
+ Показать различия
+
Ошибка при восстановлении резервной копии
Невозможно сохранить резервную копию
Пустой список резервных копий
-
+ Нажмите еще раз для выхода в меню
+
+
+ Помощь
+ Добавление/Удаление трека
+ Нажмите на трек в левом списке (1), затем на пункт в правом, перед которым следует поместить трек (2). Для удаления нажмите и удерживайте пункт в правом списке.
+ Показать различия
+ Используется для поиска треков в левом списке, которых нет в правом, а также для поиска дубликатов.
+
+
+ О программе
+ Playlist Editor 1.4\nАвтор: Виктор aNNiMON Мельник\nhttp://annimon.com/
+
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 4973557..62e436b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -11,10 +11,29 @@
Enter name
Done!
All tracks
-
+ Menu
+ Sort by id
+ Sort by artist
+ Sort by name
+ Reverse list
+ Show differences
+
+
Error while restore backup
Unable to store backup
Empty backup list
+ Press again for exit to menu
+
+
+ Help
+ Add/Remove track
+ Press item in the left list (1), then press item in right list, which should be placed in front of him (2). Long tap to remove track (in right list only).
+ Show differences
+ Used to find tracks in the left list, which is not present in right list and to find duplicates.
+
+
+ About
+ Playlist Editor 1.4\nAuthor: Victor aNNiMON Melnik\nhttp://annimon.com/
\ No newline at end of file
diff --git a/src/com/annimon/playlisteditor/HelpActivity.java b/src/com/annimon/playlisteditor/HelpActivity.java
new file mode 100644
index 0000000..be303ab
--- /dev/null
+++ b/src/com/annimon/playlisteditor/HelpActivity.java
@@ -0,0 +1,34 @@
+package com.annimon.playlisteditor;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ViewFlipper;
+
+/**
+ * Show help window.
+ * @author aNNiMON
+ */
+public class HelpActivity extends Activity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.help);
+
+ final ViewFlipper flipper = (ViewFlipper) findViewById(R.id.viewFlipper);
+ flipper.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ flipper.showNext();
+ }
+ });
+ }
+
+ @Override
+ public void onBackPressed() {
+ super.onBackPressed();
+ overridePendingTransition(R.anim.slide_right_in, R.anim.slide_right_out);
+ }
+
+}
diff --git a/src/com/annimon/playlisteditor/MenuDialog.java b/src/com/annimon/playlisteditor/MenuDialog.java
new file mode 100644
index 0000000..7704103
--- /dev/null
+++ b/src/com/annimon/playlisteditor/MenuDialog.java
@@ -0,0 +1,52 @@
+package com.annimon.playlisteditor;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.view.View;
+import android.view.Window;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.GridView;
+
+/**
+ * Custom menu dialog.
+ * @author aNNiMON
+ */
+public abstract class MenuDialog implements AdapterView.OnItemClickListener {
+
+ private Dialog dialog;
+ private int[] menuIds;
+
+ public MenuDialog(Context context, int[] menuIds) {
+ this.menuIds = menuIds;
+
+ dialog = new Dialog(context);
+ dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+ dialog.setCancelable(true);
+ dialog.setContentView(R.layout.editor_menu);
+
+ String[] items = new String[menuIds.length];
+ for (int i = 0; i < items.length; i++) {
+ items[i] = context.getString(menuIds[i]);
+ }
+
+ ArrayAdapter adapter = new ArrayAdapter(
+ context, android.R.layout.simple_list_item_1, items);
+
+ GridView gridView = (GridView) dialog.findViewById(R.id.gridView);
+ gridView.setAdapter(adapter);
+ gridView.setOnItemClickListener(this);
+ }
+
+ public void show() {
+ dialog.show();
+ }
+
+ @Override
+ public void onItemClick(AdapterView> parent, View v, int position, long id) {
+ onClick(menuIds[position], (position % 2) == 0);
+ dialog.dismiss();
+ }
+
+ protected abstract void onClick(int resId, boolean leftColumn);
+}
diff --git a/src/com/annimon/playlisteditor/PlaylistBackup.java b/src/com/annimon/playlisteditor/PlaylistBackup.java
index c404975..ceb0931 100644
--- a/src/com/annimon/playlisteditor/PlaylistBackup.java
+++ b/src/com/annimon/playlisteditor/PlaylistBackup.java
@@ -43,14 +43,13 @@ public class PlaylistBackup {
}
public List list() throws IOException {
- String[] filelist = context.fileList();
- int length = filelist.length;
- List backups = new ArrayList(length);
-
- for (int i = 0; i < length; i++) {
- if (filelist[i].endsWith(BACKUP_EXT)) {
- String playlistName = getPlaylistName(filelist[i]);
- backups.add( new BackupFile(filelist[i], playlistName) );
+ String[] fileslist = context.fileList();
+ List backups = new ArrayList(fileslist.length);
+
+ for (String filename : fileslist) {
+ if (filename.endsWith(BACKUP_EXT)) {
+ String playlistName = getPlaylistName(filename);
+ backups.add(new BackupFile(filename, playlistName));
}
}
diff --git a/src/com/annimon/playlisteditor/PlaylistDatabase.java b/src/com/annimon/playlisteditor/PlaylistDatabase.java
index 8be01ec..87db7f7 100644
--- a/src/com/annimon/playlisteditor/PlaylistDatabase.java
+++ b/src/com/annimon/playlisteditor/PlaylistDatabase.java
@@ -126,7 +126,7 @@ public class PlaylistDatabase {
/**
* Get tracks of playlist. If playlistId equals -1 - return all tracks in system.
- * @param context
+ * @param context context.
* @param playlistId id of playlist, or -1.
* @return tracks array.
*/
diff --git a/src/com/annimon/playlisteditor/SelectPlaylistActivity.java b/src/com/annimon/playlisteditor/SelectPlaylistActivity.java
index b8d64ce..2f9cd9f 100644
--- a/src/com/annimon/playlisteditor/SelectPlaylistActivity.java
+++ b/src/com/annimon/playlisteditor/SelectPlaylistActivity.java
@@ -77,6 +77,11 @@ public class SelectPlaylistActivity extends ListActivity {
case R.id.menu_restore_playlist:
restorePlaylist();
break;
+ case R.id.menu_help:
+ Intent intent = new Intent(this, HelpActivity.class);
+ startActivity(intent);
+ overridePendingTransition(R.anim.slide_left_in, R.anim.slide_left_out);
+ break;
}
return true;
}
diff --git a/src/com/annimon/playlisteditor/TracksAdapter.java b/src/com/annimon/playlisteditor/TracksAdapter.java
index 0d4ec84..7bfa751 100644
--- a/src/com/annimon/playlisteditor/TracksAdapter.java
+++ b/src/com/annimon/playlisteditor/TracksAdapter.java
@@ -2,6 +2,8 @@ package com.annimon.playlisteditor;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
@@ -17,6 +19,8 @@ import com.annimon.playlisteditor.data.Track;
*/
public class TracksAdapter extends ArrayAdapter