コード例 #1
0
 public void setBackwardController(LayerManager.IBackwardContoller backwardControllerForLayer) {
   Iterator<Entry<MediaType, Layer>> itr = mLayers.entrySet().iterator();
   while (itr.hasNext()) {
     Layer layer = itr.next().getValue();
     if (layer != null) {
       layer.setBackwardController(backwardControllerForLayer);
     }
   }
 }
コード例 #2
0
 private void unbind() {
   assert (!(mCurrentLayer == null ^ mCurrentPlayer == null));
   if (mCurrentLayer == null) return;
   mCurrentPlayer.unRegisterPlayListener(mCurrentLayer);
   mCurrentLayer.onPause();
   mCurrentLayer.setPlayer(null);
   mCurrentLayer.setData(null);
   mCurrentPlayer = null;
   mCurrentLayer = null;
 }
コード例 #3
0
 private void bind(Player player, Layer layer, MediaData data) {
   assert (player != null && layer != null && data != null);
   mCurrentLayer = layer;
   mCurrentPlayer = player;
   mCurrentLayer.setPlayer(player);
   mCurrentLayer.setData(data);
   mCurrentPlayer.registerPlayListener(mCurrentLayer);
   mCurrentLayer.onPrepareOptionsMenu(mOptionsMenu);
   mCurrentLayer.onResume(mIsFilmMode);
 }
コード例 #4
0
 @Override
 public void onLayout(boolean changeSize, int left, int top, int right, int bottom) {
   Iterator<Entry<MediaType, Layer>> itr = mLayers.entrySet().iterator();
   while (itr.hasNext()) {
     Layer layer = itr.next().getValue();
     if (layer != null && layer.getMGLView() != null) {
       layer.getMGLView().doLayout(changeSize, left, top, right, bottom);
     }
   }
 }
コード例 #5
0
 @Override
 public void destroy() {
   Iterator<Entry<MediaType, Layer>> itr = mLayers.entrySet().iterator();
   while (itr.hasNext()) {
     Layer layer = itr.next().getValue();
     if (layer != null) {
       layer.onDestroy();
     }
   }
 }
コード例 #6
0
 @Override
 public void init(ViewGroup rootView, MGLView glRootView) {
   mRootView = rootView;
   mGLRootView = glRootView;
   Iterator<Entry<MediaType, Layer>> itr = mLayers.entrySet().iterator();
   while (itr.hasNext()) {
     Layer layer = itr.next().getValue();
     if (layer != null) {
       layer.onCreate(mActivity, mRootView);
     }
   }
 }
コード例 #7
0
 public boolean onCreateOptionsMenu(Menu menu) {
   Iterator<Entry<MediaType, Layer>> itr = mLayers.entrySet().iterator();
   Layer layer;
   while (itr.hasNext()) {
     layer = itr.next().getValue();
     if (layer != null) {
       layer.onCreateOptionsMenu(menu);
     }
   }
   mOptionsMenu = menu;
   return true;
 }
コード例 #8
0
 @Override
 public void resume() {
   Iterator<Entry<MediaType, Layer>> itr = mLayers.entrySet().iterator();
   while (itr.hasNext()) {
     Layer layer = itr.next().getValue();
     if (layer != null) {
       if (mRootView != null && layer.getView() != null) {
         mRootView.addView(layer.getView());
       }
       if (mGLRootView != null && layer.getMGLView() != null) {
         mGLRootView.addComponent(layer.getMGLView());
       }
       layer.onActivityResume();
     }
   }
 }
コード例 #9
0
 public boolean onActionBarVisibilityChange(boolean newVisibility) {
   boolean shouldBarControlledByLayerManager = false;
   if (mCurrentLayer != null) {
     shouldBarControlledByLayerManager = mCurrentLayer.onActionBarVisibilityChange(newVisibility);
   }
   return shouldBarControlledByLayerManager;
 }
コード例 #10
0
 @Override
 public void onFilmModeChange(boolean isFilmMode) {
   if (isFilmMode == mIsFilmMode) return;
   mIsFilmMode = isFilmMode;
   if (mCurrentLayer != null) {
     mCurrentLayer.onFilmModeChange(mIsFilmMode);
   }
 }
コード例 #11
0
 @Override
 public void pause() {
   Iterator<Entry<MediaType, Layer>> itr = mLayers.entrySet().iterator();
   while (itr.hasNext()) {
     Layer layer = itr.next().getValue();
     if (layer != null) {
       layer.onActivityPause();
     }
   }
   unbind();
   itr = mLayers.entrySet().iterator();
   while (itr.hasNext()) {
     Layer layer = itr.next().getValue();
     if (layer != null) {
       if (mRootView != null && layer.getView() != null) {
         mRootView.removeView(layer.getView());
       }
       if (mGLRootView != null && layer.getMGLView() != null) {
         mGLRootView.removeComponent(layer.getMGLView());
       }
     }
   }
 }
コード例 #12
0
 @Override
 public void onKeyEvent(KeyEvent event) {
   if (mCurrentLayer != null) {
     mCurrentLayer.onKeyEvent(event);
   }
 }
コード例 #13
0
 public boolean onOptionsItemSelected(MenuItem item) {
   if (mCurrentLayer != null) {
     mCurrentLayer.onOptionsItemSelected(item);
   }
   return true;
 }
コード例 #14
0
 public boolean onPrepareOptionsMenu(Menu menu) {
   if (mCurrentLayer != null) {
     mCurrentLayer.onPrepareOptionsMenu(menu);
   }
   return true;
 }
コード例 #15
0
 @Override
 public void drawLayer(MGLCanvas canvas, int width, int height) {
   if (mCurrentLayer != null && mCurrentLayer.getMGLView() != null)
     mCurrentLayer.getMGLView().doDraw(canvas, width, height);
 }