content: package cn.sihao.mirrorcast.player;
  
  import android.content.Context;
  import android.support.annotation.NonNull;
  import android.support.annotation.Nullable;
  import android.support.v7.app.ActionBar;
  import android.util.AttributeSet;
  import android.view.View;
  import android.widget.MediaController;
  
  import java.util.ArrayList;
  
  public class MyAndroidMediaController extends MediaController implements IMediaController {
      private ActionBar mActionBar;
  
      public MyAndroidMediaController(Context context, AttributeSet attrs) {
          super(context, attrs);
          initView(context);
      }
  
      public MyAndroidMediaController(Context context, boolean useFastForward) {
          super(context, useFastForward);
          initView(context);
      }
  
      public MyAndroidMediaController(Context context) {
          super(context);
          initView(context);
      }
  
      private void initView(Context context) {
      }
  
      public void setSupportActionBar(@Nullable ActionBar actionBar) {
          mActionBar = actionBar;
          if (isShowing()) {
              actionBar.show();
          } else {
              actionBar.hide();
          }
      }
  
      @Override
      public void show() {
          super.show();
          if (mActionBar != null)
              mActionBar.show();
      }
  
      @Override
      public void hide() {
          super.hide();
          if (mActionBar != null)
              mActionBar.hide();
          for (View view : mShowOnceArray)
              view.setVisibility(View.GONE);
          mShowOnceArray.clear();
      }
  
      private ArrayList<View> mShowOnceArray = new ArrayList<View>();
  
      public void showOnce(@NonNull View view) {
          mShowOnceArray.add(view);
          view.setVisibility(View.VISIBLE);
          show();
      }
  }
  
  