aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-03-29 22:36:59 +0200
committerChristian Schneppe <christian@pix-art.de>2018-03-29 22:36:59 +0200
commit2868db3c0f611b0d154206cf7c425effad9e4f50 (patch)
tree1afa8e6f90bab02f1fc24dd203ea5ca6ba2d414c /src/main/java/de/pixart/messenger
parente9263bf79976ac50626ee5f196a1602d8dd4d953 (diff)
change font size in conversation overview
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationActivity.java15
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationsMainActivity.java0
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java13
3 files changed, 25 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
index faa8bdc37..c3fdfefa2 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
@@ -104,7 +104,15 @@ public class ConversationActivity extends XmppActivity implements OnConversation
invalidateActionBarTitle();
Intent intent = pendingViewIntent.pop();
if (intent != null) {
- processViewIntent(intent);
+ if (processViewIntent(intent)) {
+ return;
+ }
+ }
+ if (binding.secondaryFragment != null && ConversationFragment.getConversation(this) == null) {
+ Conversation conversation = ConversationsOverviewFragment.getSuggestion(this);
+ if (conversation != null) {
+ openConversation(conversation, null);
+ }
}
}
@@ -122,14 +130,15 @@ public class ConversationActivity extends XmppActivity implements OnConversation
}
}
- private void processViewIntent(Intent intent) {
+ private boolean processViewIntent(Intent intent) {
String uuid = intent.getStringExtra(EXTRA_CONVERSATION);
Conversation conversation = uuid != null ? xmppConnectionService.findConversationByUuid(uuid) : null;
if (conversation == null) {
Log.d(Config.LOGTAG, "unable to view conversation with uuid:" + uuid);
- return;
+ return false;
}
openConversation(conversation, intent.getExtras());
+ return true;
}
@Override
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationsMainActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationsMainActivity.java
deleted file mode 100644
index e69de29bb..000000000
--- a/src/main/java/de/pixart/messenger/ui/ConversationsMainActivity.java
+++ /dev/null
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java
index ecfbaf595..173d09cc7 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java
@@ -30,6 +30,7 @@
package de.pixart.messenger.ui;
import android.app.Activity;
+import android.app.Fragment;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.util.Log;
@@ -114,4 +115,16 @@ public class ConversationsOverviewFragment extends XmppFragment {
this.activity.xmppConnectionService.populateWithOrderedConversations(this.conversations);
this.conversationsAdapter.notifyDataSetChanged();
}
+
+ public static Conversation getSuggestion(Activity activity) {
+ Fragment fragment = activity.getFragmentManager().findFragmentById(R.id.main_fragment);
+ if (fragment != null && fragment instanceof ConversationsOverviewFragment) {
+ List<Conversation> conversations = ((ConversationsOverviewFragment) fragment).conversations;
+ if (conversations.size() > 0) {
+ return conversations.get(0);
+ }
+ }
+ return null;
+
+ }
} \ No newline at end of file