From f765dc84238ebf9f0b40f7d38c104358e58be91e Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Wed, 30 Jul 2014 21:30:55 +0200 Subject: fixed npe for the rare case that user has disabled his action bar --- .../conversations/ui/ConversationActivity.java | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java index e0bfc540..b04fc131 100644 --- a/src/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/eu/siacs/conversations/ui/ConversationActivity.java @@ -18,6 +18,7 @@ import android.os.AsyncTask; import android.os.Bundle; import android.preference.PreferenceManager; import android.provider.MediaStore; +import android.app.ActionBar; import android.app.AlertDialog; import android.app.FragmentTransaction; import android.app.PendingIntent; @@ -157,7 +158,7 @@ public class ConversationActivity extends XmppActivity { if (view == null) { LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = (View) inflater.inflate( - R.layout.conversation_list_row, null); + R.layout.conversation_list_row, parent,false); } Conversation conv; if (conversationList.size() > position) { @@ -261,9 +262,12 @@ public class ConversationActivity extends XmppActivity { @Override public void onPanelOpened(View arg0) { paneShouldBeOpen = true; - getActionBar().setDisplayHomeAsUpEnabled(false); - getActionBar().setHomeButtonEnabled(false); - getActionBar().setTitle(R.string.app_name); + ActionBar ab = getActionBar(); + if (ab!=null) { + ab.setDisplayHomeAsUpEnabled(false); + ab.setHomeButtonEnabled(false); + ab.setTitle(R.string.app_name); + } invalidateOptionsMenu(); hideKeyboard(); } @@ -273,10 +277,13 @@ public class ConversationActivity extends XmppActivity { paneShouldBeOpen = false; if ((conversationList.size() > 0) && (getSelectedConversation() != null)) { - getActionBar().setDisplayHomeAsUpEnabled(true); - getActionBar().setHomeButtonEnabled(true); - getActionBar().setTitle( + ActionBar ab = getActionBar(); + if (ab!=null) { + ab.setDisplayHomeAsUpEnabled(true); + ab.setHomeButtonEnabled(true); + ab.setTitle( getSelectedConversation().getName(useSubject)); + } invalidateOptionsMenu(); if (!getSelectedConversation().isRead()) { xmppConnectionService -- cgit v1.2.3 From 8a5f9f148893f19d41f2382fa17166791a7cd868 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Wed, 30 Jul 2014 21:24:42 +0200 Subject: fixed rare npe in loading of selfi --- src/eu/siacs/conversations/utils/PhoneHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eu/siacs/conversations/utils/PhoneHelper.java b/src/eu/siacs/conversations/utils/PhoneHelper.java index bccd7210..67623ea3 100644 --- a/src/eu/siacs/conversations/utils/PhoneHelper.java +++ b/src/eu/siacs/conversations/utils/PhoneHelper.java @@ -74,7 +74,7 @@ public class PhoneHelper { Cursor mProfileCursor = context.getContentResolver().query( Profile.CONTENT_URI, mProjection, null, null, null); - if (mProfileCursor.getCount() == 0) { + if (mProfileCursor == null || mProfileCursor.getCount() == 0) { return null; } else { mProfileCursor.moveToFirst(); -- cgit v1.2.3 From ad8c5b6874f8c9c30b974d2b87d3a42067e3af5d Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Wed, 30 Jul 2014 21:25:59 +0200 Subject: fixed generation of muc pictures with copyonwrite user list --- src/eu/siacs/conversations/utils/UIHelper.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/eu/siacs/conversations/utils/UIHelper.java b/src/eu/siacs/conversations/utils/UIHelper.java index 1cd3403c..d14970f5 100644 --- a/src/eu/siacs/conversations/utils/UIHelper.java +++ b/src/eu/siacs/conversations/utils/UIHelper.java @@ -214,13 +214,17 @@ public class UIHelper { new String[] { conversation.getName(false) }, size, bgColor, fgColor); } - String[] names = new String[members.size() + 1]; - names[0] = conversation.getMucOptions().getActualNick(); - for (int i = 0; i < members.size(); ++i) { - names[i + 1] = members.get(i).getName(); + ArrayList names = new ArrayList(); + names.add(conversation.getMucOptions().getActualNick()); + for(User user : members) { + names.add(user.getName()); + if (names.size() > 4 ) { + break; + } } - - return getUnknownContactPicture(names, size, bgColor, fgColor); + String[] mArrayNames = new String[names.size()]; + names.toArray(mArrayNames); + return getUnknownContactPicture(mArrayNames, size, bgColor, fgColor); } public static Bitmap getContactPicture(Conversation conversation, -- cgit v1.2.3 From 98e9bd43b60b7ab9b31a8dd8cc1e61f84e65b7df Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Wed, 30 Jul 2014 21:26:33 +0200 Subject: fixed npe in start conversation activity --- src/eu/siacs/conversations/ui/StartConversationActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/eu/siacs/conversations/ui/StartConversationActivity.java b/src/eu/siacs/conversations/ui/StartConversationActivity.java index c106955f..b56d8a60 100644 --- a/src/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/eu/siacs/conversations/ui/StartConversationActivity.java @@ -148,7 +148,9 @@ public class StartConversationActivity extends XmppActivity { @Override public void run() { - filter(mSearchEditText.getText().toString()); + if (mSearchEditText != null) { + filter(mSearchEditText.getText().toString()); + } } }); } -- cgit v1.2.3 From 9b34f39cd2f08506b9e6be481bd7e0b013a9a11a Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Thu, 31 Jul 2014 10:20:46 +0200 Subject: version bump to 0.5.2 --- AndroidManifest.xml | 4 ++-- CHANGELOG.md | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index a359c71f..79f4e340 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="23" + android:versionName="0.5.2" >