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);
}
}
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");
}
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");
}
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;
}
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");
}
Aggregations