From b44f6a3ab6b2309ce87ca514955944830a3e29e0 Mon Sep 17 00:00:00 2001 From: <> Date: Mon, 20 Dec 2021 20:31:03 +0200 Subject: [PATCH] update 0.1.14 --- AndroidManifest.xml | 11 +- res/drawable/ic_chevron_left_white_24dp.png | Bin 0 -> 311 bytes res/drawable/ic_dots_vert_white.png | Bin 0 -> 140 bytes .../ic_keyboard_arrow_left_black_24dp.png | Bin 0 -> 259 bytes res/drawable/ic_save_black_24dp.png | Bin 0 -> 393 bytes res/drawable/ic_save_white_24dp.png | Bin 0 -> 359 bytes res/drawable/ic_settings.png | Bin 350 -> 737 bytes res/drawable/icon_pencil.png | Bin 0 -> 1208 bytes res/layout/activity_auplayer.xml | 218 ++++++++++++++++++ res/layout/activity_tageditor.xml | 210 +++++++++++++++++ res/layout/activity_tageditor2.xml | 201 ++++++++++++++++ res/layout/cathy.xml | 6 + res/layout/popup_auplayer_songoptions.xml | 89 +++++++ res/values/strings.xml | 2 +- src/sleepchild/aupod22/AudioService.java | 27 ++- src/sleepchild/aupod22/PlayerActivity.java | 22 +- src/sleepchild/aupod22/TagEditorActivity.java | 13 ++ src/sleepchild/aupod22/menu/SongOptions.java | 107 +++++++++ 18 files changed, 897 insertions(+), 9 deletions(-) create mode 100644 res/drawable/ic_chevron_left_white_24dp.png create mode 100644 res/drawable/ic_dots_vert_white.png create mode 100644 res/drawable/ic_keyboard_arrow_left_black_24dp.png create mode 100644 res/drawable/ic_save_black_24dp.png create mode 100644 res/drawable/ic_save_white_24dp.png create mode 100644 res/drawable/icon_pencil.png create mode 100644 res/layout/activity_auplayer.xml create mode 100644 res/layout/activity_tageditor.xml create mode 100644 res/layout/activity_tageditor2.xml create mode 100644 res/layout/cathy.xml create mode 100644 res/layout/popup_auplayer_songoptions.xml create mode 100644 src/sleepchild/aupod22/TagEditorActivity.java create mode 100644 src/sleepchild/aupod22/menu/SongOptions.java 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 0000000000000000000000000000000000000000..815b155c57e8e83ec45755f6c9e4947ceaf9d67a GIT binary patch literal 311 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}tg=CK)Uj~LMH3o);76yi2K%s^g z3=E|}g|8AA7_4S6Fo+k-*%fF5lweBoc6VX;-`;;_Kaj^+;1OBOz`!jG!i)^F=12eq z*L%7+hD02Gd)<+%*+IbNqM4exSBs3!12>5e2RL^+q>37yUUjLhVeRd2_A=}j87EfH zne>}gB;dfpMzP*GEyZRG4#{bMZ5Yl-9?<`PXp6nVvrva~*$(sfZw$BmsXqTXqw#sB z+JCEZyPw!F=bUn`67MZEyccyzXm8>D`c5;UUuL45byrlT+}_IZcA{j<4)qcz))Xi9 zsz(!!(Z37e659SBVHvEaM`CpHV0iDj^>FVdQ&MBb@0PenO AdH?_b literal 0 HcmV?d00001 diff --git a/res/drawable/ic_dots_vert_white.png b/res/drawable/ic_dots_vert_white.png new file mode 100644 index 0000000000000000000000000000000000000000..2fff38e511d93afa436571ebc1abd1deb1178366 GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@I3?$8F6>N5 z9~c!GJrs*pa;{pzx8U00KYzAcfB(+Nx_a;5)4HD+_$w|(mB=ki)CdBZ3*=LrLIYMBmuhUR8vVTW@s)WtRUO;i3Gi~F5bdd2cWYq9N4JBy(D zleu2gUe0WBJ5{H7GvoUDj!q8Fmj;*C#6>T&?qX`)y!gwz3D1?LTK+!9{KPJ7%Gdlk ln$hW>b(8n*oj$!=@5b#N&o<~RmIa0ogQu&X%Q~loCIA&fm|y?^ literal 0 HcmV?d00001 diff --git a/res/drawable/ic_save_white_24dp.png b/res/drawable/ic_save_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..aa0332092a831d643dc16620ff8741c3ec9ccc7c GIT binary patch literal 359 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}tg=CK)Uj~LMH3o);76yi2K%s^g z3=E|}g|8AA7_4S6Fo+k-*%fF5lweBoc6VX;-`;;_Kaj^+;1OBOz`!jG!i)^F=12eq z?|Zs9hD02Gd)<+%$wB1U$D5tvoeEtBd*_RD9PZAL)y$G!=(z3I_O1(RGhY=4p8X!i z{Hd<_RCBt);b|Wa{AWz|(u(ta#nof^DK5x-!IQsB^c+~T7S--K`c>FUAnJhAibi%P z{*n$w1{(ziyIyvi533K%R25`o{zs_2v-=N#*|yls-=vKzMeEt<;LvBqHy zGn2MJo#2KIOr3lu);O$VmRiRD_W7y%B4uZ+-hO`-cyWW0nu?0z`<=D=1(SMq{j%IJ zk>RKS_X%5ex4+s~X8mfO9=zrDZ_{hcUAve*?KrXY(x;;hK(8`*y85}Sb4q9e0E^az A761SM literal 0 HcmV?d00001 diff --git a/res/drawable/ic_settings.png b/res/drawable/ic_settings.png index d293b40f270ba1adecab074643f565020262b30c..12e5d100dd80ca03315f8d15af6289c3db015327 100644 GIT binary patch literal 737 zcmV<70v`Q|P)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00LP_L_t(o!{wOIYZFlr$0xNhfhN^PB<61QP-zeTfPz1; z^dQxPr5C}!K?FUt)`L*6MGt!LRCWH-_|9`s9Bn=AF69nLToD#$tcrfQw2R&clt z?Jgx4ZbNGd=9r>Nk%`tk!#!$fQe%ms7H)zf-3#A zMO5-qBbW&=`pPULBuH?KIZ6TOX)nQf>OKZ}23)5jMZpJM=bUy-$F1*`C+11Wn3duS zr)+tUWkubb0Yn*T$_n}!2mKPQp9db3S=GHD%zLo++2fzdg0N{AjaUgr4W#46csp93 zY#W-S)GbMsl%GbQj`#LfL70Bfkj>C_|EMvq1{1{Pkz@?rB`bmXuj#Dh2rdWEd*6rEAeH9$d4v}Fsr#JEN<>Dyikq>Z;<_H98*skj_azRJuqN|GdF z+*UVdr(D#wXf?8O{ala1@rWAEHe z8?~_0z4vCfm-XgC-*S!p%uw;&4u@%mxX!!QbuAuLt}jp_&*|2D9}E0Yoo{i6!4~c; zPjQ$Gx;pBkXlbM&Y{Ql7^)|E}^@E-hthJ&2H&@^&AFVI6{?+Mc?5_S-(Q|^oR4iHa T4YrnW00000NkvXXu0mjftyfGA literal 350 zcmV-k0ipgf;oG7L@V}s-ge= zcbe^=(>zqgDT-!HX^5oEroLhiaI$T6m0b-|!qYzb92<~kOPGKy%+Z-nF9sDOz zK?L~f?h7*m_qTX;n8`;uCPfcqeCk$dSdj6oXOG0S~Lk@hmew9XumpHX?2)i=jna4XP=gOhT3<|lxX`LyJ`aaZ5YA? wNHycYe|Jt6XsH7sstP4^j5vvbszN}w6__>W^Y=*pp32{Y`Fl2hkN-m{03BVa;{X5v diff --git a/res/drawable/icon_pencil.png b/res/drawable/icon_pencil.png new file mode 100644 index 0000000000000000000000000000000000000000..26fcd772ad297c0303b3d44caa09548b9d1b821d GIT binary patch literal 1208 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+yeRz_=~IC&bmgzy~NY3Win)%;#$3 z1G;!(NswPKgI9RmkKcd(`pb9D)|S^IAu)+k_v?Q4 zed5?57{F2P7^szcZ1l68+2p%EdWFlrlW&D@HDq}2VK<%Z z9P#2k*DpJB9-k9JhK*$v#=&icM^?|Ca!w)Z=_Yltblrtrx0kR!d}O28bJvKwNQ*7G zTJ}ul3Hd9385o!pJY5_^A`ZWuemz{+QKVg;V|NEj(+)L7PR_mG)m$A}m)>G{T`nc=+quKv=k6>|FMBTZ_i^C%Z^_O6yPfVc{CJf; zqh_=CHIC(*e>loU{QOn?m%pGZ*@DkzMueE7Guvr}A1$-PDkdcx{M_-PCGo~_V;=U3 z)aC~htD0`G9qcxL(Q8^!=e_=a;HI?;1MU7#c``#sD|+IG*nM?oZSfAfLjKO$zBs~J z_d{fxd-k@yj%W6Jtl7`%vDuWxHe%|@`*SsU^rR1aE2xC--!HL>w`Kl`xAD==HA+2P zH~;1*3+%b4QeSsxIlqLDo#)d(p^5Vsx=i)IwDEevi&uNDZJB*kmajf%JKx7noqMaE zM2gSvmoWReC$)h&PU4)!LhfWW$z9Mdww|9eDd;k2gTNgDmDMf2Xc4WGkp0}F{{zcuSA<6Hu0h(VqUd&g}y>w|5iuWd2!6|l^zyx}%%>?c2qm@ijbuhy9_Yb5{x literal 0 HcmV?d00001 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