Ejemplo n.º 1
0
 /** 设置数据源 */
 private void setData() {
   musicPlayerContrl = MusicApplication.getMusicPlayer();
   presenterNet.loadNewMusics();
   presenterNet.loadHotMusics();
   presenterNet.loadBillboardMusics();
   presenterNet.loadKTVMusics();
 }
Ejemplo n.º 2
0
 /**
  * 播放音乐
  *
  * @param parent
  * @param view
  * @param position
  * @param id
  */
 @Override
 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
   //      LogUtil.logInfo(TAG, "onItemClick: "+position);
   //      ToastUtil.showToast(getContext(),""+position);
   List<SongList> songLists = MusicApplication.getMusicPlayer().getSongLists();
   MusicApplication.getMusicPlayer().setMusicListType(SEARCH);
   MusicApplication.getMusicPlayer().setPosition(position);
   String songId = songLists.get(position).getSong_id();
   // LogUtil.logInfo(TAG, "onItemClick: " + songId);
   presenterNetDetial.setSong(songId);
   lvSearchMusic.setVisibility(View.GONE);
   animation =
       new TranslateAnimation(
           0, 0, lvSearchMusic.getHeight() + llNetFragment.getHeight(), llNetFragment.getHeight());
   animation.setDuration(300);
   animation.start();
 }
Ejemplo n.º 3
0
  /**
   * 设置点击事件,显示相应数据的列表
   *
   * @param v
   */
  @Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.ll_new_list:
        setIntentType(NEW);
        break;
      case R.id.ll_hot_list:
        setIntentType(HOT);
        break;
      case R.id.ll_billboard_list:
        setIntentType(BILLBOARD);
        break;
      case R.id.ll_ktv_list:
        setIntentType(KTV);
        break;
      case R.id.ibtn_local_music:
        if (MusicApplication.getContext().getPlayer().isPlaying()) {
          intentPlayActivity();
          return;
        } else {
          // ToastUtil(getActivity(), "当前没有播放歌曲");
          intentPlayActivity();
        }
        break;
      case R.id.ibtn_music_search:
        String songName = etSearch.getText().toString().trim();
        if (songName != null) {
          lvSearchMusic.setVisibility(View.VISIBLE);
          animation =
              new TranslateAnimation(
                  0,
                  0,
                  llNetFragment.getHeight(),
                  lvSearchMusic.getHeight() + llNetFragment.getHeight());
          animation.setDuration(300);
          animation.start();
          //                    LogUtil.logInfo(TAG, "songName: " + songName);
          presenterNet.loadSearchMusics(songName);
        } else if ("".equals(songName)) {
          ToastUtil.showToast(getContext(), "请输入想听的歌曲");
        }
        break;
    }
    // LogUtil.logInfo(TAG, "Fragment onClick: " + type);

  }