Search in sources :

Example 26 with Fragment

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

the class FullScannerActivity method closeDialog.

public void closeDialog(String dialogName) {
    FragmentManager fragmentManager = 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 27 with Fragment

use of android.support.v4.app.Fragment 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 28 with Fragment

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

the class FullScannerActivity method closeDialog.

public void closeDialog(String dialogName) {
    FragmentManager fragmentManager = 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 29 with Fragment

use of android.support.v4.app.Fragment 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 30 with Fragment

use of android.support.v4.app.Fragment 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)

Aggregations

Fragment (android.support.v4.app.Fragment)617 FragmentTransaction (android.support.v4.app.FragmentTransaction)220 Bundle (android.os.Bundle)140 View (android.view.View)129 FragmentManager (android.support.v4.app.FragmentManager)115 DialogFragment (android.support.v4.app.DialogFragment)77 TextView (android.widget.TextView)55 FragmentInstruction (de.madcyph3r.example.example.FragmentInstruction)48 MaterialMenu (de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu)48 MaterialItemSectionFragment (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment)48 FragmentDummy (de.madcyph3r.example.example.FragmentDummy)43 Intent (android.content.Intent)39 ViewPager (android.support.v4.view.ViewPager)35 FragmentActivity (android.support.v4.app.FragmentActivity)34 BaseFragment (com.waz.zclient.pages.BaseFragment)29 ImageView (android.widget.ImageView)27 FragmentPagerAdapter (android.support.v4.app.FragmentPagerAdapter)25 Button (android.widget.Button)24 ArrayList (java.util.ArrayList)24 FragmentStatePagerAdapter (android.support.v4.app.FragmentStatePagerAdapter)21