Ejemplo n.º 1
0
 @Override
 public void onPause() {
   super.onPause();
   BigLog.i(tag, Logging.getCurrentMethodName(), logHighlight);
   buttonProcessor.onStopClicked();
   android.os.Process.killProcess(android.os.Process.myPid());
 }
Ejemplo n.º 2
0
 // Scrollable interface implementation
 public void scrollToSelectedPosition() {
   BigLog.i(tag, Logging.getCurrentMethodName(), logHighlight);
   runOnUiThread(
       new Runnable() {
         public void run() {
           listView.smoothScrollToPosition(listAdapter.getSelectedPosition());
         }
       });
 }
Ejemplo n.º 3
0
 public void clearPlayList() {
   BigLog.i(tag, Logging.getCurrentMethodName(), logHighlight);
   runOnUiThread(
       new Runnable() {
         public void run() {
           listAdapter.clear();
         }
       });
 }
Ejemplo n.º 4
0
  @Override
  public void onCreate(Bundle icicle) {
    poster = new Handler();
    BigLog.i(tag, Logging.getCurrentMethodName(icicle), logHighlight);
    killer = ForApp.registerReceiverFromKillerApp(this);
    ForApp.setWindowFlagsToKeepDeviceOn(this);
    super.onCreate(icicle);
    MediaSource.getInstance().setMediaGui(this);
    listAdapter =
        new SelectedArrayAdapter(
            this, android.R.layout.simple_list_item_1, new ArrayList<TrackInformation>());
    listAdapter.setNotifyOnChange(true);
    setContentView(R.layout.video);
    horizontalView = (LinearLayout) findViewById(R.id.videoLand);
    verticalView = (LinearLayout) findViewById(R.id.videoPort);

    videoListCover = ((ImageView) findViewById(R.id.videoListCoverPort));
    videoListCoverPort = ((ImageView) findViewById(R.id.videoListCover));
    videoViewBackground = (RelativeLayout) findViewById(R.id.videoHost);

    videoPlayer = (VideoView) findViewById(R.id.videoView);
    videoPlayer.setVisibility(View.VISIBLE);

    videoPlayer.setVisibility(View.VISIBLE);
    videoPlayer.setOnTouchListener(new VideoOnClickListener());

    initAdditionalButtons(abl);
    setSuitableConfiguration();

    setFullScreenMode();
    listVisible();
    getScaleControls();

    poster.postDelayed(new VideoInflater(), VIDEO_INFLATE_TIMEOUT_MILLIS);

    currentController = new ConnectedController((Scalable) this);

    bridge = Bridge.createInstance(this, (MediaGui) this, (JniPlayerWrapper) currentController);
    buttonProcessor = (ButtonProcessor) bridge;
    AudioPlayer aPlayer =
        new AudioPlayer(this, buttonProcessor, currentController, (Scrollable) this);
    VideoPlayer vPlayer =
        new VideoPlayer(
            this, buttonProcessor, currentController, (Scrollable) this, videoPlayer, this);
    currentController.setPlayers(aPlayer, vPlayer);

    Splash.displaySplashScreen(
        this,
        new Runnable() {
          public void run() {
            BigLog.i(tag, "Splash done!", logHighlight);
            bridge.startApp();
          }
        },
        Length.LONG);
  }
Ejemplo n.º 5
0
 public void highlightToggle() {
   BigLog.i(tag, Logging.getCurrentMethodName(), logHighlight);
   runOnUiThread(
       new Runnable() {
         public void run() {
           findViewById(R.id.toggle).setBackgroundResource(R.drawable.toggle_tab_active);
           findViewById(R.id.togglePort).setBackgroundResource(R.drawable.toggle_tab_active_port);
         }
       });
 }
Ejemplo n.º 6
0
 public void populateList(final String name, final boolean isLocal) {
   BigLog.i(tag, Logging.getCurrentMethodName(name, isLocal), logHighlight);
   runOnUiThread(
       new Runnable() {
         public void run() {
           listAdapter.add(new TrackInformation(name, isLocal));
           listAdapter.notifyDataSetChanged();
         }
       });
 }
Ejemplo n.º 7
0
 public void unlockGUI() {
   BigLog.i(tag, Logging.getCurrentMethodName(), logHighlight);
   runOnUiThread(
       new Runnable() {
         public void run() {
           if (progressDialog != null && progressDialog.isShowing()) {
             progressDialog.dismiss();
             progressDialog = null;
           }
         }
       });
 }
Ejemplo n.º 8
0
 public void setToggleState(final boolean isEnabled) {
   BigLog.i(tag, Logging.getCurrentMethodName(isEnabled), logHighlight);
   runOnUiThread(
       new Runnable() {
         public void run() {
           findViewById(R.id.toggle).setEnabled(isEnabled);
           findViewById(R.id.togglePort).setEnabled(isEnabled);
           findViewById(R.id.toggle).setBackgroundResource(R.drawable.land_toggle);
           findViewById(R.id.togglePort).setBackgroundResource(R.drawable.port_toggle);
         }
       });
 }
Ejemplo n.º 9
0
 // from the onClickListener interface
 public void onClick(View v) {
   if (!currentController.canProcessButtons()) {
     BigLog.i(tag, "Cannot process buttons in this state", logHighlight);
     return;
   }
   switch (v.getId()) {
     case R.id.videoPlay:
     case R.id.videoPlayPort:
       BigLog.i(tag, "Play clicked", logHighlight);
       buttonProcessor.onPlayClicked();
       break;
     case R.id.videoPause:
     case R.id.videoPausePort:
       BigLog.i(tag, "Pause clicked", logHighlight);
       buttonProcessor.onPauseClicked();
       break;
     case R.id.videoStop:
     case R.id.videoStopPort:
       BigLog.i(tag, "Stop clicked", logHighlight);
       buttonProcessor.onStopClicked();
       break;
     case R.id.videoNext:
     case R.id.videoNextPort:
       BigLog.i(tag, "Next clicked", logHighlight);
       buttonProcessor.onNextClicked();
       break;
     case R.id.videoPrev:
     case R.id.videoPrevPort:
       BigLog.i(tag, "Prev clicked", logHighlight);
       buttonProcessor.onPrevClicked();
       break;
     case R.id.sync:
     case R.id.syncPort:
       BigLog.i(tag, "Sync clicked", logHighlight);
       buttonProcessor.onSyncClicked();
       break;
     case R.id.toggle:
     case R.id.togglePort:
       BigLog.i(tag, "Toggle clicked", logHighlight);
       buttonProcessor.onToggleClicked();
       break;
     default:
       BigLog.e(tag, "Unknown button clicked?", logHighlight);
   }
 }
Ejemplo n.º 10
0
 public void lockGUI() {
   BigLog.i(tag, Logging.getCurrentMethodName(), logHighlight);
   runOnUiThread(
       new Runnable() {
         public void run() {
           if (progressDialog == null) {
             progressDialog = new ProgressDialog(VideoActivity.this);
             progressDialog.setMessage("Loading...");
             progressDialog.setCancelable(false);
             progressDialog.show();
           }
         }
       });
 }
Ejemplo n.º 11
0
 public void pauseVisible() {
   BigLog.i(tag, Logging.getCurrentMethodName(), logHighlight);
   runOnUiThread(
       new Runnable() {
         public void run() {
           aPlay.setVisibility(View.GONE);
           aPause.setVisibility(View.VISIBLE);
           ((Button) findViewById(R.id.videoPlay)).setVisibility(View.GONE);
           ((Button) findViewById(R.id.videoPlayPort)).setVisibility(View.GONE);
           ((Button) findViewById(R.id.videoPause)).setVisibility(View.VISIBLE);
           ((Button) findViewById(R.id.videoPausePort)).setVisibility(View.VISIBLE);
         }
       });
 }
Ejemplo n.º 12
0
 public void setSyncState(final boolean isOn) {
   BigLog.i(tag, Logging.getCurrentMethodName(isOn), logHighlight);
   runOnUiThread(
       new Runnable() {
         public void run() {
           findViewById(R.id.sync)
               .setBackgroundResource(
                   (isOn ? R.drawable.land_sync_active : R.drawable.land_sync_inactive));
           findViewById(R.id.syncPort)
               .setBackgroundResource(
                   (isOn ? R.drawable.port_sync_active : R.drawable.port_sync_inactive));
         }
       });
 }
Ejemplo n.º 13
0
 public void onClick(View v) {
   if (!currentController.canProcessPopupButtons()) {
     BigLog.i(tag, "Cannot process pop-up buttons in this state", logHighlight);
     return;
   }
   switch (v.getId()) {
     case R.id.videoAddNext:
       buttonProcessor.onNextClicked();
       break;
     case R.id.videoAddPause:
       buttonProcessor.onPauseClicked();
       break;
     case R.id.videoAddPlay:
       buttonProcessor.onPlayClicked();
       break;
     case R.id.videoAddPrev:
       buttonProcessor.onPrevClicked();
       break;
     case R.id.videoAddStop:
       buttonProcessor.onStopClicked();
       break;
   }
 }
Ejemplo n.º 14
0
 public void onClick(View v) {
   BigLog.i(tag, "One of the scale buttons was clicked", logHighlight);
   currentController.onScaleButtonClicked();
 }
Ejemplo n.º 15
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   BigLog.i(tag, Logging.getCurrentMethodName(newConfig), logHighlight);
   setSuitableConfiguration();
 }