コード例 #1
0
  public void playModel(FModel model) throws Exception {
    if (model == null) {
      throw new IllegalArgumentException();
    }
    instanse.stop();

    String path = model.getPath();
    instanse.play(path);
  }
コード例 #2
0
  @Override
  protected void actionDialog(final FModel item) {
    new RunnableDialog(FoobnixActivity.this, getString(R.string.Player_List_Action)) //
        .Action(
            getString(R.string.Clean_Playlist),
            new Runnable() {

              @Override
              public void run() {
                cleanPlayList();
              }
            }) //
        .Action(
            getString(R.string.Play),
            new Runnable() {
              @Override
              public void run() {
                FServiceHelper.getInstance().play(getApplicationContext(), item);
              }
            },
            item != null) //
        .Action(
            getString(R.string.Delete),
            new Runnable() {
              @Override
              public void run() {
                playListAdapter.remove(item);
                playListManager.remove(item);
              }
            },
            item != null) //
        .Action(
            getString(R.string.Download),
            new Runnable() {

              @Override
              public void run() {
                app.addToDownload(item);
              }
            },
            item != null && item.getType() == TYPE.ONLINE) //
        .Action(
            getString(R.string.Download_All),
            new Runnable() {
              @Override
              public void run() {
                List<FModel> items = playListAdapter.getAllFModels();
                for (FModel current : items) {
                  app.addToDownload(current);
                }
              }
            }) //
        .show();
  }
コード例 #3
0
  @Override
  protected void onStart() {
    super.onStart();
    LOG.d("On Start");

    final FModel stat = app.getNowPlayingSong();

    playlistView.post(
        new Runnable() {
          @Override
          public void run() {
            playListAdapter.updateCurrentView(stat.getPosition(), stat.getTime());
          }
        });
    LOG.d("UPDATE", stat.getPosition());

    FServiceHelper.getInstance().activateShortTimer(FoobnixActivity.this, true);
    playlistView.setSelection(stat.getPosition() - 2);

    registerReceiver(foobnixUIUpdater, new UIBrodcastAction().getIntentFilter());
    registerReceiver(songLineUpdater, new NewSongBroadcastAction().getIntentFilter());
  }