forked from hush/SilentDragonAndroid-old
Compare commits
37 Commits
Author | SHA1 | Date |
---|---|---|
Duke Leto | 9195d17536 | 4 years ago |
N1CK145 | 5058257fbe | 4 years ago |
N1CK145 | 8e636145a3 | 4 years ago |
N1CK145 | 54920eb1ab | 4 years ago |
N1CK145 | 8590981908 | 5 years ago |
N1CK145 | 6f8961b70b | 5 years ago |
Jonathan "Duke" Leto | 2928ef7f73 | 5 years ago |
Duke Leto | 9312da8f21 | 5 years ago |
N1CK145 | ec089a3314 | 5 years ago |
Jonathan "Duke" Leto | fa37cb0ded | 5 years ago |
Duke Leto | 75c1d53833 | 5 years ago |
N1CK145 | a160d8a33b | 5 years ago |
N1CK145 | 644ce67804 | 5 years ago |
Jonathan "Duke" Leto | d741306fe2 | 5 years ago |
Duke Leto | 09da932ce3 | 5 years ago |
N1CK145 | fb7d69fa41 | 5 years ago |
N1CK145 | bd0e7486dc | 5 years ago |
N1CK145 | fd05db9ef1 | 5 years ago |
N1CK145 | 89bdd7ee16 | 5 years ago |
Jonathan "Duke" Leto | 6af0c3345e | 5 years ago |
Jonathan "Duke" Leto | 67e6c4b690 | 5 years ago |
Jonathan "Duke" Leto | fc06dde62c | 5 years ago |
Jonathan "Duke" Leto | 88341b2307 | 5 years ago |
Duke Leto | f42481a74f | 5 years ago |
N1CK145 | bfae9e77b2 | 5 years ago |
N1CK145 | df99f9a866 | 5 years ago |
N1CK145 | 6ac5336949 | 5 years ago |
N1CK145 | 006555d4fd | 5 years ago |
N1CK145 | 19ab271a2b | 5 years ago |
N1CK145 | 9e3053ca80 | 5 years ago |
N1CK145 | 1e855ca72f | 5 years ago |
N1CK145 | 5382d8ade7 | 5 years ago |
N1CK145 | b6eb5fbf44 | 5 years ago |
N1CK145 | 96cce88664 | 5 years ago |
N1CK145 | 1ebd2a6666 | 5 years ago |
N1CK145 | d410a39af1 | 5 years ago |
N1CK145 | dedace6719 | 5 years ago |
35 changed files with 1123 additions and 126 deletions
@ -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() |
|||
} |
|||
} |
@ -0,0 +1,56 @@ |
|||
package org.myhush.silentdragon.chat |
|||
|
|||
import android.app.AlertDialog |
|||
import android.support.v7.app.AppCompatActivity |
|||
import android.os.Bundle |
|||
import kotlinx.android.synthetic.main.activity_add_contact.* |
|||
import org.myhush.silentdragon.Addressbook |
|||
import org.myhush.silentdragon.R |
|||
|
|||
class AddContactActivity : AppCompatActivity() { |
|||
|
|||
override fun onCreate(savedInstanceState: Bundle?) { |
|||
super.onCreate(savedInstanceState) |
|||
setContentView(R.layout.activity_add_contact) |
|||
|
|||
buttonAddContact.setOnClickListener { |
|||
if (checkValueValidation()) { |
|||
var nickName = editText_NickName.text.toString() |
|||
var fullname = editText_FullName.text.toString() |
|||
var zAddr = editTextZAddress.text.toString() |
|||
|
|||
Addressbook.addContact(fullname, nickName, zAddr) |
|||
|
|||
this.finish() |
|||
} |
|||
} |
|||
} |
|||
|
|||
private fun sendErrorDialog(msg: String) { |
|||
val alertDialog = AlertDialog.Builder(this@AddContactActivity).create() |
|||
alertDialog.setTitle("Error by add a new Contact!") |
|||
alertDialog.setMessage(msg) |
|||
alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK") { |
|||
dialog, _ -> dialog.dismiss() } |
|||
alertDialog.show() |
|||
} |
|||
|
|||
private fun checkValueValidation(): Boolean{ |
|||
if (editText_FullName.text.length <= 1) { |
|||
sendErrorDialog("Pleas insert a name!") |
|||
return false |
|||
} |
|||
if (editText_NickName.text.length <= 1) { |
|||
sendErrorDialog("Pleas insert a nickname!") |
|||
return false |
|||
} |
|||
if (editTextZAddress.text.length <= 1) { |
|||
if(!editTextZAddress.text.startsWith('z', true)) { |
|||
sendErrorDialog("Pleas insert a z-address!") |
|||
return false |
|||
} |
|||
} |
|||
|
|||
return true |
|||
} |
|||
} |
@ -0,0 +1,88 @@ |
|||
package org.myhush.silentdragon.chat |
|||
|
|||
import android.content.Intent |
|||
import android.os.Bundle |
|||
import android.support.v4.app.FragmentTransaction |
|||
import android.support.v7.app.AppCompatActivity |
|||
import android.view.Menu |
|||
import android.view.MenuItem |
|||
import android.widget.LinearLayout |
|||
import kotlinx.android.synthetic.main.activity_chat.* |
|||
import org.myhush.silentdragon.* |
|||
|
|||
class ChatActivity : AppCompatActivity() { |
|||
override fun onCreate(savedInstanceState: Bundle?) { |
|||
super.onCreate(savedInstanceState) |
|||
setContentView(R.layout.activity_chat) |
|||
|
|||
initListener() |
|||
refresh() |
|||
|
|||
swiperefreshChat.setOnRefreshListener { |
|||
refresh() |
|||
swiperefreshChat.isRefreshing = false |
|||
} |
|||
} |
|||
|
|||
private fun initListener(){ |
|||
nav_view.setOnNavigationItemSelectedListener { |
|||
when(it.itemId) { |
|||
R.id.action_send -> { |
|||
val intent = Intent(this, SendActivity::class.java) |
|||
startActivity(intent) |
|||
return@setOnNavigationItemSelectedListener true |
|||
} |
|||
R.id.action_bal -> { |
|||
val intent = Intent(this, MainActivity::class.java) |
|||
startActivity(intent) |
|||
return@setOnNavigationItemSelectedListener true |
|||
} |
|||
R.id.action_chat -> true |
|||
R.id.action_recieve -> { |
|||
val intent = Intent(this, ReceiveActivity::class.java) |
|||
startActivity(intent) |
|||
return@setOnNavigationItemSelectedListener true |
|||
} |
|||
else -> { |
|||
return@setOnNavigationItemSelectedListener false |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
private fun refresh(){ |
|||
findViewById<LinearLayout>(R.id.ChatTable).removeAllViews() |
|||
|
|||
Addressbook.contactList.forEach { |
|||
addChat(it) |
|||
} |
|||
} |
|||
|
|||
private fun addChat(contact: Addressbook.Contact){ |
|||
val fragment = ChatItemFragment() |
|||
val fragTx: FragmentTransaction = supportFragmentManager.beginTransaction() |
|||
|
|||
fragment.nickname = contact.nickname |
|||
fragment.contactAddress = contact.addressIn |
|||
|
|||
fragTx.add(R.id.ChatTable, fragment) |
|||
fragTx.commit() |
|||
} |
|||
|
|||
override fun onCreateOptionsMenu(menu: Menu): Boolean { |
|||
// Inflate the menu; this adds items to the action bar if it is present. |
|||
menuInflater.inflate(R.menu.menu_chat, menu) |
|||
return true |
|||
} |
|||
|
|||
override fun onOptionsItemSelected(item: MenuItem): Boolean { |
|||
return when (item.itemId) { |
|||
R.id.action_addChat -> { |
|||
val intent = Intent(this, AddContactActivity::class.java) |
|||
startActivity(intent) |
|||
return true |
|||
} |
|||
else -> super.onOptionsItemSelected(item) |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,46 @@ |
|||
package org.myhush.silentdragon.chat |
|||
|
|||
import android.content.Intent |
|||
import android.os.Bundle |
|||
import android.support.v4.app.Fragment |
|||
import android.view.LayoutInflater |
|||
import android.view.View |
|||
import android.view.ViewGroup |
|||
import android.widget.TextView |
|||
import kotlinx.android.synthetic.main.content_receive.* |
|||
import org.myhush.silentdragon.R |
|||
|
|||
class ChatItemFragment : Fragment() { |
|||
var nickname: String = "" |
|||
var lastMessage: String = "" |
|||
var contactAddress: String = "" |
|||
var v: View? = null |
|||
|
|||
override fun onCreateView (inflater: LayoutInflater, container: ViewGroup?, |
|||
savedInstanceState: Bundle?): View { |
|||
v = inflater.inflate(R.layout.fragment_chat_item, container, false) |
|||
|
|||
updateData() |
|||
|
|||
initListener() |
|||
return v!! |
|||
} |
|||
|
|||
private fun initListener() { |
|||
v?.setOnClickListener { |
|||
val intent = Intent(activity, ConversationActivity::class.java) |
|||
|
|||
intent.putExtra("displayName", nickname) // Send some information |
|||
intent.putExtra("contactAddress", contactAddress) |
|||
|
|||
startActivity(intent) |
|||
} |
|||
} |
|||
|
|||
fun updateData(){ |
|||
v!!.findViewById<TextView>(R.id.textViewContactName).text = nickname |
|||
v!!.findViewById<TextView>(R.id.textViewLastMessage).text = lastMessage |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,66 @@ |
|||
package org.myhush.silentdragon.chat |
|||
|
|||
import android.support.v7.app.AppCompatActivity |
|||
import android.os.Bundle |
|||
import android.support.v4.app.FragmentTransaction |
|||
import android.widget.TextView |
|||
import kotlinx.android.synthetic.main.activity_conversation.* |
|||
import org.myhush.silentdragon.* |
|||
|
|||
|
|||
class ConversationActivity : AppCompatActivity() { |
|||
var displayName = "" |
|||
var contact: Addressbook.Contact? = null |
|||
|
|||
override fun onCreate(savedInstanceState: Bundle?) { |
|||
super.onCreate(savedInstanceState) |
|||
setContentView(R.layout.activity_conversation) |
|||
val address = intent.extras.getString("contactAddress") |
|||
|
|||
displayName = intent.extras.getString("displayName") |
|||
contact = Addressbook.findContactByInAddress(address) |
|||
|
|||
|
|||
findViewById<TextView>(R.id.textViewContactName2).text = displayName |
|||
findViewById<TextView>(R.id.textView_zAddress).text = contact?.addressIn |
|||
|
|||
buttonSend.setOnClickListener{ |
|||
sendMessage() |
|||
} |
|||
|
|||
restoreChat() |
|||
} |
|||
|
|||
private fun sendMessage() { |
|||
val memo = findViewById<TextView>(R.id.userInput).text.toString() |
|||
val tx = DataModel.TransactionItem("", 0, "0", memo, contact!!.addressOut, "0", 0) |
|||
DataModel.sendTx(tx) |
|||
|
|||
findViewById<TextView>(R.id.userInput).text = "" |
|||
} |
|||
|
|||
private fun restoreChat() { |
|||
contact?.messageList?.asReversed()?.forEach { |
|||
attachMessage(it) |
|||
} |
|||
} |
|||
|
|||
fun attachMessage(message: Message){ |
|||
val fragTx: FragmentTransaction = supportFragmentManager.beginTransaction() |
|||
|
|||
when (message.messageType){ |
|||
MessageType.SEND -> { |
|||
val fragment = conversation_item_send() |
|||
fragment.msg = message |
|||
fragTx.add(R.id.MessageList, fragment) |
|||
} |
|||
|
|||
MessageType.RECIEVE -> { |
|||
val fragment = conversation_item_recive() |
|||
fragment.msg = message |
|||
fragTx.add(R.id.MessageList, fragment) |
|||
} |
|||
} |
|||
fragTx.commit() |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
package org.myhush.silentdragon.chat |
|||
|
|||
import org.myhush.silentdragon.DataModel |
|||
|
|||
class Message { |
|||
var memo = "" |
|||
var fromAddress = "" |
|||
var toAddress = "" |
|||
var messageType = MessageType.SEND |
|||
var dateTime: Long = 0 |
|||
var txID = "" |
|||
var txHeight: Int = -1 |
|||
|
|||
constructor(fromAddress: String, tx: DataModel.TransactionItem, messageType: MessageType){ |
|||
this.memo = tx.memo.toString() |
|||
this.txID = tx.txid.toString() |
|||
this.dateTime = tx.datetime |
|||
this.toAddress = tx.addr |
|||
this.fromAddress = fromAddress |
|||
this.messageType = messageType |
|||
} |
|||
} |
@ -0,0 +1,6 @@ |
|||
package org.myhush.silentdragon.chat |
|||
|
|||
enum class MessageType { |
|||
SEND, |
|||
RECIEVE |
|||
} |
@ -0,0 +1,25 @@ |
|||
package org.myhush.silentdragon |
|||
|
|||
import android.os.Bundle |
|||
import android.support.v4.app.Fragment |
|||
import android.view.LayoutInflater |
|||
import android.view.View |
|||
import android.view.ViewGroup |
|||
import android.widget.TextView |
|||
import org.myhush.silentdragon.chat.Message |
|||
import java.text.SimpleDateFormat |
|||
import java.util.* |
|||
|
|||
class conversation_item_recive : Fragment() { |
|||
var msg: Message? = null |
|||
|
|||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, |
|||
savedInstanceState: Bundle?): View? { |
|||
// Inflate the layout for this fragment |
|||
var v: View = inflater.inflate(R.layout.fragment_conversation_item_recive, container, false) |
|||
|
|||
v.findViewById<TextView>(R.id.message).text = msg?.memo |
|||
v.findViewById<TextView>(R.id.Time2).text = SimpleDateFormat("MM-dd, HH:mm").format(Date(msg!!.dateTime)) |
|||
return v |
|||
} |
|||
} |
@ -0,0 +1,24 @@ |
|||
package org.myhush.silentdragon |
|||
|
|||
import android.os.Bundle |
|||
import android.support.v4.app.Fragment |
|||
import android.view.LayoutInflater |
|||
import android.view.View |
|||
import android.view.ViewGroup |
|||
import android.widget.TextView |
|||
import org.myhush.silentdragon.chat.Message |
|||
import java.text.SimpleDateFormat |
|||
import java.util.* |
|||
|
|||
class conversation_item_send : Fragment() { |
|||
var msg: Message? = null |
|||
|
|||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, |
|||
savedInstanceState: Bundle?): View? { |
|||
// Inflate the layout for this fragment |
|||
var v: View = inflater.inflate(R.layout.fragment_conversation_item_send, container, false) |
|||
v.findViewById<TextView>(R.id.message).text = msg?.memo |
|||
v.findViewById<TextView>(R.id.Time).text = SimpleDateFormat("MM-dd, HH:mm").format(Date(msg!!.dateTime)) |
|||
return v |
|||
} |
|||
} |
@ -0,0 +1,10 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:shape="rectangle" android:padding="10dp"> |
|||
<solid android:color="@color/message_recive"/> |
|||
<corners |
|||
android:bottomRightRadius="15dp" |
|||
android:bottomLeftRadius="15dp" |
|||
android:topLeftRadius="15dp" |
|||
android:topRightRadius="15dp"/> |
|||
</shape> |
@ -0,0 +1,10 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:shape="rectangle" android:padding="10dp"> |
|||
<solid android:color="@color/message_send"/> |
|||
<corners |
|||
android:bottomRightRadius="15dp" |
|||
android:bottomLeftRadius="15dp" |
|||
android:topLeftRadius="15dp" |
|||
android:topRightRadius="15dp"/> |
|||
</shape> |
After Width: | Height: | Size: 170 B |
After Width: | Height: | Size: 186 B |
After Width: | Height: | Size: 98 B |
After Width: | Height: | Size: 144 B |
@ -0,0 +1,10 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:shape="rectangle" android:padding="10dp"> |
|||
<solid android:color="#ffaaaaaa"/> |
|||
<corners |
|||
android:bottomRightRadius="30dp" |
|||
android:bottomLeftRadius="30dp" |
|||
android:topLeftRadius="30dp" |
|||
android:topRightRadius="30dp"/> |
|||
</shape> |
@ -0,0 +1,10 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:shape="rectangle" android:padding="10dp"> |
|||
<solid android:color="@color/charcole"/> |
|||
<corners |
|||
android:bottomRightRadius="15dp" |
|||
android:bottomLeftRadius="15dp" |
|||
android:topLeftRadius="15dp" |
|||
android:topRightRadius="15dp"/> |
|||
</shape> |
@ -0,0 +1,117 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
tools:context=".chat.AddContactActivity"> |
|||
|
|||
<EditText |
|||
android:id="@+id/editTextZAddress" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginStart="16dp" |
|||
android:layout_marginTop="16dp" |
|||
android:layout_marginEnd="16dp" |
|||
android:ems="10" |
|||
android:gravity="start|top" |
|||
android:hint="Addresses" |
|||
android:inputType="textMultiLine" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toBottomOf="@+id/divider7" /> |
|||
|
|||
<View |
|||
android:id="@+id/divider5" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="1dp" |
|||
android:layout_marginTop="16dp" |
|||
android:background="?android:attr/listDivider" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintHorizontal_bias="0.0" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toBottomOf="@+id/textView15" /> |
|||
|
|||
<View |
|||
android:id="@+id/divider8" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="1dp" |
|||
android:layout_marginTop="16dp" |
|||
android:background="?android:attr/listDivider" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintHorizontal_bias="0.0" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toBottomOf="@+id/editTextZAddress" /> |
|||
|
|||
<View |
|||
android:id="@+id/divider7" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="1dp" |
|||
android:layout_marginTop="16dp" |
|||
android:background="?android:attr/listDivider" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintHorizontal_bias="0.0" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toBottomOf="@+id/editText_NickName" /> |
|||
|
|||
<EditText |
|||
android:id="@+id/editText_FullName" |
|||
android:layout_width="0sp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginStart="16dp" |
|||
android:layout_marginTop="16dp" |
|||
android:layout_marginEnd="8dp" |
|||
android:ems="10" |
|||
android:hint="Fullname" |
|||
android:inputType="textPersonName" |
|||
app:layout_constraintEnd_toStartOf="@+id/divider9" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toBottomOf="@+id/divider5" /> |
|||
|
|||
<EditText |
|||
android:id="@+id/editText_NickName" |
|||
android:layout_width="0sp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginStart="8dp" |
|||
android:layout_marginTop="16dp" |
|||
android:layout_marginEnd="16dp" |
|||
android:ems="10" |
|||
android:hint="Nickname" |
|||
android:inputType="textPersonName" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintStart_toEndOf="@+id/divider9" |
|||
app:layout_constraintTop_toBottomOf="@+id/divider5" /> |
|||
|
|||
<Button |
|||
android:id="@+id/buttonAddContact" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginTop="16dp" |
|||
android:text="Create Contact" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toBottomOf="@+id/divider8" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/textView15" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginTop="16dp" |
|||
android:text="Add a new Contact" |
|||
android:textSize="24sp" |
|||
android:textStyle="bold" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toTopOf="parent" /> |
|||
|
|||
<View |
|||
android:id="@+id/divider9" |
|||
android:layout_width="1dp" |
|||
android:layout_height="0dp" |
|||
android:background="?android:attr/listDivider" |
|||
android:visibility="invisible" |
|||
app:layout_constraintBottom_toTopOf="@+id/divider7" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toBottomOf="@+id/divider5" /> |
|||
</android.support.constraint.ConstraintLayout> |
@ -0,0 +1,41 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
android:id="@+id/container" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent"> |
|||
|
|||
|
|||
<android.support.v4.widget.SwipeRefreshLayout |
|||
android:id="@+id/swiperefreshChat" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
app:layout_constraintBottom_toTopOf="@+id/nav_view" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toTopOf="parent"> |
|||
|
|||
<include |
|||
android:id="@+id/include" |
|||
layout="@layout/content_chat_list" |
|||
android:layout_width="0dp" |
|||
android:layout_height="0dp" |
|||
app:layout_constraintBottom_toTopOf="@+id/nav_view" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toTopOf="parent" /> |
|||
|
|||
</android.support.v4.widget.SwipeRefreshLayout> |
|||
|
|||
|
|||
<android.support.design.widget.BottomNavigationView |
|||
android:id="@+id/nav_view" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:background="?android:attr/windowBackground" |
|||
app:layout_constraintBottom_toBottomOf="parent" |
|||
app:layout_constraintLeft_toLeftOf="parent" |
|||
app:layout_constraintRight_toRightOf="parent" |
|||
app:menu="@menu/menu_nav" /> |
|||
|
|||
</android.support.constraint.ConstraintLayout> |
@ -0,0 +1,108 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
tools:context=".conversation_item_recive" > |
|||
|
|||
<android.support.constraint.ConstraintLayout |
|||
android:id="@+id/constraintLayout4" |
|||
android:layout_width="0dp" |
|||
android:layout_height="76dp" |
|||
android:background="#2d2d2d" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toTopOf="parent"> |
|||
|
|||
<TextView |
|||
android:id="@+id/textViewContactName2" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginStart="18dp" |
|||
android:text="Peter Parker" |
|||
android:textColor="#ffffff" |
|||
android:textSize="20sp" |
|||
android:textStyle="bold" |
|||
app:layout_constraintBottom_toBottomOf="parent" |
|||
app:layout_constraintStart_toEndOf="@+id/imageProfilePicture2" |
|||
app:layout_constraintTop_toTopOf="parent" /> |
|||
|
|||
<ImageView |
|||
android:id="@+id/imageProfilePicture2" |
|||
android:layout_width="56dp" |
|||
android:layout_height="56dp" |
|||
android:layout_marginStart="16dp" |
|||
android:background="@drawable/profile_image" |
|||
android:visibility="visible" |
|||
app:layout_constraintBottom_toBottomOf="parent" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toTopOf="parent" |
|||
tools:src="@mipmap/ic_launcher_dragon_foreground" |
|||
tools:visibility="visible" /> |
|||
|
|||
</android.support.constraint.ConstraintLayout> |
|||
|
|||
<ScrollView |
|||
android:id="@+id/scrollView3" |
|||
android:layout_width="0dp" |
|||
android:layout_height="0dp" |
|||
app:layout_constraintBottom_toTopOf="@+id/constraintLayout3" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout4"> |
|||
|
|||
<LinearLayout |
|||
android:id="@+id/MessageList" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:orientation="vertical" /> |
|||
</ScrollView> |
|||
|
|||
<android.support.constraint.ConstraintLayout |
|||
android:id="@+id/constraintLayout3" |
|||
android:layout_width="0dp" |
|||
android:layout_height="50dp" |
|||
android:background="@drawable/rounded_corner" |
|||
app:layout_constraintBottom_toBottomOf="parent" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintStart_toStartOf="parent"> |
|||
|
|||
<ImageButton |
|||
android:id="@+id/buttonSend" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="0dp" |
|||
android:layout_marginEnd="5dp" |
|||
android:src="@drawable/send_selector" |
|||
app:layout_constraintBottom_toBottomOf="parent" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintTop_toTopOf="parent" /> |
|||
|
|||
<EditText |
|||
android:id="@+id/userInput" |
|||
android:layout_width="0dp" |
|||
android:layout_height="0dp" |
|||
android:layout_marginStart="10dp" |
|||
android:ems="10" |
|||
android:hint="Click to send a message..." |
|||
android:inputType="textPersonName" |
|||
app:layout_constraintBottom_toBottomOf="parent" |
|||
app:layout_constraintEnd_toStartOf="@+id/buttonSend" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toTopOf="parent" /> |
|||
|
|||
</android.support.constraint.ConstraintLayout> |
|||
|
|||
<TextView |
|||
android:id="@+id/textView_zAddress" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:background="#0AFFFFFF" |
|||
android:text="zAddress" |
|||
android:textAlignment="center" |
|||
android:textSize="8sp" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout4" /> |
|||
|
|||
</android.support.constraint.ConstraintLayout> |
@ -0,0 +1,21 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
android:id="@+id/nestedScrollView" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
app:layout_behavior="@string/appbar_scrolling_view_behavior"> |
|||
|
|||
<ScrollView |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toTopOf="parent"> |
|||
|
|||
<LinearLayout |
|||
android:id="@+id/ChatTable" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:orientation="vertical"/> |
|||
</ScrollView> |
|||
</android.support.constraint.ConstraintLayout> |
@ -0,0 +1,106 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="76dp" |
|||
android:background="#2d2d2d"> |
|||
|
|||
<ImageView |
|||
android:id="@+id/imageProfilePicture" |
|||
android:layout_width="56dp" |
|||
android:layout_height="56dp" |
|||
android:layout_marginStart="16dp" |
|||
android:background="@drawable/profile_image" |
|||
android:visibility="visible" |
|||
app:layout_constraintBottom_toTopOf="@+id/divider6" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toTopOf="parent" |
|||
tools:visibility="visible" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/unread_indicator" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="end|top" |
|||
android:layout_marginTop="1dp" |
|||
android:layout_marginEnd="1dp" |
|||
android:height="20dp" |
|||
android:background="@drawable/rounded_corner" |
|||
android:fontFamily="sans-serif-medium" |
|||
android:gravity="center" |
|||
android:minWidth="20dp" |
|||
android:textColor="#fff" |
|||
android:visibility="gone" |
|||
app:layout_constraintEnd_toEndOf="@+id/imageProfilePicture" |
|||
app:layout_constraintTop_toTopOf="@+id/imageProfilePicture" |
|||
app:lineHeight="1dp" |
|||
tools:text="1" |
|||
tools:visibility="invisible" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/textViewContactName" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginStart="8dp" |
|||
android:layout_marginTop="8dp" |
|||
android:text="Peter Parker" |
|||
android:textColor="#ffffff" |
|||
android:textSize="17sp" |
|||
android:textStyle="bold" |
|||
app:layout_constraintStart_toEndOf="@+id/imageProfilePicture" |
|||
app:layout_constraintTop_toTopOf="parent" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/textViewLastMessage" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginStart="8dp" |
|||
android:layout_marginEnd="35dp" |
|||
android:maxWidth="300dp" |
|||
android:maxLines="2" |
|||
android:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod" |
|||
android:textColor="#aaffffff" |
|||
android:textSize="13sp" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintStart_toEndOf="@+id/imageProfilePicture" |
|||
app:layout_constraintTop_toBottomOf="@+id/textViewContactName" |
|||
tools:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/textViewTime" |
|||
android:layout_width="28dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginTop="8dp" |
|||
android:layout_marginEnd="8dp" |
|||
android:text="10min" |
|||
android:textColor="#fff" |
|||
android:textSize="10sp" |
|||
android:visibility="invisible" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintTop_toTopOf="parent" /> |
|||
|
|||
<ImageView |
|||
android:id="@+id/read_indicator" |
|||
android:layout_width="20dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="center_vertical|end" |
|||
android:layout_marginEnd="8dp" |
|||
android:layout_marginBottom="8dp" |
|||
android:paddingStart="2dp" |
|||
android:src="@drawable/ic_delivery_status_read" |
|||
android:tint="#77ffffff" |
|||
android:visibility="gone" |
|||
app:layout_constraintBottom_toBottomOf="parent" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
tools:visibility="visible" /> |
|||
|
|||
<View |
|||
android:id="@+id/divider6" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="2dp" |
|||
android:background="@color/charcole" |
|||
app:layout_constraintBottom_toBottomOf="parent" |
|||
tools:layout_editor_absoluteX="0dp" /> |
|||
|
|||
</android.support.constraint.ConstraintLayout> |
@ -0,0 +1,38 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
tools:context=".conversation_item_send" > |
|||
|
|||
<TextView |
|||
android:id="@+id/message" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginStart="9dp" |
|||
android:layout_marginTop="10dp" |
|||
android:background="@drawable/chat_background_recive" |
|||
android:maxWidth="260sp" |
|||
android:minWidth="80sp" |
|||
android:paddingLeft="10sp" |
|||
android:paddingTop="10sp" |
|||
android:paddingRight="10sp" |
|||
android:paddingBottom="25sp" |
|||
android:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr" |
|||
android:textColor="@color/message_text" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toTopOf="parent" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/Time2" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginRight="10sp" |
|||
android:layout_marginBottom="5dp" |
|||
android:text="10:15 AM" |
|||
android:textColor="@color/message_text" |
|||
android:textSize="12sp" |
|||
app:layout_constraintBottom_toBottomOf="@+id/message" |
|||
app:layout_constraintEnd_toEndOf="@+id/message" /> |
|||
</android.support.constraint.ConstraintLayout> |
@ -0,0 +1,38 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
tools:context=".conversation_item_send" > |
|||
|
|||
<TextView |
|||
android:id="@+id/message" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginTop="10dp" |
|||
android:layout_marginEnd="9dp" |
|||
android:background="@drawable/chat_background_send" |
|||
android:maxWidth="260sp" |
|||
android:minWidth="80sp" |
|||
android:paddingLeft="10sp" |
|||
android:paddingTop="10sp" |
|||
android:paddingRight="5sp" |
|||
android:paddingBottom="25sp" |
|||
android:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." |
|||
android:textColor="@color/message_text" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintTop_toTopOf="parent" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/Time" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginStart="10dp" |
|||
android:layout_marginBottom="5dp" |
|||
android:text="10:15 AM" |
|||
android:textColor="@color/message_text" |
|||
android:textSize="12sp" |
|||
app:layout_constraintBottom_toBottomOf="@+id/message" |
|||
app:layout_constraintStart_toStartOf="@+id/message" /> |
|||
</android.support.constraint.ConstraintLayout> |
@ -0,0 +1,7 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
|
|||
<item |
|||
android:id="@+id/action_addChat" |
|||
android:title="AddChat" /> |
|||
</menu> |
@ -1,13 +1,28 @@ |
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
tools:context="org.myhush.silentdragon.MainActivity"> |
|||
<item android:id="@+id/action_send" |
|||
android:title="Send" |
|||
android:orderInCategory="300" |
|||
app:showAsAction="never" android:icon="@drawable/send_selector"/> |
|||
<item android:title="Balance" android:id="@+id/action_bal" android:icon="@drawable/balance_selector" |
|||
android:orderInCategory="200"/> |
|||
<item android:title="Receive" android:id="@+id/action_recieve" android:icon="@drawable/receive_selector" |
|||
android:orderInCategory="100"/> |
|||
|
|||
<item android:title="Send" |
|||
android:id="@+id/action_send" |
|||
android:icon="@drawable/send_selector" |
|||
android:tint="@color/white_unselected" |
|||
android:orderInCategory="300"/> |
|||
|
|||
<item android:title="Balance" |
|||
android:id="@+id/action_bal" |
|||
android:icon="@drawable/balance_selector" |
|||
android:tint="@color/white_unselected" |
|||
android:orderInCategory="200"/> |
|||
|
|||
<item android:title="Receive" |
|||
android:id="@+id/action_recieve" |
|||
android:icon="@drawable/receive_selector" |
|||
android:tint="@color/white_unselected" |
|||
android:orderInCategory="100"/> |
|||
|
|||
<item android:title="Chat" |
|||
android:id="@+id/action_chat" |
|||
android:icon="@drawable/ic_keyboard_icon" |
|||
android:tint="@color/white_unselected" |
|||
android:orderInCategory="100"/> |
|||
</menu> |
|||
|
Loading…
Reference in new issue