diff --git a/AndroidManifest.xml b/AndroidManifest.xml index dac8f21..e804898 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,10 +1,10 @@ - - + versionCode="014" + versionName="0.1.4"> + + + diff --git a/res/drawable/ic_chevron_left_white_24dp.png b/res/drawable/ic_chevron_left_white_24dp.png new file mode 100644 index 0000000..815b155 Binary files /dev/null and b/res/drawable/ic_chevron_left_white_24dp.png differ diff --git a/res/drawable/ic_dots_vert_white.png b/res/drawable/ic_dots_vert_white.png new file mode 100644 index 0000000..2fff38e Binary files /dev/null and b/res/drawable/ic_dots_vert_white.png differ diff --git a/res/drawable/ic_keyboard_arrow_left_black_24dp.png b/res/drawable/ic_keyboard_arrow_left_black_24dp.png new file mode 100644 index 0000000..23ef6d6 Binary files /dev/null and b/res/drawable/ic_keyboard_arrow_left_black_24dp.png differ diff --git a/res/drawable/ic_save_black_24dp.png b/res/drawable/ic_save_black_24dp.png new file mode 100644 index 0000000..fb9c14b Binary files /dev/null and b/res/drawable/ic_save_black_24dp.png differ diff --git a/res/drawable/ic_save_white_24dp.png b/res/drawable/ic_save_white_24dp.png new file mode 100644 index 0000000..aa03320 Binary files /dev/null and b/res/drawable/ic_save_white_24dp.png differ diff --git a/res/drawable/ic_settings.png b/res/drawable/ic_settings.png index d293b40..12e5d10 100644 Binary files a/res/drawable/ic_settings.png and b/res/drawable/ic_settings.png differ diff --git a/res/drawable/icon_pencil.png b/res/drawable/icon_pencil.png new file mode 100644 index 0000000..26fcd77 Binary files /dev/null and b/res/drawable/icon_pencil.png differ diff --git a/res/layout/activity_auplayer.xml b/res/layout/activity_auplayer.xml new file mode 100644 index 0000000..74d6d62 --- /dev/null +++ b/res/layout/activity_auplayer.xml @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/layout/activity_tageditor.xml b/res/layout/activity_tageditor.xml new file mode 100644 index 0000000..cbe14ae --- /dev/null +++ b/res/layout/activity_tageditor.xml @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/layout/activity_tageditor2.xml b/res/layout/activity_tageditor2.xml new file mode 100644 index 0000000..7933bda --- /dev/null +++ b/res/layout/activity_tageditor2.xml @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/layout/cathy.xml b/res/layout/cathy.xml new file mode 100644 index 0000000..45e459f --- /dev/null +++ b/res/layout/cathy.xml @@ -0,0 +1,6 @@ + + + diff --git a/res/layout/popup_auplayer_songoptions.xml b/res/layout/popup_auplayer_songoptions.xml new file mode 100644 index 0000000..470b2df --- /dev/null +++ b/res/layout/popup_auplayer_songoptions.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/values/strings.xml b/res/values/strings.xml index 3c3f67f..1ba5e70 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1,4 +1,4 @@ aupod - AuPod + 0.1.3 diff --git a/src/sleepchild/aupod22/AudioService.java b/src/sleepchild/aupod22/AudioService.java index ac704d0..f3f9e32 100644 --- a/src/sleepchild/aupod22/AudioService.java +++ b/src/sleepchild/aupod22/AudioService.java @@ -11,6 +11,8 @@ public class AudioService extends Service implements SongFactory.FactoryEvents { public static final int REQUEST_CODE = 914826; public static final String CMD_START = "sleepchild.aupod.service_cmd.start"; + public static final String CMD_EXIT = "sleepchild.aupod.service_cmdE_Exit"; + public static final String CMD_PLAY = "sleepchild.aupod.service_cmd_PLAY"; public static final String CMD_PAUSE = "sleepchild.aupod.service_cmd.PAUSECMD"; @@ -142,6 +144,10 @@ public int getCurrentPosition(){ return player.getCurrentPosition(); } + public int getDuration(){ + return player.getDuration(); + } + public void seekTo(int pos){ player.seekTo(pos); } @@ -284,8 +290,27 @@ private void unRegisterMediaButtons(){ audioMgr.unregisterMediaButtonEventReceiver(mediaButtonComp); } + Runnable dblk; + int d=0; private void handleMediaButton(){ - playPause(); + if(dblk==null){ + dblk = new Runnable(){ + public void run(){ + //single click + d=0; + playPause(); + } + }; + } + d++; + if(d==2){ + // double click + handle.removeCallbacks(dblk); + playNext(); + d=0; + }else if(d==1){ + handle.postDelayed(dblk,250); + } } } diff --git a/src/sleepchild/aupod22/PlayerActivity.java b/src/sleepchild/aupod22/PlayerActivity.java index 734be34..8f8da46 100644 --- a/src/sleepchild/aupod22/PlayerActivity.java +++ b/src/sleepchild/aupod22/PlayerActivity.java @@ -1,4 +1,5 @@ package sleepchild.aupod22; + import android.os.*; import android.widget.*; import android.graphics.*; @@ -8,6 +9,7 @@ import android.graphics.drawable.*; import android.view.*; import java.util.concurrent.*; +import sleepchild.aupod22.menu.*; public class PlayerActivity extends BaseActivity { @@ -17,18 +19,18 @@ public class PlayerActivity extends BaseActivity LinearLayout art2Background; ImageView currentArt; AudioService aupod; -// SongItem currentSong; ImageView playpauseIcon; SeekBar seeker; Runnable seekerTick; boolean seektouch; Handler handle; + SongOptions songMenu; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.auplayer); + setContentView(R.layout.activity_auplayer); init(); } @@ -83,6 +85,8 @@ public void run(){ trackTimeCurrent = (TextView) findViewById(R.id.auplayer_currentpos); trackTimeDuration = (TextView) findViewById(R.id.auplayer_duration); + + songMenu = new SongOptions(this); } void updateInfo(){ @@ -97,7 +101,13 @@ void updateInfo(){ currentArt.setImageResource(R.drawable.fallback_cover); art2Background.setBackgroundResource(R.drawable.fallback_cover); } - seeker.setMax((int)si.duration); + + if(aupod.isPlaying()){ + seeker.setMax(aupod.getDuration()); + }else{ + seeker.setMax((int)si.duration); + } + seeker.setProgress(aupod.getCurrentPosition()); trackTimeDuration.setText(formatTime((int)si.duration)); //*/ @@ -161,6 +171,12 @@ public void onButton(View v){ aupod.playPrev(); } break; + case R.id.auplayer_btn_back: + finish(); + break; + case R.id.auplayer_btn_options: + songMenu.show(aupod.getCurrentSong()); + break; } } diff --git a/src/sleepchild/aupod22/TagEditorActivity.java b/src/sleepchild/aupod22/TagEditorActivity.java new file mode 100644 index 0000000..21cfd66 --- /dev/null +++ b/src/sleepchild/aupod22/TagEditorActivity.java @@ -0,0 +1,13 @@ +package sleepchild.aupod22; + +import android.os.Bundle; + +public class TagEditorActivity extends BaseActivity{ + + @Override + public void onCreate(Bundle si){ + super.onCreate(si); + setContentView(R.layout.activity_tageditor); + } + +} diff --git a/src/sleepchild/aupod22/menu/SongOptions.java b/src/sleepchild/aupod22/menu/SongOptions.java new file mode 100644 index 0000000..484137e --- /dev/null +++ b/src/sleepchild/aupod22/menu/SongOptions.java @@ -0,0 +1,107 @@ +package sleepchild.aupod22.menu; + +import sleepchild.aupod22.BaseActivity; +import android.content.*; +import android.widget.*; +import android.view.*; +import android.app.*; +import sleepchild.aupod22.SongItem; +import sleepchild.aupod22.TagEditorActivity; +import sleepchild.aupod22.R; + +public class SongOptions implements View.OnClickListener +{ + BaseActivity ctx; + SongItem si; + RelativeLayout container; + TextView title, artist; + Dialog dlg; + + + public SongOptions(BaseActivity ctx){ + this.ctx = ctx; + dlg = new Dialog(ctx); + Window w = dlg.getWindow(); + w.requestFeature(Window.FEATURE_NO_TITLE); + + dlg.setContentView(R.layout.popup_auplayer_songoptions); + // + title = ftv(R.id.popup_auplayer_songoptions_title); + artist = ftv(R.id.popup_auplayer_songoptions_artist); + + LinearLayout ops = (LinearLayout) fv(R.id.popup_auplayer_songoptions_clk); + int cc = ops.getChildCount(); + for(int i=0;i