From 58ddfef266c15983850fee500511bc63f65bb53b Mon Sep 17 00:00:00 2001 From: steckbrief Date: Thu, 10 Mar 2016 21:13:59 +0100 Subject: Fixes FS#158: user decision dialog heading configurable and translateable --- .../conversationsplus/ui/dialogs/UserDecisionDialog.java | 7 ++++--- .../ui/listeners/ResizePictureUserDecisionListener.java | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/main/java/de/thedevstack/conversationsplus/ui') 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 72d9d904..25349b2d 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 de.thedevstack.conversationsplus.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 1b4c7802..5ab8feb2 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ResizePictureUserDecisionListener.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ResizePictureUserDecisionListener.java @@ -26,6 +26,7 @@ import de.thedevstack.conversationsplus.persistance.FileBackend; import de.thedevstack.conversationsplus.services.XmppConnectionService; import de.thedevstack.conversationsplus.ui.UiCallback; import de.thedevstack.conversationsplus.ui.XmppActivity; +import de.thedevstack.conversationsplus.utils.StreamUtil; /** * Created by tzur on 31.10.2015. @@ -146,7 +147,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; -- cgit v1.2.3 From 27c9c0aa21e3ec1a5801f6c3279caf0cd4fe9248 Mon Sep 17 00:00:00 2001 From: steckbrief Date: Thu, 10 Mar 2016 22:54:13 +0100 Subject: Fixes FS#157: Trigger loading messages from MAM in MUC does not end --- .../ui/listeners/ConversationSwipeRefreshListener.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/main/java/de/thedevstack/conversationsplus/ui') diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationSwipeRefreshListener.java b/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationSwipeRefreshListener.java index 5076da28..dede54ca 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationSwipeRefreshListener.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationSwipeRefreshListener.java @@ -52,10 +52,9 @@ public class ConversationSwipeRefreshListener implements SwipyRefreshLayout.OnRe long lastSessionEstablished = this.getTimestampOfLastSessionEstablished(activity.getSelectedConversation()); long lastReceivedMessage = this.getTimestampOfLastReceivedOrTransmittedMessage(); long startTimestamp = Math.min(lastSessionEstablished, lastReceivedMessage); - MessageArchiveService.Query query = activity.xmppConnectionService.getMessageArchiveService().query(activity.getSelectedConversation(), startTimestamp, System.currentTimeMillis()); + MessageArchiveService.Query query = activity.xmppConnectionService.getMessageArchiveService().query(activity.getSelectedConversation(), startTimestamp, System.currentTimeMillis(), this.listener); if (query != null) { this.listener.setLoadHistory(false); - query.setCallback(this.listener); } else { Logging.d("mam", "no query built - no messages loaded"); this.listener.onMoreMessagesLoaded(0, activity.getSelectedConversation()); -- cgit v1.2.3