Advertisement
nilspastbin

stackoverflow question

Jun 23rd, 2015
659
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.72 KB | None | 0 0
  1. // this is a main layout of chatting activity
  2. <?xml version="1.0" encoding="utf-8"?>
  3. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4. android:layout_width="match_parent"
  5. android:layout_height="match_parent"
  6. android:background="#FFFFFF"
  7.  
  8. android:orientation="vertical">
  9.  
  10. <RelativeLayout
  11. android:id="@+id/llSend"
  12. android:layout_width="match_parent"
  13. android:layout_height="80dp"
  14. android:layout_alignParentBottom="true"
  15. android:layout_marginBottom="12dp"
  16. android:layout_marginLeft="10dp"
  17. android:layout_marginRight="10dp"
  18. android:layout_marginTop="0dp"
  19. android:background="#FFFFFF">
  20.  
  21. <Button
  22. android:id="@+id/btSend"
  23. android:layout_width="60dp"
  24. android:layout_height="60dp"
  25. android:layout_alignParentRight="true"
  26. android:background="@drawable/button_send" />
  27.  
  28. <ImageView
  29. android:layout_width="60dp"
  30. android:layout_height="60dp"
  31. android:background="@drawable/image_picker"
  32. android:id="@+id/activity_chat_imagview_gallery" />
  33.  
  34. <EditText
  35. android:id="@+id/etMessage"
  36. android:layout_width="match_parent"
  37. android:layout_height="fill_parent"
  38. android:layout_alignBottom="@+id/btSend"
  39. android:layout_toRightOf="@+id/activity_chat_imagview_gallery"
  40. android:layout_toLeftOf="@+id/btSend"
  41. android:background="@drawable/edittext_bg"
  42. android:hint="Write a message..."
  43. android:imeOptions="actionSend"
  44. android:textSize="25sp"
  45. android:inputType="textShortMessage"
  46. android:paddingLeft="7dp"
  47. android:singleLine="true" />
  48. </RelativeLayout>
  49.  
  50.  
  51. <RelativeLayout
  52. android:id="@+id/chat_rly_actionbar"
  53. android:layout_width="match_parent"
  54. android:layout_height="80dp"
  55. android:background="#6E4A92"
  56. android:orientation="horizontal">
  57.  
  58. <Button
  59. android:id="@+id/chat_button_back"
  60. android:layout_width="80dp"
  61. android:layout_height="80dp"
  62. android:layout_alignParentLeft="true"
  63. android:layout_centerInParent="true"
  64. android:background="@drawable/back_icn_nav" />
  65.  
  66. <TextView
  67. android:id="@+id/chat_personal_actionbar_username"
  68. android:layout_width="match_parent"
  69. android:layout_height="80dp"
  70. android:layout_centerHorizontal="true"
  71. android:layout_centerInParent="true"
  72. android:layout_centerVertical="true"
  73. android:layout_marginLeft="100dp"
  74. android:ellipsize="end"
  75. android:gravity="center"
  76. android:maxLines="1"
  77. android:padding="10dp"
  78. android:singleLine="true"
  79. android:text="Nils"
  80. android:textAppearance="?android:attr/textAppearanceLarge"
  81. android:textColor="@color/white"
  82. android:textSize="40dp"
  83. android:textStyle="bold" />
  84.  
  85.  
  86. </RelativeLayout>
  87.  
  88. <Button
  89. android:id="@+id/activity_chat_btn_bookhotel"
  90. android:text="Book your Hotel Now"
  91. android:layout_marginTop="0dp"
  92. android:layout_below="@+id/chat_rly_actionbar"
  93. android:layout_width="match_parent"
  94. android:layout_height="80dp"
  95. android:textColor="@android:color/white"
  96. android:textSize="20sp" />
  97.  
  98. <View
  99. android:id="@+id/view"
  100. android:layout_width="fill_parent"
  101. android:layout_height="1dp"
  102. android:layout_above="@+id/llSend"
  103. android:layout_marginBottom="10dp"
  104. android:background="#C8C8C8" />
  105.  
  106. <ListView
  107. android:id="@+id/lvChat"
  108. android:layout_width="wrap_content"
  109. android:layout_height="match_parent"
  110. android:layout_above="@+id/view"
  111. android:layout_alignParentLeft="true"
  112. android:layout_alignParentRight="true"
  113. android:layout_below="@+id/activity_chat_btn_bookhotel"
  114. android:layout_marginBottom="10dp"
  115. android:background="#FFFFFF"
  116. android:divider="@null"
  117. android:dividerHeight="0dp"
  118. android:transcriptMode="alwaysScroll" />
  119.  
  120.  
  121. <TextView
  122. android:id="@+id/chat_tv_isnewuser"
  123. android:layout_width="wrap_content"
  124. android:layout_height="wrap_content"
  125. android:layout_centerInParent="true"
  126. android:text="Hello..!"
  127. android:textColor="@android:color/black"
  128. android:textSize="30sp" />
  129.  
  130. </RelativeLayout>
  131.  
  132.  
  133.  
  134. //here is my list item of current user
  135.  
  136. <?xml version="1.0" encoding="utf-8"?>
  137. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  138. android:layout_width="match_parent"
  139. android:layout_height="match_parent"
  140. android:background="#FFFFFF"
  141. android:orientation="horizontal">
  142.  
  143. <com.nevada_fortunes.connect_me.RoundedImageView
  144. android:id="@+id/chat_item_ivProfileMe"
  145. android:layout_width="90dp"
  146. android:layout_height="90dp"
  147. android:layout_alignParentLeft="true"
  148. android:layout_gravity="right"
  149. android:layout_marginLeft="10dp"
  150. android:layout_marginTop="5dp"
  151. android:src="@drawable/defualt" />
  152.  
  153. <RelativeLayout
  154. android:layout_width="fill_parent"
  155. android:layout_height="wrap_content"
  156. android:layout_toRightOf="@+id/chat_item_ivProfileMe">
  157.  
  158.  
  159. <ImageView
  160. android:layout_width="45dp"
  161. android:layout_height="45dp"
  162. android:background="@drawable/chat_other_arrow"
  163. android:layout_marginLeft="1dp"
  164. android:layout_marginTop="10dp"
  165. android:layout_alignParentLeft="true" />
  166.  
  167. <LinearLayout
  168. android:layout_width="wrap_content"
  169. android:layout_height="wrap_content"
  170. android:layout_marginLeft="25dp"
  171. android:paddingRight="10dp"
  172. android:layout_marginRight="7dp"
  173. android:layout_marginTop="10dp"
  174. android:background="@drawable/chat_me_back"
  175. android:orientation="vertical">
  176.  
  177.  
  178. <LinearLayout
  179. android:id="@+id/chat_lly_image"
  180. android:layout_width="wrap_content"
  181. android:layout_height="wrap_content"
  182. android:orientation="vertical"
  183. android:layout_marginLeft="10dp"
  184. android:layout_marginTop="10dp"
  185. android:layout_marginBottom="10dp">
  186.  
  187. <TextView
  188. android:id="@+id/chat_item_tv_me_message"
  189. android:layout_width="wrap_content"
  190. android:layout_height="wrap_content"
  191. android:text="Hello Nils..!"
  192. android:textColor="@android:color/white"
  193. android:textSize="30sp" />
  194.  
  195.  
  196. <TextView
  197. android:id="@+id/chat_item_tv_me_time"
  198. android:layout_width="wrap_content"
  199. android:layout_height="wrap_content"
  200. android:layout_gravity="right"
  201. android:layout_marginBottom="0dp"
  202. android:layout_marginRight="5dp"
  203. android:layout_marginTop="0dp"
  204. android:layout_marginLeft="5dp"
  205. android:text="Time"
  206. android:textAppearance="?android:attr/textAppearanceSmall"
  207. android:textColor="#D7D7D7"
  208. android:textSize="23sp" />
  209.  
  210. </LinearLayout>
  211. </LinearLayout>
  212.  
  213.  
  214. </RelativeLayout>
  215. </RelativeLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement