Browse Source

Add chat gui

chat
N1CK145 5 years ago
parent
commit
96cce88664
  1. 7
      app/src/main/AndroidManifest.xml
  2. 8
      app/src/main/java/org/myhush/silentdragon/MainActivity.kt
  3. 67
      app/src/main/java/org/myhush/silentdragon/chat/ChatActivity.kt
  4. 40
      app/src/main/java/org/myhush/silentdragon/chat/ChatItemFragment.kt
  5. 45
      app/src/main/java/org/myhush/silentdragon/chat/ConversationActivity.kt
  6. 17
      app/src/main/java/org/myhush/silentdragon/conversation_item_recive.kt
  7. 17
      app/src/main/java/org/myhush/silentdragon/conversation_item_send.kt
  8. 10
      app/src/main/res/drawable/chat_background_recive.xml
  9. 10
      app/src/main/res/drawable/chat_background_send.xml
  10. 9
      app/src/main/res/layout/activity_chat.xml
  11. 108
      app/src/main/res/layout/activity_conversation.xml
  12. 59
      app/src/main/res/layout/content_chat_list.xml
  13. 76
      app/src/main/res/layout/content_main.xml
  14. 13
      app/src/main/res/layout/fragment_chat_item.xml
  15. 20
      app/src/main/res/layout/fragment_conversation_item_recive.xml
  16. 21
      app/src/main/res/layout/fragment_conversation_item_send.xml
  17. 18
      app/src/main/res/menu/menu_nav.xml
  18. 2
      app/src/main/res/values/colors.xml
  19. 97
      app/src/main/res/values/strings.xml

7
app/src/main/AndroidManifest.xml

@ -17,13 +17,10 @@
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:allowBackup">
<activity android:name=".chat.ConversationActivity"></activity>
<activity
android:name=".chat.ChatActivity"
android:label="@string/title_activity_chat"></activity>
<activity
android:name=".chat.ChatListActivity"
android:label="@string/title_activity_chat_list"
android:theme="@style/AppTheme.NoActionBar" />
android:label="@string/title_activity_chat" />
<activity
android:name=".SettingsActivity"
android:label="@string/title_activity_settings"

8
app/src/main/java/org/myhush/silentdragon/MainActivity.kt

@ -88,13 +88,13 @@ class MainActivity : AppCompatActivity(),
return@setOnNavigationItemSelectedListener true
}
R.id.action_bal -> true
R.id.action_recieve -> {
val intent = Intent(this, ReceiveActivity::class.java)
R.id.action_chat -> {
val intent = Intent(this, ChatActivity::class.java)
startActivity(intent)
return@setOnNavigationItemSelectedListener true
}
R.id.action_chat -> {
val intent = Intent(this, ChatActivity::class.java)
R.id.action_recieve -> {
val intent = Intent(this, ReceiveActivity::class.java)
startActivity(intent)
return@setOnNavigationItemSelectedListener true
}

67
app/src/main/java/org/myhush/silentdragon/chat/ChatActivity.kt

@ -1,26 +1,67 @@
package org.myhush.silentdragon.chat
import android.content.Intent
import android.os.Bundle
import android.support.design.widget.BottomNavigationView
import android.support.v4.app.FragmentTransaction
import android.support.v7.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_chat.*
import org.myhush.silentdragon.MainActivity
import org.myhush.silentdragon.R
import org.myhush.silentdragon.ReceiveActivity
import org.myhush.silentdragon.SendActivity
class ChatActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_chat)
val navView: BottomNavigationView = findViewById(R.id.nav_view)
/*val navController = findNavController(R.id.nav)
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
val appBarConfiguration = AppBarConfiguration(
setOf(
R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications
)
)
setupActionBarWithNavController(navController, appBarConfiguration)
navView.setupWithNavController(navController)*/
initListener()
restoreSoonChats()
//TODO: restoreSoonChats()
//TODO: restoreSoonChats()
}
private fun restoreSoonChats() {
addChat("Nil", "Armstrong")
addChat("Peter", "Parker")
addChat("Mark", "Zuckerberg")
}
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
}
}
}
}
fun addChat(firstName: String, lastName: String){
val fragment = ChatItemFragment()
val fragTx: FragmentTransaction = supportFragmentManager.beginTransaction()
fragment.firstName = firstName
fragment.lastName = lastName
fragTx.add(R.id.ChatTable, fragment)
fragTx.commit()
}
}

40
app/src/main/java/org/myhush/silentdragon/chat/ChatItemFragment.kt

@ -0,0 +1,40 @@
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 org.myhush.silentdragon.R
class ChatItemFragment : Fragment() {
var firstName: String = ""
var lastName: String = ""
var lastMessage: String = "No messages..."
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)
startActivity(intent)
}
}
fun updateData(){
v!!.findViewById<TextView>(R.id.textViewContactName).text = "$firstName $lastName"
v!!.findViewById<TextView>(R.id.textViewLastMessage).text = lastMessage
}
}

45
app/src/main/java/org/myhush/silentdragon/chat/ConversationActivity.kt

@ -0,0 +1,45 @@
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 org.myhush.silentdragon.R
import org.myhush.silentdragon.conversation_item_recive
import org.myhush.silentdragon.conversation_item_send
class ConversationActivity : AppCompatActivity() {
var displayName = "Peter Parker"
var messages = HashMap<Boolean, String>()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_conversation)
findViewById<TextView>(R.id.textViewContactName2)
//restoreChat()
}
private fun restoreChat(){
addMessage("Lorem Ipsum", true)
addMessage("Lorem Ipsum", true)
addMessage("Lorem Ipsum", true)
addMessage("Lorem Ipsum", true)
}
fun addMessage(message: String, recived: Boolean){
val fragTx: FragmentTransaction = supportFragmentManager.beginTransaction()
if(recived){
val fragment = conversation_item_recive()
fragTx.add(R.id.MessageList, fragment)
}else{
val fragment = conversation_item_send()
fragTx.add(R.id.MessageList, fragment)
}
fragTx.commit()
}
}

17
app/src/main/java/org/myhush/silentdragon/conversation_item_recive.kt

@ -0,0 +1,17 @@
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
class conversation_item_recive : Fragment() {
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)
return v
}
}

17
app/src/main/java/org/myhush/silentdragon/conversation_item_send.kt

@ -0,0 +1,17 @@
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
class conversation_item_send : Fragment() {
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)
return v
}
}

10
app/src/main/res/drawable/chat_background_recive.xml

@ -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>

10
app/src/main/res/drawable/chat_background_send.xml

@ -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>

9
app/src/main/res/layout/activity_chat.xml

@ -6,9 +6,12 @@
android:layout_height="match_parent">
<include
android:id="@+id/include"
layout="@layout/content_chat_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
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" />
@ -16,8 +19,6 @@
android:id="@+id/nav_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"

108
app/src/main/res/layout/activity_conversation.xml

@ -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:visibility="visible" />
</android.support.constraint.ConstraintLayout>
<ScrollView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="10dp"
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">
<fragment
android:id="@+id/fragment2"
android:name="org.myhush.silentdragon.conversation_item_send"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout="@layout/fragment_conversation_item_send" />
<fragment
android:id="@+id/fragment"
android:name="org.myhush.silentdragon.conversation_item_recive"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout="@layout/fragment_conversation_item_recive" />
</LinearLayout>
</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:inputType="textPersonName"
android:text="Send a message...."
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>
</android.support.constraint.ConstraintLayout>

59
app/src/main/res/layout/content_chat_list.xml

@ -14,64 +14,9 @@
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:id="@+id/ChatTable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
layout="@layout/conversation_list_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include
layout="@layout/conversation_list_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include
layout="@layout/conversation_list_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include
layout="@layout/conversation_list_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include
layout="@layout/conversation_list_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include
layout="@layout/conversation_list_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include
layout="@layout/conversation_list_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include
layout="@layout/conversation_list_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include
layout="@layout/conversation_list_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include
layout="@layout/conversation_list_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include
layout="@layout/conversation_list_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
android:orientation="vertical"/>
</ScrollView>
</android.support.constraint.ConstraintLayout>

76
app/src/main/res/layout/content_main.xml

@ -89,49 +89,49 @@
</ScrollView>
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="364dp" app:layout_constraintTop_toBottomOf="@+id/imageView3"
android:layout_marginBottom="32dp" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginTop="32dp" android:layout_marginStart="8dp" android:layout_marginEnd="8dp"
android:id="@+id/layoutConnect">
android:layout_width="match_parent"
android:layout_height="364dp" app:layout_constraintTop_toBottomOf="@+id/imageView3"
android:layout_marginBottom="32dp" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginTop="32dp" android:layout_marginStart="8dp" android:layout_marginEnd="8dp"
android:id="@+id/layoutConnect">
<ImageView
android:layout_width="72dp"
android:layout_height="72dp"
android:src="@mipmap/ic_silent_dragon_round"
android:id="@+id/imageView5" app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintVertical_bias="0.22000003" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
android:layout_width="72dp"
android:layout_height="72dp"
android:src="@mipmap/ic_silent_dragon_round"
android:id="@+id/imageView5" app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintVertical_bias="0.22000003" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<Button
android:text="Scan QR Code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnConnect" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/imageView5"/>
android:text="Scan QR Code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnConnect" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/imageView5"/>
<TextView
android:text="OR"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/lblConnectionOr" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/btnConnect" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:textAlignment="center"/>
android:text="OR"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/lblConnectionOr" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/btnConnect" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:textAlignment="center"/>
<Button
android:text="Reconnect"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnReconnect" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/lblConnectionOr" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp"/>
android:text="Reconnect"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnReconnect" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/lblConnectionOr" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp"/>
</android.support.constraint.ConstraintLayout>
<android.support.design.widget.BottomNavigationView
android:layout_width="match_parent"

13
app/src/main/res/layout/conversation_list_item_view.xml → app/src/main/res/layout/fragment_chat_item.xml

@ -11,9 +11,9 @@
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
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" />
@ -31,10 +31,12 @@
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:text="1"
tools:visibility="invisible" />
<TextView
android:id="@+id/textViewContactName"
@ -51,14 +53,16 @@
<TextView
android:id="@+id/textViewLastMessage"
android:layout_width="300dp"
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" />
@ -94,9 +98,8 @@
android:id="@+id/divider6"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="8dp"
android:background="@color/charcole"
app:layout_constraintTop_toBottomOf="@+id/textViewLastMessage"
app:layout_constraintBottom_toBottomOf="parent"
tools:layout_editor_absoluteX="0dp" />
</android.support.constraint.ConstraintLayout>

20
app/src/main/res/layout/fragment_conversation_item_recive.xml

@ -0,0 +1,20 @@
<?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_marginTop="2dp"
android:background="@drawable/chat_background_recive"
android:maxWidth="260sp"
android:padding="10sp"
android:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>

21
app/src/main/res/layout/fragment_conversation_item_send.xml

@ -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"
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="2dp"
android:layout_marginEnd="9dp"
android:background="@drawable/chat_background_send"
android:maxWidth="260sp"
android:padding="10sp"
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."
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>

18
app/src/main/res/menu/menu_nav.xml

@ -1,30 +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"
android:iconTint="@color/white_unselected"
app:showAsAction="never"
android:icon="@drawable/send_selector"/>
<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:iconTint="@color/white_unselected"
android:tint="@color/white_unselected"
android:orderInCategory="200"/>
<item android:title="Receive"
android:id="@+id/action_recieve"
android:icon="@drawable/receive_selector"
android:iconTint="@color/white_unselected"
android:tint="@color/white_unselected"
android:orderInCategory="100"/>
<item android:title="Chat"
android:id="@+id/action_chat"
android:icon="@drawable/ic_keyboard_icon"
android:iconTint="@color/white_unselected"
android:tint="@color/white_unselected"
android:orderInCategory="100"/>
</menu>

2
app/src/main/res/values/colors.xml

@ -10,4 +10,6 @@
<color name="white_unselected">#66FFFFFF</color>
<color name="charcole">#36454f</color>
<color name="message_send">#aa007878</color>
<color name="message_recive">#aa00bbbb</color>
</resources>

97
app/src/main/res/values/strings.xml

@ -83,99 +83,6 @@
<string name="pref_ringtone_silent">Silent</string>
<string name="pref_title_vibrate">Vibrate</string>
<string name="title_activity_main2">Main2Activity</string>
<string name="title_home">Home</string>
<string name="title_dashboard">Dashboard</string>
<string name="title_notifications">Notifications</string>
<string name="title_activity_chat_list">ChatListActivity</string>
<string name="large_text">
"Material is the metaphor.\n\n"
"A material metaphor is the unifying theory of a rationalized space and a system of motion."
"The material is grounded in tactile reality, inspired by the study of paper and ink, yet "
"technologically advanced and open to imagination and magic.\n"
"Surfaces and edges of the material provide visual cues that are grounded in reality. The "
"use of familiar tactile attributes helps users quickly understand affordances. Yet the "
"flexibility of the material creates new affordances that supercede those in the physical "
"world, without breaking the rules of physics.\n"
"The fundamentals of light, surface, and movement are key to conveying how objects move, "
"interact, and exist in space and in relation to each other. Realistic lighting shows "
"seams, divides space, and indicates moving parts.\n\n"
"Bold, graphic, intentional.\n\n"
"The foundational elements of print based design typography, grids, space, scale, color, "
"and use of imagery guide visual treatments. These elements do far more than please the "
"eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge "
"imagery, large scale typography, and intentional white space create a bold and graphic "
"interface that immerse the user in the experience.\n"
"An emphasis on user actions makes core functionality immediately apparent and provides "
"waypoints for the user.\n\n"
"Motion provides meaning.\n\n"
"Motion respects and reinforces the user as the prime mover. Primary user actions are "
"inflection points that initiate motion, transforming the whole design.\n"
"All action takes place in a single environment. Objects are presented to the user without "
"breaking the continuity of experience even as they transform and reorganize.\n"
"Motion is meaningful and appropriate, serving to focus attention and maintain continuity. "
"Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n"
"3D world.\n\n"
"The material environment is a 3D space, which means all objects have x, y, and z "
"dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the "
"positive z-axis extending towards the viewer. Every sheet of material occupies a single "
"position along the z-axis and has a standard 1dp thickness.\n"
"On the web, the z-axis is used for layering and not for perspective. The 3D world is "
"emulated by manipulating the y-axis.\n\n"
"Light and shadow.\n\n"
"Within the material environment, virtual lights illuminate the scene. Key lights create "
"directional shadows, while ambient light creates soft shadows from all angles.\n"
"Shadows in the material environment are cast by these two light sources. In Android "
"development, shadows occur when light sources are blocked by sheets of material at "
"various positions along the z-axis. On the web, shadows are depicted by manipulating the "
"y-axis only. The following example shows the card with a height of 6dp.\n\n"
"Resting elevation.\n\n"
"All material objects, regardless of size, have a resting elevation, or default elevation "
"that does not change. If an object changes elevation, it should return to its resting "
"elevation as soon as possible.\n\n"
"Component elevations.\n\n"
"The resting elevation for a component type is consistent across apps (e.g., FAB elevation "
"does not vary from 6dp in one app to 16dp in another app).\n"
"Components may have different resting elevations across platforms, depending on the depth "
"of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n"
"Responsive elevation and dynamic elevation offsets.\n\n"
"Some component types have responsive elevation, meaning they change elevation in response "
"to user input (e.g., normal, focused, and pressed) or system events. These elevation "
"changes are consistently implemented using dynamic elevation offsets.\n"
"Dynamic elevation offsets are the goal elevation that a component moves towards, relative "
"to the component’s resting state. They ensure that elevation changes are consistent "
"across actions and component types. For example, all components that lift on press have "
"the same elevation change relative to their resting elevation.\n"
"Once the input event is completed or cancelled, the component will return to its resting "
"elevation.\n\n"
"Avoiding elevation interference.\n\n"
"Components with responsive elevations may encounter other components as they move between "
"their resting elevations and dynamic elevation offsets. Because material cannot pass "
"through other material, components avoid interfering with one another any number of ways, "
"whether on a per component basis or using the entire app layout.\n"
"On a component level, components can move or be removed before they cause interference. "
"For example, a floating action button (FAB) can disappear or move off screen before a "
"user picks up a card, or it can move if a snackbar appears.\n"
"On the layout level, design your app layout to minimize opportunities for interference. "
"For example, position the FAB to one side of stream of a cards so the FAB won’t interfere "
"when a user tries to pick up one of cards.\n\n"
</string>
<string name="title_activity_chat">ChatActivity</string>
<string name="title_activity_chat_list">Chat List</string>
<string name="title_activity_chat">Hush Chat</string>
</resources>

Loading…
Cancel
Save