This is a migrated thread and some comments may be shown as answers.

Swipe Button Trigger works on iOS and not Android

5 Answers 68 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Trevor
Top achievements
Rank 1
Trevor asked on 02 Nov 2017, 06:41 PM

I have a swipe button that is connected to a clicked trigger to change the text and button. On iOS it only changes the color and text of the specific button that was pressed. On Android, it changes all of the buttons colors and text. This is how I have the trigger setup:

<Button.Triggers>
    <EventTrigger Event="Clicked">
        <local:TasksButtonTriggerAction />
    </EventTrigger>
</Button.Triggers>

 

And this is the TasksButtonTriggerAction implementation:

public class TasksButtonTriggerAction : TriggerAction<Button>
    {
        protected override void Invoke(Button sender)
        {
            if (sender.Text.ToLower() == "start")
            {
                sender.BackgroundColor = Color.Red;
                sender.Text = "Complete";
                sender.TextColor = Color.White;
            }
            else
            {
                sender.BackgroundColor = Color.FromHex("#80BD01");
                sender.Text = "Start";
                sender.TextColor = Color.FromHex("#15315A");
            }
             
        }
    }

 

5 Answers, 1 is accepted

Sort by
0
Trevor
Top achievements
Rank 1
answered on 02 Nov 2017, 06:42 PM
The Trigger should only change the text and color of Button that was pressed, and not all of them. I am not sure if this is an Telerik UI or Xamarin.Forms issue
0
Stefan Nenchev
Telerik team
answered on 07 Nov 2017, 12:22 PM
Hi, Trevor,

I am not sure of your exact scenario and how it related to the controls from the Telerik UI for Xamarin suite, however, it seems like a more general issue with styling the buttons. Anyway, I tried reproducing it but could not in a sample from my end. Please have a look at the attached sample.

Regards,
Stefan Nenchev
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Trevor
Top achievements
Rank 1
answered on 07 Nov 2017, 05:53 PM
I still see the error in your sample. I tried on a Genymotion emulator and real device. If you swipe the first cell, tap it, then swipe the second cell, only the first cell should say complete, but in reality they both say complete. And if you go even further down the list, you will realize they all say complete. This does not happen on iOS. Also, I tested this functionality on a Xamarin.Forms ListView, and this did not happen. So I am lead to believe it is a potential RadListView issue and how Android renders cells. I did not do anything to the project, just opened it, added the latest Telerik UI for Xamarin Nuget package, and ran it. Here is a video of what I am seeing
0
Stefan Nenchev
Telerik team
answered on 10 Nov 2017, 02:24 PM
Hi, Trevor,

Thank you for the clarification. Indeed, I was able to reproduce the issue. We will need some more time to investigate the behavior and get more information on what might be causing it. I will update the thread once we have such information.

Regards,
Stefan Nenchev
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Stefan Nenchev
Telerik team
answered on 21 Nov 2017, 03:53 PM
Hi, Trevor,

Thank you for your patience. Unfortunately, we could not easily identify the reason behind the behavior so I have logged it as a bug report at our end. You can track its progress on the following link from our Ideas & Feedback portal - ListView: [Android]Changing SwipeContent of one item affects the content of all items within the RadListView. Please subscribe to the item by following it in order to receive automatic notifications. I have also added some points to your account for bringing up the issue.

Have a great rest of the week. 

Regards,
Stefan Nenchev
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ListView
Asked by
Trevor
Top achievements
Rank 1
Answers by
Trevor
Top achievements
Rank 1
Stefan Nenchev
Telerik team
Share this question
or