Telerik Forums
UI for Xamarin Forum
0 answers
892 views

Hello,

 

I have a problem when the keyboard pops up and the ChatEntry input box pops up with the keyboard. The text does not appear in it.

On the other hand, when the tablet keyboard is closed, the text entered before is displayed correctly in the area.

This is a display bug that I reproduced with your example of ConvertionalUI. Do you have a solution, I'm looking in vain?

 

Thank you

 

PS : See the screenshots to show the problem.

Guittier
Top achievements
Rank 1
 asked on 21 Jan 2022
0 answers
73 views

Good Day 

 i use ControlTemplate to customize the chat UI the way i want it and all is working well. im now creating the ability to delete chat messages and that works fine but the problem i have to reload the list of chat which is not good. i want to only delete a chat item 

 

This is how i load my chat , when the chat window is opened


                            Author senderitem = new Author();
                            senderitem.Name = m.AUTHOR;
                            TextMessage textMessage = new TextMessage();
                            textMessage.Data = m;
                            textMessage.Author = senderitem;
                            textMessage.Text = Functions.DecodeString(m.CHAT_MESSAGE);

                            Device.BeginInvokeOnMainThread(() =>
                            {
                                chat.Items.Add(textMessage);
                                 chat.AutoScrollMode = AutoScrollMode.Always;
                            });

              This works well . now i use a Swipe View to get Delete which carries the Message_ID , and i just go delete the record in the database  and that works well. My issue is that after deleting i dont want to reload the loadchat list again , i want to remove only the one that was deleted 

 

How do i use Removeat(), if i am using a Template , how do i get an index of this chat item , because the Message_ID is just a model field 

i have tried this but it does not 

 chat.Items.RemoveAt(model.CHAT_MESSAGES_ID);

which will obviously fail if the index is not correct. 

 

Thanks

                                               
Vuyiswa
Top achievements
Rank 2
 asked on 03 Aug 2021
1 answer
358 views

Hi,

I am exploring RadChat for Xamarin forms and wanted to know what is the most efficient way for:

  1. saving the chat messages to a database
  2. loading existing messages for a chat

Thanks,

Abhi

Lance | Manager Technical Support
Telerik team
 updated answer on 16 Jun 2021
7 answers
360 views

I use the RadChat control within a simple page in full size (no padding) on android.

When I tab the input message box, the keyboard shows up and the complete control is moving up without resizing.

This means the recent message is not visible (if it is a new conversation). How can I adjust the control resize behaviour that the keyboard is not hiding the messages?

 

Also how can I activate a whatsapp like scrollbar at the right side?

Yana
Telerik team
 answered on 02 Mar 2021
1 answer
96 views

 

 

I'm using RadChat control.
I use MVVM approach to bind the control's ItemSource to an ObservableCollection property in my ViewModel.

So in my xaml I have something like this:

<telerikConversationalUI:RadChat
     Author="{Binding Me}"
     ItemsSource="{Binding Messages}"
     ItemConverter="{StaticResource SimpleChatItemConverter}"
     SendMessageCommand="{Binding SendMessageTappedCommand}"
     ItemTemplateSelector="{StaticResource MyChatItemTemplateSelector}"
     ControlTemplate="{StaticResource RadChat_ControlTemplate}"
 >

 

In my ViewModel I have something like this:

public ObservableCollection<CustomMessage> Messages { set; get; }

I have CustomMessage class which contains additional properties like MessagePostedDate (which is of type DateTime, it contains the DateTime of when the message was posted)

I've also bound SendMessageCommand in RadChat control to a command (SendMessageTappedCommand) in my ViewModel.

What I've noticed is that when the Send button is tapped, the component automatically adds a new TextMessage (with Text property set to whatever the user typed) to the list, and only then does it call the SendMessageTappedCommand in my ViewModel. However, I do not want the automatic addition of a new TextMessage since I add a new CustomMessage item to Messages collection, which is bound to the RadChat control, and the SimpleChatItemConverter (which I've bound to ItemConverter of the RadChat control) converts that CustomMessage, and displays the posted date.

So the problem is everytime the user inputs a message and clicks on Send, the message ends up showing twice. First one shows up without the posted date (because a new TextMessage is automatically appended by the component), and the second message is with posted date, which was added by my SendMessageTappedCommand.

How do I stop the automatic creation of a new TextMessage when user taps on Send button?

Yana
Telerik team
 answered on 01 Mar 2021
1 answer
50 views
Do you have an example on how to customize look and feel for TimeBreak using a template?
Yana
Telerik team
 answered on 21 Sep 2020
1 answer
95 views
Is there a way to programmatically know once we load the chat and scroll up that we have loaded all of the messages and need to load more from the past? Like a pull to refresh.. Not able to locate any event pertaining to scroll for the control..
Didi
Telerik team
 answered on 18 Sep 2020
1 answer
69 views

Hi,

I am using RadChat control on a ContentView with the top navigation bar. On iOS, when the keyboard appears, the control scrolls correctly with the top navigation bar visible all the time. On android, however, as soon as the keyboard appears for the user to start typing, the whole view scrolls resulting on the top navigation bar to slide too. Is there a workaround that you would suggest for only the control to scroll and not the whole view?

 

Thanks

Yana
Telerik team
 answered on 20 Aug 2020
1 answer
80 views

Hi,

I am trying to set custom font defined as a style in the xaml for ChatEntry. It throws error at execution time. I know there have been issues reported with fontfamily setup in the past, has it been resolved yet? Secondly, we need ChatEntry text to wrap and not be a free floating entry field, is there wordwrap/multiline ChatEntry setup possible?

Didi
Telerik team
 answered on 17 Aug 2020
2 answers
88 views

Good Day 

i have a control template define like the one below . Inside the ControlTemplate  there is ChatEntry control named "txtchatmessage" and a TextChanged event handler named txtchatmessage_TextChanged and Focus , when i enter text this even does not get fired 

 

<p> private void Txtchatmessage_TextChanged(object sender, TextChangedEventArgs e)<br>
        {<br>
          //my logic<br>
         }</p> <p></p>

 

  <ControlTemplate x:Key="CustomChatControlTemplate"><br>
                <Grid telerikInput:KeyboardHelper.IsTranslationTarget="True" <br>
              RowSpacing="2"> <br>
                    <Grid.RowDefinitions><br>
                        <RowDefinition /><br>
                        <RowDefinition Height="Auto" /><br>
                        <RowDefinition Height="Auto" /><br>
                    </Grid.RowDefinitions><br>
                    <Image HorizontalOptions="FillAndExpand" x:Name="ctr1" VerticalOptions="FillAndExpand" Aspect="AspectFill" Source="chat_background.png"   /> <br>
<br>
                    <Grid Grid.Row="2"  Padding="5, 0, 0, 0"><br>
                        <Grid.ColumnDefinitions> <br>
                            <ColumnDefinition Width="Auto" /><br>
                            <ColumnDefinition Width="Auto" /><br>
                        </Grid.ColumnDefinitions><br>
<br>
                        <StackLayout Orientation="Vertical"   BackgroundColor="White" ><br>
                             <StackLayout  Orientation="Horizontal"  BackgroundColor="Transparent"> <br>
                                <telerikConversationalUI:ChatEntry       x:Name="txtchatmessage"  Keyboard="Chat"  TextChanged="txtchatmessage_TextChanged"  <br>
                    HorizontalOptions="StartAndExpand" WidthRequest="280"     <br>
                    telerikInput:KeyboardHelper.IsTranslationSource="True" /><br>
<br>
                                     <StackLayout Orientation="Horizontal"><br>
                                    <Button x:Name="btnattach"  <br>
                                        ImageSource="attach_final.png"<br>
                                        BackgroundColor="Transparent" <br>
                                        WidthRequest="30" <br>
                                                Clicked="btnattach_Clicked"<br>
                                        HeightRequest="30"<br>
                                        VerticalOptions="Center" /><br>
 <br>
                            <Button <br>
                                        ImageSource="send_final.png" <br>
                                        BackgroundColor="Transparent" <br>
                                        Clicked="chat_send"<br>
                                        x:Name="btnsend"  <br>
                                        WidthRequest="30"<br>
                                        HeightRequest="30"<br>
                                        VerticalOptions="Center" /><br>
                                </StackLayout> <br>
                            <br>
                        </StackLayout><br>
                        </StackLayout><br>
                    </Grid><br>
                </Grid><br>
            </ControlTemplate>

 

this controlTemplate is defined in 

  <VisualElement.Resources>     
     <ResourceDictionary>

and used in the chat control like this 

         <telerikConversationalUI:RadChat x:Name="chat"  Grid.Row="1"  <br>                                    AutoScrollMode="Automatic"   SendMessageButtonImage="" ControlTemplate="{StaticResource RadChat_ControlTemplate}">
Vuyiswa
Top achievements
Rank 2
 answered on 30 Jun 2020
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?