diff options
author | steckbrief <steckbrief@chefmail.de> | 2015-08-11 15:29:30 +0200 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2015-08-11 15:29:30 +0200 |
commit | a1a09ff057ed9aa0e29be588c53d33355d4d6ec4 (patch) | |
tree | 58e3f4f39c4524250c6fabf5fb8f7c1479b42aed | |
parent | eac4bf7d902dc2579983daa29bcb74ca14790de6 (diff) |
Compile Clean after mergetrz/merge_1.5.2
9 files changed, 174 insertions, 190 deletions
diff --git a/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java b/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java index 101d44bb..4a4d3f03 100644 --- a/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java +++ b/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java @@ -63,7 +63,6 @@ public class PgpEngine { && message.treatAsDownloadable() != Message.Decision.NEVER && Settings.DOWNLOAD_IMAGE_LINKS && mXmppConnectionService.isDownloadAllowedInConnection() - && message.bodyContainsDownloadable() && manager.getAutoAcceptFileSize() > 0) { manager.createNewDownloadConnection(message); } diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index c2b04722..27bc502a 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -2218,6 +2218,9 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa public boolean forceEncryption() { return getPreferences().getBoolean("force_encryption", false); } + public boolean confirmMessages() { + return getPreferences().getBoolean("confirm_messages", true); + } public boolean sendChatStates() { return getPreferences().getBoolean("chat_states", false); diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index db4fd712..bb5f0381 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -188,64 +188,64 @@ public class ConversationActivity extends XmppActivity listView.setDismissCallback(new EnhancedListView.OnDismissCallback() { - @Override - public EnhancedListView.Undoable onDismiss(final EnhancedListView enhancedListView, final int position) { - - final int index = listView.getFirstVisiblePosition(); - View v = listView.getChildAt(0); - final int top = (v == null) ? 0 : (v.getTop() - listView.getPaddingTop()); - - swipedConversation = listAdapter.getItem(position); - listAdapter.remove(swipedConversation); - swipedConversation.markRead(); - xmppConnectionService.getNotificationService().clear(swipedConversation); - - final boolean formerlySelected = (getSelectedConversation() == swipedConversation); - if (position == 0 && listAdapter.getCount() == 0) { - endConversation(swipedConversation, false, true); - return null; - } else if (formerlySelected) { - setSelectedConversation(listAdapter.getItem(0)); - ConversationActivity.this.mConversationFragment - .reInit(getSelectedConversation()); - } - - return new EnhancedListView.Undoable() { - - @Override - public void undo() { - listAdapter.insert(swipedConversation, position); - if (formerlySelected) { - setSelectedConversation(swipedConversation); - ConversationActivity.this.mConversationFragment - .reInit(getSelectedConversation()); - } - swipedConversation = null; - listView.setSelectionFromTop(index + (listView.getChildCount() < position ? 1 : 0), top); - } - - @Override - public void discard() { - if (!swipedConversation.isRead() - && swipedConversation.getMode() == Conversation.MODE_SINGLE) { - swipedConversation = null; - return; - } - endConversation(swipedConversation, false, false); - swipedConversation = null; - } - - @Override - public String getTitle() { - if (swipedConversation.getMode() == Conversation.MODE_MULTI) { - return getResources().getString(R.string.title_undo_swipe_out_muc); - } else { - return getResources().getString(R.string.title_undo_swipe_out_conversation); - } - } - }; - } - }); + @Override + public EnhancedListView.Undoable onDismiss(final EnhancedListView enhancedListView, final int position) { + + final int index = listView.getFirstVisiblePosition(); + View v = listView.getChildAt(0); + final int top = (v == null) ? 0 : (v.getTop() - listView.getPaddingTop()); + + swipedConversation = listAdapter.getItem(position); + listAdapter.remove(swipedConversation); + swipedConversation.markRead(); + xmppConnectionService.getNotificationService().clear(swipedConversation); + + final boolean formerlySelected = (getSelectedConversation() == swipedConversation); + if (position == 0 && listAdapter.getCount() == 0) { + endConversation(swipedConversation, false, true); + return null; + } else if (formerlySelected) { + setSelectedConversation(listAdapter.getItem(0)); + ConversationActivity.this.mConversationFragment + .reInit(getSelectedConversation()); + } + + return new EnhancedListView.Undoable() { + + @Override + public void undo() { + listAdapter.insert(swipedConversation, position); + if (formerlySelected) { + setSelectedConversation(swipedConversation); + ConversationActivity.this.mConversationFragment + .reInit(getSelectedConversation()); + } + swipedConversation = null; + listView.setSelectionFromTop(index + (listView.getChildCount() < position ? 1 : 0), top); + } + + @Override + public void discard() { + if (!swipedConversation.isRead() + && swipedConversation.getMode() == Conversation.MODE_SINGLE) { + swipedConversation = null; + return; + } + endConversation(swipedConversation, false, false); + swipedConversation = null; + } + + @Override + public String getTitle() { + if (swipedConversation.getMode() == Conversation.MODE_MULTI) { + return getResources().getString(R.string.title_undo_swipe_out_muc); + } else { + return getResources().getString(R.string.title_undo_swipe_out_conversation); + } + } + }; + } + }); listView.enableSwipeToDismiss(); listView.setSwipingLayout(R.id.swipeable_item); listView.setUndoStyle(EnhancedListView.UndoStyle.SINGLE_POPUP); @@ -457,7 +457,7 @@ public class ConversationActivity extends XmppActivity conversation.setNextCounterpart(null); callback.onPresenceSelected(); } else { - selectPresence(conversation,callback); + selectPresence(conversation, callback); } } @@ -467,7 +467,7 @@ public class ConversationActivity extends XmppActivity if (intent.resolveActivity(getPackageManager()) != null) { return intent; } else { - intent.setData(Uri.parse("http://play.google.com/store/apps/details?id="+packageId)); + intent.setData(Uri.parse("http://play.google.com/store/apps/details?id=" + packageId)); return intent; } } @@ -535,7 +535,7 @@ public class ConversationActivity extends XmppActivity showInstallPgpDialog(); } } else { - selectPresenceToAttachFile(attachmentChoice,encryption); + selectPresenceToAttachFile(attachmentChoice, encryption); } } @@ -656,28 +656,28 @@ public class ConversationActivity extends XmppActivity } attachFilePopup.setOnMenuItemClickListener(new OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem item) { - switch (item.getItemId()) { - case R.id.attach_choose_picture: - attachFile(ATTACHMENT_CHOICE_CHOOSE_IMAGE); - break; - case R.id.attach_take_picture: - attachFile(ATTACHMENT_CHOICE_TAKE_PHOTO); - break; - case R.id.attach_choose_file: - attachFile(ATTACHMENT_CHOICE_CHOOSE_FILE); - break; - case R.id.attach_record_voice: - attachFile(ATTACHMENT_CHOICE_RECORD_VOICE); - break; - case R.id.attach_location: - attachFile(ATTACHMENT_CHOICE_LOCATION); - break; - } - return false; - } - }); + @Override + public boolean onMenuItemClick(MenuItem item) { + switch (item.getItemId()) { + case R.id.attach_choose_picture: + attachFile(ATTACHMENT_CHOICE_CHOOSE_IMAGE); + break; + case R.id.attach_take_picture: + attachFile(ATTACHMENT_CHOICE_TAKE_PHOTO); + break; + case R.id.attach_choose_file: + attachFile(ATTACHMENT_CHOICE_CHOOSE_FILE); + break; + case R.id.attach_record_voice: + attachFile(ATTACHMENT_CHOICE_RECORD_VOICE); + break; + case R.id.attach_location: + attachFile(ATTACHMENT_CHOICE_LOCATION); + break; + } + return false; + } + }); attachFilePopup.show(); } @@ -700,13 +700,13 @@ public class ConversationActivity extends XmppActivity intent.putExtra("account", conversation.getAccount().getJid().toBareJid().toString()); switch (menuItem.getItemId()) { case R.id.scan_fingerprint: - intent.putExtra("mode",VerifyOTRActivity.MODE_SCAN_FINGERPRINT); + intent.putExtra("mode", VerifyOTRActivity.MODE_SCAN_FINGERPRINT); break; case R.id.ask_question: - intent.putExtra("mode",VerifyOTRActivity.MODE_ASK_QUESTION); + intent.putExtra("mode", VerifyOTRActivity.MODE_ASK_QUESTION); break; case R.id.manual_verification: - intent.putExtra("mode",VerifyOTRActivity.MODE_MANUAL_VERIFICATION); + intent.putExtra("mode", VerifyOTRActivity.MODE_MANUAL_VERIFICATION); break; } startActivity(intent); @@ -890,7 +890,7 @@ public class ConversationActivity extends XmppActivity Conversation conversation = getSelectedConversation(); if (conversation != null) { savedInstanceState.putString(STATE_OPEN_CONVERSATION, - conversation.getUuid()); + conversation.getUuid()); } savedInstanceState.putBoolean(STATE_PANEL_OPEN, isConversationsOverviewVisable()); @@ -1102,23 +1102,23 @@ public class ConversationActivity extends XmppActivity } prepareFileToast = Toast.makeText(getApplicationContext(),getText(R.string.preparing_file), Toast.LENGTH_LONG); prepareFileToast.show(); - xmppConnectionService.attachFileToConversation(conversation,uri, new UiCallback<Message>() { - @Override - public void success(Message message) { - hidePrepareFileToast(); - xmppConnectionService.sendMessage(message); - } - - @Override - public void error(int errorCode, Message message) { - displayErrorDialog(errorCode); - } - - @Override - public void userInputRequried(PendingIntent pi, Message message) { - - } - }); + xmppConnectionService.attachFileToConversation(conversation, uri, new UiCallback<Message>() { + @Override + public void success(Message message) { + hidePrepareFileToast(); + xmppConnectionService.sendMessage(message); + } + + @Override + public void error(int errorCode, Message message) { + displayErrorDialog(errorCode); + } + + @Override + public void userInputRequried(PendingIntent pi, Message message) { + + } + }); } private void attachImageToConversation(Conversation conversation, Uri uri) { @@ -1128,25 +1128,25 @@ public class ConversationActivity extends XmppActivity prepareFileToast = Toast.makeText(getApplicationContext(),getText(R.string.preparing_image), Toast.LENGTH_LONG); prepareFileToast.show(); xmppConnectionService.attachImageToConversation(conversation, uri, - new UiCallback<Message>() { - - @Override - public void userInputRequried(PendingIntent pi, - Message object) { - hidePrepareFileToast(); - } - - @Override - public void success(Message message) { - xmppConnectionService.sendMessage(message); - } - - @Override - public void error(int error, Message message) { - hidePrepareFileToast(); - displayErrorDialog(error); - } - }); + new UiCallback<Message>() { + + @Override + public void userInputRequried(PendingIntent pi, + Message object) { + hidePrepareFileToast(); + } + + @Override + public void success(Message message) { + xmppConnectionService.sendMessage(message); + } + + @Override + public void error(int error, Message message) { + hidePrepareFileToast(); + displayErrorDialog(error); + } + }); } private void hidePrepareFileToast() { @@ -1210,6 +1210,10 @@ public class ConversationActivity extends XmppActivity return getPreferences().getBoolean("force_encryption", false); } + public boolean useSendButtonToIndicateStatus() { + return getPreferences().getBoolean("send_button_status", false); + } + public boolean indicateReceived() { return getPreferences().getBoolean("indicate_received", false); } diff --git a/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java b/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java index d12ff4f2..c020cb1f 100644 --- a/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java @@ -133,28 +133,28 @@ public class SettingsActivity extends XmppActivity implements @Override public void onSharedPreferenceChanged(SharedPreferences preferences, String name) { - // need to synchronize the settings class first - Settings.synchronizeSettingsClassWithPreferences(getPreferences(), name); - switch (name) { - case "resource": - String resource = preferences.getString("resource", "mobile") - .toLowerCase(Locale.US); - if (xmppConnectionServiceBound) { - for (Account account : xmppConnectionService.getAccounts()) { - account.setResource(resource); - if (!account.isOptionSet(Account.OPTION_DISABLED)) { - XmppConnection connection = account.getXmppConnection(); + // need to synchronize the settings class first + Settings.synchronizeSettingsClassWithPreferences(getPreferences(), name); + switch (name) { + case "resource": + String resource = preferences.getString("resource", "mobile") + .toLowerCase(Locale.US); + if (xmppConnectionServiceBound) { + for (Account account : xmppConnectionService.getAccounts()) { + account.setResource(resource); + if (!account.isOptionSet(Account.OPTION_DISABLED)) { + XmppConnection connection = account.getXmppConnection(); if (connection != null) { connection.resetStreamId(); } - xmppConnectionService.reconnectAccountInBackground(account); - } - } - } - break; - case "keep_foreground_service": - xmppConnectionService.toggleForegroundService(); - break; + xmppConnectionService.reconnectAccountInBackground(account); + } + } + } + break; + case "keep_foreground_service": + xmppConnectionService.toggleForegroundService(); + break; case "confirm_messages": if (xmppConnectionServiceBound) { for (Account account : xmppConnectionService.getAccounts()) { @@ -164,11 +164,12 @@ public class SettingsActivity extends XmppActivity implements } } break; - case "dont_trust_system_cas": - xmppConnectionService.updateMemorizingTrustmanager(); - reconnectAccounts(); - break; - } + case "dont_trust_system_cas": + xmppConnectionService.updateMemorizingTrustmanager(); + reconnectAccounts(); + break; + } + } private void displayToast(final String msg) { runOnUiThread(new Runnable() { @@ -186,6 +187,5 @@ public class SettingsActivity extends XmppActivity implements } } } - } } diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java index c42dd305..eba91aca 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java @@ -79,7 +79,7 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { if (Settings.SHOW_ONLINE_STATUS && conversation != null && conversation.getAccount().getStatus() == Account.State.ONLINE) { TextView status = (TextView) view.findViewById(R.id.status); - + String color = "#000000"; if (conversation.getMode() == Conversation.MODE_SINGLE) { switch (conversation.getContact().getMostAvailableStatus()) { diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ListItemAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ListItemAdapter.java index 10500bfc..4187ec60 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ListItemAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ListItemAdapter.java @@ -4,6 +4,7 @@ import java.lang.ref.WeakReference; import java.util.List; import java.util.concurrent.RejectedExecutionException; +import de.tzur.conversations.Settings; import eu.siacs.conversations.R; import eu.siacs.conversations.entities.ListItem; import eu.siacs.conversations.ui.XmppActivity; diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java index 7984c56f..de669ea6 100644 --- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java @@ -17,6 +17,7 @@ import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Conversation; +import eu.siacs.conversations.entities.Presences; import eu.siacs.conversations.entities.Transferable; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.xmpp.jid.Jid; diff --git a/src/main/res/layout/conversation_list_row.xml b/src/main/res/layout/conversation_list_row.xml index 602d3842..a669f953 100644 --- a/src/main/res/layout/conversation_list_row.xml +++ b/src/main/res/layout/conversation_list_row.xml @@ -10,16 +10,7 @@ <View android:layout_width="fill_parent" android:layout_height="fill_parent" - android:background="@color/green500"/> - - <TextView - android:layout_width="56dp" - android:layout_height="4dp" - android:textAppearance="?android:attr/textAppearanceSmall" - android:id="@+id/status" - android:layout_below="@+id/conversation_image" - android:paddingTop="8dp" - android:paddingRight="8dp"/> + android:background="@color/red500"/> <FrameLayout android:id="@+id/swipeable_item" @@ -40,21 +31,23 @@ android:layout_height="56dp" android:layout_alignParentLeft="true" android:scaleType="centerCrop" /> -<RelativeLayout + + <TextView + android:layout_width="56dp" + android:layout_height="4dp" + android:textAppearance="?android:attr/textAppearanceSmall" + android:id="@+id/status" + android:layout_below="@+id/conversation_image" + android:paddingTop="8dp" + android:paddingRight="8dp"/> + + <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_toRightOf="@+id/conversation_image" android:paddingLeft="8dp" > - <github.ankushsachdeva.emojicon.EmojiconTextView - android:id="@+id/conversation_lastmsg" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:scrollHorizontally="false" - android:singleLine="true" - android:textColor="@color/primarytext" - android:textSize="?attr/TextSizeBody" - emojicon:emojiconSize="20sp" /> + <TextView android:id="@+id/conversation_name" @@ -75,14 +68,15 @@ android:orientation="vertical" android:paddingTop="3dp" > - <TextView + <github.ankushsachdeva.emojicon.EmojiconTextView android:id="@+id/conversation_lastmsg" android:layout_width="fill_parent" android:layout_height="wrap_content" android:scrollHorizontally="false" android:singleLine="true" android:textColor="@color/black87" - android:textSize="?attr/TextSizeBody" /> + android:textSize="?attr/TextSizeBody" + emojicon:emojiconSize="20sp" /> <ImageView android:id="@+id/conversation_lastimage" diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml index f0583227..9def87c4 100644 --- a/src/main/res/xml/preferences.xml +++ b/src/main/res/xml/preferences.xml @@ -56,7 +56,6 @@ android:key="chat_states" android:summary="@string/pref_chat_states_summary" android:title="@string/pref_chat_states" /> -<<<<<<< HEAD <CheckBoxPreference android:defaultValue="true" android:key="parse_emoticons" @@ -67,23 +66,6 @@ <PreferenceScreen android:summary="@string/pref_notification_settings" android:title="@string/pref_notifications" > -======= - - </PreferenceCategory> - <PreferenceCategory - android:title="@string/pref_notification_settings" - android:key="notifications"> - <CheckBoxPreference - android:defaultValue="true" - android:key="show_notification" - android:summary="@string/pref_notifications_summary" - android:title="@string/pref_notifications" /> - <PreferenceScreen - android:dependency="show_notification" - android:summary="@string/pref_quiet_hours_summary" - android:title="@string/title_pref_quiet_hours" - android:key="quiet_hours"> ->>>>>>> 1.5.2 <CheckBoxPreference android:defaultValue="true" android:key="show_notification" |