Ejemplo n.º 1
0
  // 初始化歌曲列表
  private void initLocalMusicList() {
    // fileInfos = MediaUtil.getFileInfos(getApplicationContext()); //获取歌曲对象集合
    setListAdpter(MediaUtil.getMusicMaps(fileInfos)); // 显示歌曲列表
    music_siger_tv.setText(fileInfos.get(listPosition).getArtist());
    music_name_tv.setText(fileInfos.get(listPosition).getTitle());
    music_play_bt.setPressed(play_bt_press);
    music_play_bt.setChecked(play_bt_check);

    anim = ObjectAnimator.ofFloat(music_album_iv, "rotation", 0, 360);
    lin = new LinearInterpolator();
    anim.setDuration(6000);
    anim.setRepeatCount(-1);
    anim.setRepeatMode(ObjectAnimator.RESTART);
    anim.setInterpolator(lin); // 匀速

    PropertyValuesHolder pvhX = PropertyValuesHolder.ofFloat("alpha", 1f, 0f, 1f);
    PropertyValuesHolder pvhY = PropertyValuesHolder.ofFloat("scaleX", 1f, 0, 1f);
    PropertyValuesHolder pvhZ = PropertyValuesHolder.ofFloat("scaleY", 1f, 0, 1f);
    animSongName = ObjectAnimator.ofPropertyValuesHolder(music_name_tv, pvhX, pvhY, pvhZ); // 渐现
    animSongName.setDuration(1000);
    animSongName.setRepeatCount(0);
    animSongName.setRepeatMode(ObjectAnimator.RESTART);

    animSongSinger = ObjectAnimator.ofPropertyValuesHolder(music_siger_tv, pvhX, pvhY, pvhZ); // 渐现
    animSongSinger.setDuration(1000);
    animSongSinger.setRepeatCount(0);
    animSongSinger.setRepeatMode(ObjectAnimator.RESTART);
  }
Ejemplo n.º 2
0
 public void onClick(View v) {
   menuWindow.dismiss();
   switch (v.getId()) {
     case R.id.btn_cancel:
       break;
     case R.id.btn_ok:
       {
         if (!isAllDelete) { // 删除本首歌曲
           deleteSdFile(fileInfos.get(localListPosition).getUrl()); // 删除歌曲和歌词文件
           appState.deleteMediaDB(
               LocalActivity.this, fileInfos.get(localListPosition)); // 删除数据库的记录
           fileInfos.remove(localListPosition); // 删除列表项
           setListAdpter(MediaUtil.getMusicMaps(fileInfos)); // 重新显示
         }
         break;
       }
     default:
       break;
   }
 }