forked from adityapk00/zqwandroid
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from N1CK145/chat
Chat
- Loading branch information
Showing
15 changed files
with
163 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.myhush.silentdragon | ||
|
||
import org.myhush.silentdragon.chat.Message | ||
|
||
object Addressbook { | ||
class Contact { | ||
var nickname = "" | ||
var addressIn = "" | ||
var addressOut = "" | ||
val messageList = ArrayList<Message>() | ||
|
||
constructor(nickname: String, addressIn: String, addressOut: String) { | ||
this.nickname = nickname | ||
this.addressIn = addressIn | ||
this.addressOut = addressOut | ||
} | ||
} | ||
|
||
val contactList = ArrayList<Contact>() | ||
|
||
fun addContact(nickname: String, addressIn: String, addressOut: String) { | ||
contactList.add(Contact(nickname, addressIn, addressOut)) | ||
} | ||
|
||
fun findContactByInAddress(address: String): Contact? { | ||
contactList.forEach { | ||
if(it.addressIn == address) | ||
return it | ||
} | ||
return null | ||
} | ||
|
||
fun findContactByOutAddress(address: String): Contact? { | ||
contactList.forEach { | ||
if (it.addressOut == address) | ||
return it | ||
} | ||
return null | ||
} | ||
|
||
fun clear() { | ||
contactList.clear() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
app/src/main/java/org/myhush/silentdragon/chat/Addressbook.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 13 additions & 15 deletions
28
app/src/main/java/org/myhush/silentdragon/chat/ConversationActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.