Пример #1
0
 @Override
 protected void onStop() {
   super.onStop();
   LOG.d("ON FoobnixActivity STOP");
   unregisterReceiver(foobnixUIUpdater);
   unregisterReceiver(songLineUpdater);
   FServiceHelper.getInstance().activateShortTimer(FoobnixActivity.this, false);
   finish();
 }
Пример #2
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());
  }
Пример #3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.player);

    playlistView = (ListView) findViewById(R.id.listview_playlist);
    playlistView.setAdapter(playListAdapter);

    SeekBar seekBar = ((SeekBar) findViewById(R.id.playerSeekBar));
    seekBar.setOnSeekBarChangeListener(seekLisner);

    playlistView.setOnItemClickListener(onItemClick);
    playlistView.setOnItemLongClickListener(onDialog);

    ImageButton playPause = (ImageButton) findViewById(R.id.button_play_pause);
    playPause.setOnClickListener(onPlayPause);

    ImageButton next = (ImageButton) findViewById(R.id.button_next);
    next.setOnClickListener(onNext);

    ImageButton prev = (ImageButton) findViewById(R.id.button_prev);
    prev.setOnClickListener(onPrev);

    foobnixUIUpdater = new FoobnixUIUpdater(this, app);
    songLineUpdater = new SongLineUpdater(playListAdapter, playlistView);

    if (app.getNowPlayingSong().equals(FModelBuilder.Empty())) {
      app.getNotification().displayNotifcation(getActivityTitle(), C.get().sleepMins);
    }

    View menu = (View) findViewById(R.id.imageShowMenu);
    menu.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            hideShowMenu();
          }
        });

    LOG.d("ON FoobnixActivity Create");
    onAcitvateMenuImages(this);
  }