@Override public void onClick( DialogInterface dialogInterface, int i) { Bundle args = new Bundle(); args.putString(ImportLocalRepoDialog.FROM_PATH, path); ImportLocalRepoDialog rld = new ImportLocalRepoDialog(); rld.setArguments(args); rld.show(getFragmentManager(), "import-local-dialog"); } });
if (!mImportAsExternal.isChecked()) { if (localPath.equals("")) { showToastMessage(R.string.alert_field_not_empty); mLocalPath.setError(getString(R.string.alert_field_not_empty)); return; showToastMessage(R.string.alert_localpath_format); mLocalPath.setError(getString(R.string.alert_localpath_format)); return; showToastMessage(R.string.alert_file_exists); mLocalPath.setError(getString(R.string.alert_file_exists)); return; final Repo repo = Repo.importRepo(localPath, getString(R.string.importing)); updateRepoInformation(repo); dismiss(); return; dismiss();
super.onCreateDialog(savedInstanceState); mActivity = getActivity(); Bundle args = getArguments(); if (args != null && args.containsKey(FROM_PATH)) { mFromPath = args.getString(FROM_PATH); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(getString(R.string.dialog_import_set_local_repo_title)); View view = getActivity().getLayoutInflater().inflate( R.layout.dialog_import_repo, null);
@Override public void onStart() { super.onStart(); AlertDialog dialog = (AlertDialog) getDialog(); if (dialog == null) return; Button positiveButton = (Button) dialog .getButton(Dialog.BUTTON_POSITIVE); positiveButton.setOnClickListener(this); }
if (!mImportAsExternal.isChecked()) { if (localPath.equals("")) { showToastMessage(R.string.alert_field_not_empty); mLocalPath.setError(getString(R.string.alert_field_not_empty)); return; showToastMessage(R.string.alert_localpath_format); mLocalPath.setError(getString(R.string.alert_localpath_format)); return; File file = Repo.getDir(getActivity(), localPath); showToastMessage(R.string.alert_file_exists); mLocalPath.setError(getString(R.string.alert_file_exists)); return; updateRepoInformation(id); dismiss(); return; final File repoFile = Repo.getDir(getActivity(), localPath); Thread thread = new Thread(new Runnable() { @Override dismiss();
super.onCreateDialog(savedInstanceState); mActivity = getActivity(); Bundle args = getArguments(); if (args != null && args.containsKey(FROM_PATH)) { mFromPath = args.getString(FROM_PATH); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(getString(R.string.dialog_import_set_local_repo_title)); View view = getActivity().getLayoutInflater().inflate( R.layout.dialog_import_repo, null);
@Override public void onStart() { super.onStart(); AlertDialog dialog = (AlertDialog) getDialog(); if (dialog == null) return; Button positiveButton = (Button) dialog .getButton(Dialog.BUTTON_POSITIVE); positiveButton.setOnClickListener(this); }
@Override public void onClick( DialogInterface dialogInterface, int i) { Bundle args = new Bundle(); args.putString(ImportLocalRepoDialog.FROM_PATH, path); ImportLocalRepoDialog rld = new ImportLocalRepoDialog(); rld.setArguments(args); rld.show(getSupportFragmentManager(), "import-local-dialog"); } });