Search in sources :

Example 66 with DialogFragment

use of android.support.v4.app.DialogFragment in project barcodescanner by dm77.

the class FullScannerFragment method closeDialog.

public void closeDialog(String dialogName) {
    FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
    DialogFragment fragment = (DialogFragment) fragmentManager.findFragmentByTag(dialogName);
    if (fragment != null) {
        fragment.dismiss();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) DialogFragment(android.support.v4.app.DialogFragment)

Example 67 with DialogFragment

use of android.support.v4.app.DialogFragment in project barcodescanner by dm77.

the class FullScannerFragment method onOptionsItemSelected.

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle presses on the action bar items
    switch(item.getItemId()) {
        case R.id.menu_flash:
            mFlash = !mFlash;
            if (mFlash) {
                item.setTitle(R.string.flash_on);
            } else {
                item.setTitle(R.string.flash_off);
            }
            mScannerView.setFlash(mFlash);
            return true;
        case R.id.menu_auto_focus:
            mAutoFocus = !mAutoFocus;
            if (mAutoFocus) {
                item.setTitle(R.string.auto_focus_on);
            } else {
                item.setTitle(R.string.auto_focus_off);
            }
            mScannerView.setAutoFocus(mAutoFocus);
            return true;
        case R.id.menu_formats:
            DialogFragment fragment = FormatSelectorDialogFragment.newInstance(this, mSelectedIndices);
            fragment.show(getActivity().getSupportFragmentManager(), "format_selector");
            return true;
        case R.id.menu_camera_selector:
            mScannerView.stopCamera();
            DialogFragment cFragment = CameraSelectorDialogFragment.newInstance(this, mCameraId);
            cFragment.show(getActivity().getSupportFragmentManager(), "camera_selector");
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }
}
Also used : DialogFragment(android.support.v4.app.DialogFragment)

Example 68 with DialogFragment

use of android.support.v4.app.DialogFragment in project barcodescanner by dm77.

the class FullScannerFragment method showMessageDialog.

public void showMessageDialog(String message) {
    DialogFragment fragment = MessageDialogFragment.newInstance("Scan Results", message, this);
    fragment.show(getActivity().getSupportFragmentManager(), "scan_results");
}
Also used : DialogFragment(android.support.v4.app.DialogFragment)

Example 69 with DialogFragment

use of android.support.v4.app.DialogFragment in project SimplifyReader by chentao0707.

the class YoukuBasePlayerActivity method showDialog.

public void showDialog() {
    DialogFragment newFragment = PasswordInputDialog.newInstance(R.string.player_error_dialog_password_required);
    newFragment.show(getSupportFragmentManager(), "dialog");
}
Also used : DialogFragment(android.support.v4.app.DialogFragment)

Example 70 with DialogFragment

use of android.support.v4.app.DialogFragment in project glimmr by brk3.

the class GroupListFragment method onLongClickDialogSelection.

@Override
public void onLongClickDialogSelection(Group group, int which) {
    Log.d(TAG, "onLongClickDialogSelection()");
    FragmentTransaction ft = mActivity.getSupportFragmentManager().beginTransaction();
    ft.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
    if (group != null) {
        Fragment prev = mActivity.getSupportFragmentManager().findFragmentByTag(AddToGroupDialogFragment.TAG);
        if (prev != null) {
            ft.remove(prev);
        }
        ft.addToBackStack(null);
        DialogFragment newFragment = AddToGroupDialogFragment.newInstance(group);
        newFragment.show(ft, AddToGroupDialogFragment.TAG);
    } else {
        Log.e(TAG, "onLongClickDialogSelection: group is null");
    }
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) DialogFragment(android.support.v4.app.DialogFragment) AddToGroupDialogFragment(com.bourke.glimmr.fragments.group.AddToGroupDialogFragment) DialogFragment(android.support.v4.app.DialogFragment) Fragment(android.support.v4.app.Fragment) AddToGroupDialogFragment(com.bourke.glimmr.fragments.group.AddToGroupDialogFragment) BaseFragment(com.bourke.glimmr.fragments.base.BaseFragment)

Aggregations

DialogFragment (android.support.v4.app.DialogFragment)85 Fragment (android.support.v4.app.Fragment)31 FragmentTransaction (android.support.v4.app.FragmentTransaction)24 Bundle (android.os.Bundle)10 FragmentManager (android.support.v4.app.FragmentManager)9 View (android.view.View)8 SherlockDialogFragment (com.actionbarsherlock.app.SherlockDialogFragment)8 TextView (android.widget.TextView)7 AlertDialog (android.app.AlertDialog)5 DialogInterface (android.content.DialogInterface)4 OnClickListener (android.content.DialogInterface.OnClickListener)4 Intent (android.content.Intent)4 ListFragment (android.support.v4.app.ListFragment)4 AppCompatDialogFragment (android.support.v7.app.AppCompatDialogFragment)4 OnClickListener (android.view.View.OnClickListener)4 Button (android.widget.Button)4 ItemPinnedMessageDialogFragment (com.h6ah4i.android.example.advrecyclerview.common.fragment.ItemPinnedMessageDialogFragment)4 ProgressDialogFragment (com.wada811.android.dialogfragments.material.ProgressDialogFragment)4 Dialog (android.app.Dialog)3 ProgressDialogFragment (com.wada811.android.dialogfragments.traditional.ProgressDialogFragment)3