Skip to content

SvTitov/ChatView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xamarin Forms - ChatView

ChatView decides some things when working with chat such as reverse stack, long click on the cell, update the view.

Images

ScreenshotDroidScreenshotiOS

Getting Started

Install ChatView to core, android, ios projects.

Add namespace to page

xmlns:chatview="clr-namespace:ChatView.Shared;assembly=ChatView.Shared"

And use

<chatview:MessageListView 
    ItemsSource="{Binding List}"
    VerticalOptions="FillAndExpand"
    HorizontalOptions="FillAndExpand">
    <chatview:MessageListView.ItemTemplate>
        <DataTemplate>
            <chatview:MessageCell 
                TextFontSize="14"
                InfoFontSize="10"
                NameFontSize="16"
                CornerRadius="16"
                IncomingColor="#827717"
                OutgoingColor="#689F38"
                TextFontColor="#4E342E"
                NameFontColor="#FF3D00"
                InfoFontColor="#607D8B"
                MessageBody="{Binding Message}"
                Date="{Binding Date}"
                IsIncoming="{Binding IsIncoming}"
                Name="{Binding Name}"
                Status="{Binding Status}"/>
        </DataTemplate>
    </chatview:MessageListView.ItemTemplate>
</chatview:MessageListView>

Add MessageListViewRenderer.Initialize(); into MainActivity - OnCreate

Add MessageListViewRenderer.Initialize(); into AppDelegate - FinishedLaunching

API Reference

Property Description
TextFontSize Size for messages text
InfoFontSize Size for date and status text
NameFontSize Size for name text
CornerRadius The property for smoothing the corners of the message frame
IncomingColor Color of incoming message
OutgoingColor Color of outgoing message
TextFontColor Color of messages text
NameFontColor Color of name text
InfoFontColor Color of date and status text

Events

Name Description
OnLongClick Handle long click on cell. Returns model as object.

NuGet

https://www.nuget.org/packages/XF.ChatView/

License

This project is licensed under the MIT License - see the LICENSE file for details

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages