Search in sources :

Example 1 with TransferProgressController

use of com.owncloud.android.ui.controller.TransferProgressController in project android by owncloud.

the class PreviewAudioFragment method onActivityCreated.

/**
     * {@inheritDoc}
     */
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    Log_OC.v(TAG, "onActivityCreated");
    OCFile file;
    if (savedInstanceState == null) {
        Bundle args = getArguments();
        file = args.getParcelable(PreviewAudioFragment.EXTRA_FILE);
        setFile(file);
        mAccount = args.getParcelable(PreviewAudioFragment.EXTRA_ACCOUNT);
        mSavedPlaybackPosition = args.getInt(PreviewAudioFragment.EXTRA_PLAY_POSITION);
        mAutoplay = args.getBoolean(PreviewAudioFragment.EXTRA_PLAYING);
    } else {
        file = savedInstanceState.getParcelable(PreviewAudioFragment.EXTRA_FILE);
        setFile(file);
        mAccount = savedInstanceState.getParcelable(PreviewAudioFragment.EXTRA_ACCOUNT);
        mSavedPlaybackPosition = savedInstanceState.getInt(PreviewAudioFragment.EXTRA_PLAY_POSITION);
        mAutoplay = savedInstanceState.getBoolean(PreviewAudioFragment.EXTRA_PLAYING);
    }
    if (file == null) {
        throw new IllegalStateException("Instanced with a NULL OCFile");
    }
    if (mAccount == null) {
        throw new IllegalStateException("Instanced with a NULL ownCloud Account");
    }
    if (!file.isDown()) {
        throw new IllegalStateException("There is no local file to preview");
    }
    if (!file.isAudio()) {
        throw new IllegalStateException("Not an audio file");
    }
    extractAndSetCoverArt(file);
    mProgressController = new TransferProgressController(mContainerActivity);
    mProgressController.setProgressBar(mProgressBar);
}
Also used : OCFile(com.owncloud.android.datamodel.OCFile) TransferProgressController(com.owncloud.android.ui.controller.TransferProgressController) Bundle(android.os.Bundle)

Example 2 with TransferProgressController

use of com.owncloud.android.ui.controller.TransferProgressController in project android by owncloud.

the class PreviewImageFragment method onActivityCreated.

/**
     * {@inheritDoc}
     */
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    mProgressController = new TransferProgressController(mContainerActivity);
    mProgressController.setProgressBar(mProgressBar);
    mProgressController.hideProgressBar();
    if (savedInstanceState != null) {
        if (!mIgnoreFirstSavedState) {
            OCFile file = savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_FILE);
            setFile(file);
        } else {
            mIgnoreFirstSavedState = false;
        }
    }
    mAccount = getArguments().getParcelable(PreviewAudioFragment.EXTRA_ACCOUNT);
    if (mAccount == null) {
        throw new IllegalStateException("Instanced with a NULL ownCloud Account");
    }
    if (getFile() == null) {
        throw new IllegalStateException("Instanced with a NULL OCFile");
    }
    if (!getFile().isDown()) {
        throw new IllegalStateException("There is no local file to preview");
    }
}
Also used : OCFile(com.owncloud.android.datamodel.OCFile) TransferProgressController(com.owncloud.android.ui.controller.TransferProgressController)

Example 3 with TransferProgressController

use of com.owncloud.android.ui.controller.TransferProgressController in project android by owncloud.

the class PreviewTextFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedState) {
    super.onActivityCreated(savedState);
    mProgressController = new TransferProgressController(mContainerActivity);
    mProgressController.setProgressBar(mProgressBar);
}
Also used : TransferProgressController(com.owncloud.android.ui.controller.TransferProgressController)

Example 4 with TransferProgressController

use of com.owncloud.android.ui.controller.TransferProgressController in project android by owncloud.

the class FileDetailFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setHasOptionsMenu(true);
    mProgressController = new TransferProgressController((ComponentsGetter) getActivity());
    ProgressBar progressBar = (ProgressBar) mView.findViewById(R.id.fdProgressBar);
    DisplayUtils.colorPreLollipopHorizontalProgressBar(progressBar);
    mProgressController.setProgressBar(progressBar);
}
Also used : ComponentsGetter(com.owncloud.android.ui.activity.ComponentsGetter) TransferProgressController(com.owncloud.android.ui.controller.TransferProgressController) ProgressBar(android.widget.ProgressBar)

Example 5 with TransferProgressController

use of com.owncloud.android.ui.controller.TransferProgressController in project android by owncloud.

the class FileDownloadFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedState) {
    super.onActivityCreated(savedState);
    mProgressController = new TransferProgressController(mContainerActivity);
    mProgressController.setProgressBar(mProgressBar);
}
Also used : TransferProgressController(com.owncloud.android.ui.controller.TransferProgressController)

Aggregations

TransferProgressController (com.owncloud.android.ui.controller.TransferProgressController)6 OCFile (com.owncloud.android.datamodel.OCFile)3 Bundle (android.os.Bundle)2 ProgressBar (android.widget.ProgressBar)1 ComponentsGetter (com.owncloud.android.ui.activity.ComponentsGetter)1