From: David A. Velasco Date: Thu, 12 Jul 2012 08:55:47 +0000 (+0200) Subject: Fixed confirmation dialog for deletion X-Git-Tag: oc-android-1.4.3~284 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/8b24606331b944e962650d7d6f283c881b8a541c?ds=sidebyside;hp=--cc Fixed confirmation dialog for deletion --- 8b24606331b944e962650d7d6f283c881b8a541c diff --git a/res/values/strings.xml b/res/values/strings.xml index e4a24837..ca3eb892 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -122,6 +122,6 @@ Rename Remove - Do you really want + "Do you really want " "?" diff --git a/src/eu/alefzero/owncloud/ui/fragment/ConfirmationDialogFragment.java b/src/eu/alefzero/owncloud/ui/fragment/ConfirmationDialogFragment.java index c323a694..a5098606 100644 --- a/src/eu/alefzero/owncloud/ui/fragment/ConfirmationDialogFragment.java +++ b/src/eu/alefzero/owncloud/ui/fragment/ConfirmationDialogFragment.java @@ -29,11 +29,13 @@ public class ConfirmationDialogFragment extends SherlockDialogFragment { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { - int confirmationTarget = getArguments().getInt(ARG_CONF_TARGET); + String confirmationTarget = getArguments().getString(ARG_CONF_TARGET); + if (confirmationTarget == null) + confirmationTarget = ""; return new AlertDialog.Builder(getActivity()) .setIcon(android.R.drawable.ic_dialog_alert) - .setMessage(R.string.confirmation_alert_prefix + confirmationTarget + R.string.confirmation_alert_suffix ) + .setMessage(getString(R.string.confirmation_alert_prefix) + confirmationTarget + getString(R.string.confirmation_alert_suffix)) .setPositiveButton(R.string.common_ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { diff --git a/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java b/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java index dca06c76..381d4d84 100644 --- a/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java +++ b/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java @@ -157,6 +157,13 @@ public class FileDetailFragment extends SherlockFragment implements view = inflater.inflate(mLayout, container, false); mView = view; + if (mLayout == R.layout.file_details_fragment) { + getView().findViewById(R.id.fdKeepInSync).setOnClickListener(this); + //getView().findViewById(R.id.fdShareBtn).setOnClickListener(this); + getView().findViewById(R.id.fdRenameBtn).setOnClickListener(this); + getView().findViewById(R.id.fdRemoveBtn).setOnClickListener(this); + } + updateFileDetails(); return view; } @@ -226,7 +233,7 @@ public class FileDetailFragment extends SherlockFragment implements break; } case R.id.fdRemoveBtn: { - ConfirmationDialogFragment confDialog = ConfirmationDialogFragment.newInstance("remove " + mFile.getFileName()); + ConfirmationDialogFragment confDialog = ConfirmationDialogFragment.newInstance("to remove " + mFile.getFileName()); confDialog.setOnConfirmationListener(this); confDialog.show(getFragmentManager(), "REMOVE_CONFIRMATION_FRAGMENT"); break; @@ -301,9 +308,6 @@ public class FileDetailFragment extends SherlockFragment implements CheckBox cb = (CheckBox)getView().findViewById(R.id.fdKeepInSync); cb.setChecked(mFile.keepInSync()); - cb.setOnClickListener(this); - //getView().findViewById(R.id.fdShareBtn).setOnClickListener(this); - getView().findViewById(R.id.fdRenameBtn).setOnClickListener(this); if (mFile.getStoragePath() != null) { // Update preview