Ejemplo n.º 1
0
 @Override
 public void onDestroy() {
   super.onDestroy();
   if (mThumbnailer != null) mThumbnailer.clearJobs();
   mBarrier.reset();
   mVideoAdapter.clear();
 }
Ejemplo n.º 2
0
  @Override
  public void onPause() {
    super.onPause();
    mGVFirstVisiblePos = mGridView.getFirstVisiblePosition();
    mMediaLibrary.setBrowser(null);
    mMediaLibrary.removeUpdateHandler(mHandler);

    /* Stop the thumbnailer */
    if (mThumbnailer != null) mThumbnailer.stop();
  }
Ejemplo n.º 3
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mVideoAdapter = new VideoListAdapter(this);
    mMediaLibrary = MediaLibrary.getInstance();

    if (savedInstanceState != null) setGroup(savedInstanceState.getString(KEY_GROUP));
    /* Load the thumbnailer */
    FragmentActivity activity = getActivity();
    if (activity != null)
      mThumbnailer = new Thumbnailer(activity, activity.getWindowManager().getDefaultDisplay());
  }
Ejemplo n.º 4
0
  @Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    registerForContextMenu(mGridView);

    // init the information for the scan (2/2)
    IntentFilter filter = new IntentFilter();
    filter.addAction(Util.ACTION_SCAN_START);
    filter.addAction(Util.ACTION_SCAN_STOP);
    getActivity().registerReceiver(messageReceiverVideoListFragment, filter);
    if (mMediaLibrary.isWorking()) {
      Util.actionScanStart();
    }

    mAnimator = new VideoGridAnimator(mGridView);
  }
Ejemplo n.º 5
0
  @Override
  public void onResume() {
    super.onResume();
    if ((getActivity() instanceof MainActivity)) mMainActivity = (MainActivity) getActivity();
    mMediaLibrary.setBrowser(this);
    mMediaLibrary.addUpdateHandler(mHandler);
    final boolean refresh = mVideoAdapter.isEmpty();
    if (refresh) updateList();
    else {
      mViewNomedia.setVisibility(View.GONE);
      focusHelper(false);
    }
    // Get & set times
    HashMap<String, Long> times = MediaDatabase.getInstance().getVideoTimes();
    mVideoAdapter.setTimes(times);
    mGridView.setSelection(mGVFirstVisiblePos);
    updateViewMode();
    if (mGroup == null && refresh) mAnimator.animate();

    /* Start the thumbnailer */
    if (mThumbnailer != null) mThumbnailer.start(this);
  }
Ejemplo n.º 6
0
 @Override
 public void onDestroyView() {
   getActivity().unregisterReceiver(messageReceiverVideoListFragment);
   super.onDestroyView();
 }
Ejemplo n.º 7
0
 @Override
 public void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putString(KEY_GROUP, mGroup);
 }