diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 60bbad9dbf..678d284d4f 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -447,6 +447,10 @@
android:windowSoftInputMode="stateUnchanged"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
+
+
diff --git a/build.gradle b/build.gradle
index 7bea4d7f1a..19e4767c92 100644
--- a/build.gradle
+++ b/build.gradle
@@ -171,7 +171,7 @@ dependencies {
testImplementation 'org.robolectric:shadows-multidex:4.2'
// Loki
- implementation "com.github.loki-project:loki-messenger-android-core:master-SNAPSHOT"
+ implementation "com.github.loki-project:loki-messenger-android-service:master-SNAPSHOT"
implementation "org.signal:signal-metadata-android:0.0.3"
implementation "com.google.protobuf:protobuf-java:2.5.0"
implementation "com.googlecode.libphonenumber:libphonenumber:8.10.7"
diff --git a/res/layout/activity_new_conversation.xml b/res/layout/activity_new_conversation.xml
new file mode 100644
index 0000000000..f2f28a1b80
--- /dev/null
+++ b/res/layout/activity_new_conversation.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/res/layout/conversation_list_fragment.xml b/res/layout/conversation_list_fragment.xml
index 536041924a..68806f42f6 100644
--- a/res/layout/conversation_list_fragment.xml
+++ b/res/layout/conversation_list_fragment.xml
@@ -31,7 +31,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
- tools:src="@drawable/conversation_list_empty_state" />
+ tools:src="@drawable/conversation_list_empty_state"
+ android:visibility="gone" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 27178cee01..dbd0243b04 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1335,12 +1335,10 @@
Inbox zeeerrro
Zip. Zilch. Zero. Nada.\nYou\'re all caught up!
-
New conversation
Give your inbox something to write home about. Get started by messaging a friend.
-
Reset secure session
@@ -1539,6 +1537,8 @@
Copied to Clipboard
Register
Restore
+
+ Looks like you don\'t have any conversations yet. Get started by messaging a friend.
Share Public Key
Show Seed
@@ -1556,6 +1556,10 @@
Search by name or public key
+ New Conversation
+ Public Key
+ Enter the public key of the person you\'d like to securely message. They can share their public key with you by going into Loki Messenger\'s in-app settings and clicking "Share Public Key".
+ Next
Invalid Public Key
Accept
diff --git a/src/org/thoughtcrime/securesms/ConversationListFragment.java b/src/org/thoughtcrime/securesms/ConversationListFragment.java
index eaaf27cc4f..e235f9062e 100644
--- a/src/org/thoughtcrime/securesms/ConversationListFragment.java
+++ b/src/org/thoughtcrime/securesms/ConversationListFragment.java
@@ -74,6 +74,7 @@ import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo;
import org.thoughtcrime.securesms.database.loaders.ConversationListLoader;
import org.thoughtcrime.securesms.events.ReminderUpdateEvent;
import org.thoughtcrime.securesms.jobs.ServiceOutageDetectionJob;
+import org.thoughtcrime.securesms.loki.NewConversationActivity;
import org.thoughtcrime.securesms.mms.GlideApp;
import org.thoughtcrime.securesms.notifications.MarkReadReceiver;
import org.thoughtcrime.securesms.notifications.MessageNotifier;
@@ -360,7 +361,7 @@ public class ConversationListFragment extends Fragment
public void onLoadFinished(Loader arg0, Cursor cursor) {
if ((cursor == null || cursor.getCount() <= 0) && TextUtils.isEmpty(queryFilter) && !archive) {
list.setVisibility(View.INVISIBLE);
- emptyState.setVisibility(View.GONE);
+ emptyState.setVisibility(View.VISIBLE);
emptySearch.setVisibility(View.INVISIBLE);
emptyImage.setImageResource(EMPTY_IMAGES[(int) (Math.random() * EMPTY_IMAGES.length)]);
fab.startPulse(3 * 1000);
diff --git a/src/org/thoughtcrime/securesms/SmsSendtoActivity.java b/src/org/thoughtcrime/securesms/SmsSendtoActivity.java
index 428ec78fad..cf0add6a74 100644
--- a/src/org/thoughtcrime/securesms/SmsSendtoActivity.java
+++ b/src/org/thoughtcrime/securesms/SmsSendtoActivity.java
@@ -7,13 +7,13 @@ import android.os.Bundle;
import android.provider.ContactsContract;
import android.support.annotation.NonNull;
import android.text.TextUtils;
-
-import org.thoughtcrime.securesms.conversation.ConversationActivity;
-import org.thoughtcrime.securesms.logging.Log;
import android.widget.Toast;
+import org.thoughtcrime.securesms.conversation.ConversationActivity;
import org.thoughtcrime.securesms.database.Address;
import org.thoughtcrime.securesms.database.DatabaseFactory;
+import org.thoughtcrime.securesms.logging.Log;
+import org.thoughtcrime.securesms.loki.NewConversationActivity;
import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.util.Rfc5724Uri;
diff --git a/src/org/thoughtcrime/securesms/loki/NewConversationActivity.kt b/src/org/thoughtcrime/securesms/loki/NewConversationActivity.kt
new file mode 100644
index 0000000000..f4a044c164
--- /dev/null
+++ b/src/org/thoughtcrime/securesms/loki/NewConversationActivity.kt
@@ -0,0 +1,53 @@
+package org.thoughtcrime.securesms.loki
+
+import android.content.Intent
+import android.os.Bundle
+import android.widget.Toast
+import kotlinx.android.synthetic.main.activity_new_conversation.*
+import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
+import org.thoughtcrime.securesms.R
+import org.thoughtcrime.securesms.conversation.ConversationActivity
+import org.thoughtcrime.securesms.database.Address
+import org.thoughtcrime.securesms.database.DatabaseFactory
+import org.thoughtcrime.securesms.database.ThreadDatabase
+import org.thoughtcrime.securesms.recipients.Recipient
+import org.thoughtcrime.securesms.util.DynamicTheme
+import org.whispersystems.signalservice.loki.utilities.PublicKeyValidation
+
+class NewConversationActivity : PassphraseRequiredActionBarActivity() {
+ private val dynamicTheme = DynamicTheme()
+
+ override fun onPreCreate() {
+ dynamicTheme.onCreate(this)
+ }
+
+ override fun onCreate(bundle: Bundle?, isReady: Boolean) {
+ setContentView(R.layout.activity_new_conversation)
+ supportActionBar!!.setTitle(R.string.activity_new_conversation_title)
+ supportActionBar!!.setDisplayHomeAsUpEnabled(true)
+ nextButton.setOnClickListener { startNewConversationIfPossible() }
+ }
+
+ public override fun onResume() {
+ super.onResume()
+ dynamicTheme.onResume(this)
+ }
+
+ private fun startNewConversationIfPossible() {
+ val hexEncodedPublicKey = publicKeyEditText.text.toString().trim()
+ if (PublicKeyValidation.isValid(hexEncodedPublicKey)) {
+ val contact = Recipient.from(this, Address.fromSerialized(hexEncodedPublicKey), true)
+ val intent = Intent(this, ConversationActivity::class.java)
+ intent.putExtra(ConversationActivity.ADDRESS_EXTRA, contact.address)
+ intent.putExtra(ConversationActivity.TEXT_EXTRA, getIntent().getStringExtra(ConversationActivity.TEXT_EXTRA))
+ intent.setDataAndType(getIntent().data, getIntent().type)
+ val existingThread = DatabaseFactory.getThreadDatabase(this).getThreadIdIfExistsFor(contact)
+ intent.putExtra(ConversationActivity.THREAD_ID_EXTRA, existingThread)
+ intent.putExtra(ConversationActivity.DISTRIBUTION_TYPE_EXTRA, ThreadDatabase.DistributionTypes.DEFAULT)
+ startActivity(intent)
+ finish()
+ } else {
+ Toast.makeText(this, R.string.activity_new_conversation_invalid_public_key_message, Toast.LENGTH_SHORT).show()
+ }
+ }
+}
\ No newline at end of file