Search in sources :

Example 6 with DialogFragment

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

the class FullScannerActivity 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(getSupportFragmentManager(), "format_selector");
            return true;
        case R.id.menu_camera_selector:
            mScannerView.stopCamera();
            DialogFragment cFragment = CameraSelectorDialogFragment.newInstance(this, mCameraId);
            cFragment.show(getSupportFragmentManager(), "camera_selector");
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }
}
Also used : DialogFragment(android.support.v4.app.DialogFragment)

Example 7 with DialogFragment

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

the class FullScannerActivity method showMessageDialog.

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

Example 8 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 9 with DialogFragment

use of android.support.v4.app.DialogFragment in project SeriesGuide by UweTrottmann.

the class CloudSetupFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_cloud_setup, container, false);
    textViewDescription = (TextView) v.findViewById(R.id.textViewCloudDescription);
    textViewUsername = ButterKnife.findById(v, R.id.textViewCloudUsername);
    textViewWarning = ButterKnife.findById(v, R.id.textViewCloudWarnings);
    progressBar = (ProgressBar) v.findViewById(R.id.progressBarCloud);
    buttonAction = (Button) v.findViewById(R.id.buttonCloudAction);
    buttonRemoveAccount = ButterKnife.findById(v, R.id.buttonCloudRemoveAccount);
    buttonRemoveAccount.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            setProgressVisible(true);
            DialogFragment f = new RemoveCloudAccountDialogFragment();
            f.show(getFragmentManager(), "remove-cloud-account");
        }
    });
    updateViews();
    setProgressVisible(true);
    return v;
}
Also used : DialogFragment(android.support.v4.app.DialogFragment) RemoveCloudAccountDialogFragment(com.battlelancer.seriesguide.ui.dialogs.RemoveCloudAccountDialogFragment) RemoveCloudAccountDialogFragment(com.battlelancer.seriesguide.ui.dialogs.RemoveCloudAccountDialogFragment) View(android.view.View) TextView(android.widget.TextView)

Example 10 with DialogFragment

use of android.support.v4.app.DialogFragment in project SeriesGuide by UweTrottmann.

the class AddListDialogFragment method showAddListDialog.

/**
     * Display a dialog which allows to edit the title of this list or remove it.
     */
public static void showAddListDialog(FragmentManager fm) {
    // DialogFragment.show() will take care of adding the fragment
    // in a transaction. We also want to remove any currently showing
    // dialog, so make our own transaction and take care of that here.
    FragmentTransaction ft = fm.beginTransaction();
    Fragment prev = fm.findFragmentByTag("addlistdialog");
    if (prev != null) {
        ft.remove(prev);
    }
    ft.addToBackStack(null);
    // Create and show the dialog.
    DialogFragment newFragment = AddListDialogFragment.newInstance();
    newFragment.show(ft, "addlistdialog");
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) AppCompatDialogFragment(android.support.v7.app.AppCompatDialogFragment) DialogFragment(android.support.v4.app.DialogFragment) AppCompatDialogFragment(android.support.v7.app.AppCompatDialogFragment) DialogFragment(android.support.v4.app.DialogFragment) Fragment(android.support.v4.app.Fragment)

Aggregations

DialogFragment (android.support.v4.app.DialogFragment)73 Fragment (android.support.v4.app.Fragment)29 FragmentTransaction (android.support.v4.app.FragmentTransaction)21 FragmentManager (android.support.v4.app.FragmentManager)9 Bundle (android.os.Bundle)8 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