diff options
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus')
2 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/UserDecisionDialog.java b/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/UserDecisionDialog.java index 2d919528..c29832a5 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/UserDecisionDialog.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/UserDecisionDialog.java @@ -11,20 +11,21 @@ import de.thedevstack.conversationsplus.ui.listeners.UserDecisionListener; import eu.siacs.conversations.R; /** - * Created by tzur on 31.10.2015. + * A dialog to give the user the choice to decide whether to do something or not. + * The user also has the choice to save his answer for the future. + * A UserDecisionListener is used to provide the functionality to be performed by clicking on yes, or no. */ public class UserDecisionDialog extends AbstractAlertDialog { protected final UserDecisionListener listener; protected final CheckBox rememberCheckBox; public UserDecisionDialog(Activity context, int questionResourceId, UserDecisionListener userDecisionListener) { - super(context, "User Decision"); + super(context, questionResourceId); this.listener = userDecisionListener; int viewId = R.layout.dialog_userdecision; View view = context.getLayoutInflater().inflate(viewId, null); - ((TextView)view.findViewById(R.id.dlgUserDecQuestion)).setText(questionResourceId); this.rememberCheckBox = (CheckBox) view.findViewById(R.id.dlgUserDecRemember); this.setPositiveButton(R.string.cplus_yes, new PositiveOnClickListener()); diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ResizePictureUserDecisionListener.java b/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ResizePictureUserDecisionListener.java index 3436d322..bc74f39b 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ResizePictureUserDecisionListener.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ResizePictureUserDecisionListener.java @@ -18,6 +18,8 @@ import de.thedevstack.conversationsplus.exceptions.UiException; import de.thedevstack.conversationsplus.utils.FileHelper; import de.thedevstack.conversationsplus.utils.ImageUtil; import de.thedevstack.conversationsplus.utils.MessageUtil; +import de.thedevstack.conversationsplus.utils.StreamUtil; + import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.DownloadableFile; @@ -146,7 +148,7 @@ public class ResizePictureUserDecisionListener implements UserDecisionListener { public void run() { InputStream is = null; try { - is = ConversationsPlusApplication.getInstance().getContentResolver().openInputStream(uri); + is = StreamUtil.openInputStreamFromContentResolver(uri); long imageSize = is.available(); BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; |