ChatMessageView helps you to create chat message view quickly like a typical chatting application. Its a container view, so you can add any type of message such as TextView or any customize TextView, ImageView, etc.
- Can have any child inside of it.
- You can change color of
ChatMessageView
normal and pressed. - Adjustable arrow position (top, bottom, left, right)
- Adjustable arrow gravity (start, end, center)
- Chat view without arrow
add gradle dependency to your dependency list:
dependencies {
compile 'me.himanshusoni.chatmessageview:ChatMessageView:1.0.0'
}
- Include
ChatMessageView
in your xml of adapter view with content inside.
<me.himanshusoni.chatmessageview.ChatMessageView xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:backgroundColor="#88BABABA"
app:backgroundColorPressed="#FFBABABA"
app:cornerRadius="3dp" >
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello" />
...
</me.himanshusoni.chatmessageview.ChatMessageView>
Attributes:
app:arrowGravity="start|end|center"
app:arrowPosition="right|left|top|bottom"
app:arrowMargin="3dp"
app:contentPadding="10dp"
app:backgroundColor="#88BABABA"
app:backgroundColorPressed="#FFBABABA"
app:cornerRadius="3dp"
app:showArrow="true"
Description:
arrowGravity
controls relative position of arrow. possible values arestart
,end
andcenter
. default isleft
.arrowPosition
controls poition of the arrow outside the box. possible values areright
,left
,top
andbottom
. default isleft
.arrowMargin
controls margin of arrow. IfarrowPosition
isleft
orright
it controls top and bottom margin. else it controls left and right margin.contentPadding
adjusts padding of content within the box.backgroundColor
sets background color ofChatMessageView
in normal mode including arrow.backgroundColorPressed
sets background color ofChatMessageView
in pressed mode including arrow.cornerRadius
sets corner radius of the box.showArrow
shows / hides arrow fromChatMessageView
.
================== developed to make programming easy.
by Himanshu Soni ([email protected])