use of android.app.DialogFragment in project FluxyAndroidTodo by armueller.
the class TodoListArrayAdapter method setHolderListeners.
private void setHolderListeners(final ViewHolder holder, final TodoItem item) {
holder.todoDescription.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
DialogFragment editOrDeleteDialog = new EditOrDeleteDialogFragment();
Bundle args = new Bundle();
args.putLong("todoItemId", item.getId());
editOrDeleteDialog.setArguments(args);
editOrDeleteDialog.show(activity.getFragmentManager(), String.valueOf(item.getId()));
return true;
}
});
holder.todoEditDescription.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
boolean handled = false;
if (actionId == EditorInfo.IME_ACTION_DONE) {
actionCreator.createEditTodoAction(item.getId(), v.getText().toString());
handled = true;
}
return handled;
}
});
holder.todoCheckBox.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
actionCreator.createToggleTodoCompleteAction(item.getId());
}
});
}
use of android.app.DialogFragment in project Fairphone by Kwamecorp.
the class WallpaperChooser method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.wallpaper_chooser_base);
Fragment fragmentView = getFragmentManager().findFragmentById(R.id.wallpaper_chooser_fragment);
// needs to be revived again.
if (fragmentView == null) {
/* When the screen is XLarge, the fragment is not included in the layout, so show it
* as a dialog
*/
DialogFragment fragment = WallpaperChooserDialogFragment.newInstance();
fragment.show(getFragmentManager(), "dialog");
}
}
use of android.app.DialogFragment in project Aegis by Decad3nce.
the class AdvancedSettingsFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.advanced_preferences);
final Preference removeAdmin = findPreference("remove_admin");
final Preference installToSystem = findPreference("install_to_system");
final DevicePolicyManager mDPM = (DevicePolicyManager) getActivity().getSystemService(Context.DEVICE_POLICY_SERVICE);
if (mDPM.getActiveAdmins() == null || !mDPM.isAdminActive(AegisActivity.DEVICE_ADMIN_COMPONENT)) {
PreferenceCategory mCategory = (PreferenceCategory) findPreference("advanced_category");
mCategory.removePreference(removeAdmin);
}
Preference.OnPreferenceClickListener preferenceListener = (new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
if (preference.getKey().equals(ADVANCED_PREFERENCES_REMOVE_ADMIN)) {
if (mDPM.isAdminActive(AegisActivity.DEVICE_ADMIN_COMPONENT)) {
removeAdmin(mDPM, removeAdmin);
}
}
if (preference.getKey().equals(ADVANCED_PREFERENCES_INSTALL_TO_SYSTEM)) {
DialogFragment dialog = new InstallToSystemDialogFragment();
dialog.show(getActivity().getFragmentManager(), "InstallToSystemDialogFragment");
}
return false;
}
});
removeAdmin.setOnPreferenceClickListener(preferenceListener);
installToSystem.setOnPreferenceClickListener(preferenceListener);
}
use of android.app.DialogFragment in project Aegis by Decad3nce.
the class BackupGoogleAccountsActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.backup_layout);
progressBar = (ProgressBar) findViewById(R.id.progressBar);
progressBar.setVisibility(View.VISIBLE);
context = this;
Intent intent;
cr = getContentResolver();
credential = GoogleAccountCredential.usingOAuth2(this, DriveScopes.DRIVE);
try {
intent = getIntent();
if (intent.hasExtra("fromReceiver")) {
address = intent.getStringExtra("fromReceiver");
Log.i(TAG, "Backup intent from receiver");
recoverData();
} else {
Log.i(TAG, "Backup intent from elsewhere");
DialogFragment dialog = new BackupAccountsDialogFragment();
dialog.show(getFragmentManager(), "BackupAccountsDialogFragment");
}
} catch (Exception e) {
recoverData();
}
}
use of android.app.DialogFragment in project NotificationPeekPort by lzanita09.
the class DialogHelper method showHelpDialog.
public static void showHelpDialog(Activity activity) {
FragmentManager fm = activity.getFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
((DialogFragment) Fragment.instantiate(activity, HelpDialogFragment.class.getName())).show(ft, ABOUT_DIALOG_TAG);
}
Aggregations