Search in sources :

Example 61 with DialogFragment

use of android.support.v4.app.DialogFragment in project android-advancedrecyclerview by h6ah4i.

the class ExpandableDraggableSwipeableExampleActivity method onChildItemPinned.

/**
     * This method will be called when a child item is pinned
     *
     * @param groupPosition The group position of the child item within data set
     * @param childPosition The position of the child item within the group
     */
public void onChildItemPinned(int groupPosition, int childPosition) {
    final DialogFragment dialog = ExpandableItemPinnedMessageDialogFragment.newInstance(groupPosition, childPosition);
    getSupportFragmentManager().beginTransaction().add(dialog, FRAGMENT_TAG_ITEM_PINNED_DIALOG).commit();
}
Also used : ExpandableItemPinnedMessageDialogFragment(com.h6ah4i.android.example.advrecyclerview.common.fragment.ExpandableItemPinnedMessageDialogFragment) DialogFragment(android.support.v4.app.DialogFragment)

Example 62 with DialogFragment

use of android.support.v4.app.DialogFragment in project android-advancedrecyclerview by h6ah4i.

the class ExpandableDraggableSwipeableExampleActivity method onGroupItemPinned.

/**
     * This method will be called when a group item is pinned
     *
     * @param groupPosition The position of the group item within data set
     */
public void onGroupItemPinned(int groupPosition) {
    final DialogFragment dialog = ExpandableItemPinnedMessageDialogFragment.newInstance(groupPosition, RecyclerView.NO_POSITION);
    getSupportFragmentManager().beginTransaction().add(dialog, FRAGMENT_TAG_ITEM_PINNED_DIALOG).commit();
}
Also used : ExpandableItemPinnedMessageDialogFragment(com.h6ah4i.android.example.advrecyclerview.common.fragment.ExpandableItemPinnedMessageDialogFragment) DialogFragment(android.support.v4.app.DialogFragment)

Example 63 with DialogFragment

use of android.support.v4.app.DialogFragment in project android-advancedrecyclerview by h6ah4i.

the class VerticalSwipeableExampleActivity method onItemPinned.

/**
     * This method will be called when a list item is pinned
     *
     * @param position The position of the item within data set
     */
public void onItemPinned(int position) {
    final DialogFragment dialog = ItemPinnedMessageDialogFragment.newInstance(position);
    getSupportFragmentManager().beginTransaction().add(dialog, FRAGMENT_TAG_ITEM_PINNED_DIALOG).commit();
}
Also used : ItemPinnedMessageDialogFragment(com.h6ah4i.android.example.advrecyclerview.common.fragment.ItemPinnedMessageDialogFragment) DialogFragment(android.support.v4.app.DialogFragment)

Example 64 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 65 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)

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