Search in sources :

Example 6 with ProgressDialogFragment

use of com.wada811.android.dialogfragments.traditional.ProgressDialogFragment in project Android-DialogFragments by wada811.

the class LoaderSpinnerProgressDialogFragmentExamplesFragment method onLoaderReset.

@Override
public void onLoaderReset(Loader<Object> objectLoader) {
    Log.i(TAG, "onLoaderReset");
    getLoaderManager().destroyLoader(objectLoader.getId());
    Fragment fragment = getChildFragmentManager().findFragmentByTag(ProgressDialogFragment.TAG);
    if (fragment != null) {
        ProgressDialogFragment dialogFragment = (ProgressDialogFragment) fragment;
        dialogFragment.dismissAllowingStateLoss();
    }
}
Also used : ProgressDialogFragment(com.wada811.android.dialogfragments.traditional.ProgressDialogFragment) Fragment(android.support.v4.app.Fragment) ListFragment(android.support.v4.app.ListFragment) ProgressDialogFragment(com.wada811.android.dialogfragments.traditional.ProgressDialogFragment)

Example 7 with ProgressDialogFragment

use of com.wada811.android.dialogfragments.traditional.ProgressDialogFragment in project Android-DialogFragments by wada811.

the class LoaderSpinnerProgressDialogFragmentExamplesFragment method onLoadFinished.

@Override
public void onLoadFinished(Loader<Object> objectLoader, Object o) {
    Log.i(TAG, "onLoadFinished");
    getLoaderManager().destroyLoader(objectLoader.getId());
    Fragment fragment = getChildFragmentManager().findFragmentByTag(ProgressDialogFragment.TAG);
    if (fragment != null) {
        ProgressDialogFragment dialogFragment = (ProgressDialogFragment) fragment;
        dialogFragment.dismissAllowingStateLoss();
    }
}
Also used : ProgressDialogFragment(com.wada811.android.dialogfragments.traditional.ProgressDialogFragment) Fragment(android.support.v4.app.Fragment) ListFragment(android.support.v4.app.ListFragment) ProgressDialogFragment(com.wada811.android.dialogfragments.traditional.ProgressDialogFragment)

Example 8 with ProgressDialogFragment

use of com.wada811.android.dialogfragments.traditional.ProgressDialogFragment in project Android-DialogFragments by wada811.

the class LoaderSpinnerProgressDialogFragmentExamplesFragment method onCreateLoader.

@Override
public Loader<Object> onCreateLoader(int i, Bundle bundle) {
    Log.i(TAG, "onCreateLoader");
    ProgressDialogFragment dialogFragment = new ProgressDialogFragment();
    dialogFragment.setIcon(R.drawable.ic_launcher);
    dialogFragment.setTitle(R.string.title_activity_progress_dialog_fragment_with_loader_in_fragment);
    dialogFragment.setProgressStyle(ProgressDialogFragment.STYLE_SPINNER);
    dialogFragment.setMessage("Loading...");
    dialogFragment.setOnCancelListener(this);
    dialogFragment.show(getChildFragmentManager(), ProgressDialogFragment.TAG);
    return new AsyncSleepLoader(getActivity());
}
Also used : AsyncSleepLoader(com.wada811.android.dialogfragments.sample.progressdialogfragment.examples.AsyncSleepLoader) ProgressDialogFragment(com.wada811.android.dialogfragments.traditional.ProgressDialogFragment)

Example 9 with ProgressDialogFragment

use of com.wada811.android.dialogfragments.traditional.ProgressDialogFragment in project Android-DialogFragments by wada811.

the class LoaderSpinnerProgressDialogFragmentExamplesActivity method onCreateLoader.

@Override
public Loader<Object> onCreateLoader(int i, Bundle bundle) {
    Log.i(TAG, "onCreateLoader");
    ProgressDialogFragment dialogFragment = new ProgressDialogFragment();
    dialogFragment.setIcon(R.drawable.ic_launcher);
    dialogFragment.setTitle(R.string.title_activity_progress_dialog_fragment_with_loader_in_activity);
    dialogFragment.setProgressStyle(ProgressDialogFragment.STYLE_SPINNER);
    dialogFragment.setMessage("Loading...");
    dialogFragment.setIndeterminate(true);
    dialogFragment.setOnCancelListener(this);
    dialogFragment.show(getSupportFragmentManager(), ProgressDialogFragment.TAG);
    return new AsyncSleepLoader(this);
}
Also used : AsyncSleepLoader(com.wada811.android.dialogfragments.sample.progressdialogfragment.examples.AsyncSleepLoader) ProgressDialogFragment(com.wada811.android.dialogfragments.material.ProgressDialogFragment)

Example 10 with ProgressDialogFragment

use of com.wada811.android.dialogfragments.traditional.ProgressDialogFragment in project Android-DialogFragments by wada811.

the class LoaderSpinnerProgressDialogFragmentExamplesFragment method onLoaderReset.

@Override
public void onLoaderReset(Loader<Object> objectLoader) {
    Log.i(TAG, "onLoaderReset");
    getLoaderManager().destroyLoader(objectLoader.getId());
    Fragment fragment = getChildFragmentManager().findFragmentByTag(ProgressDialogFragment.TAG);
    if (fragment != null) {
        ProgressDialogFragment dialogFragment = (ProgressDialogFragment) fragment;
        dialogFragment.dismissAllowingStateLoss();
    }
}
Also used : ProgressDialogFragment(com.wada811.android.dialogfragments.material.ProgressDialogFragment) ProgressDialogFragment(com.wada811.android.dialogfragments.material.ProgressDialogFragment) Fragment(android.support.v4.app.Fragment) ListFragment(android.support.v4.app.ListFragment)

Aggregations

Fragment (android.support.v4.app.Fragment)8 ProgressDialogFragment (com.wada811.android.dialogfragments.material.ProgressDialogFragment)6 ProgressDialogFragment (com.wada811.android.dialogfragments.traditional.ProgressDialogFragment)6 ListFragment (android.support.v4.app.ListFragment)4 AsyncSleepLoader (com.wada811.android.dialogfragments.sample.progressdialogfragment.examples.AsyncSleepLoader)4