Bug 23985 - Samsung Android devices have problems with Switch controls
Summary: Samsung Android devices have problems with Switch controls
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Seth Rosetter
URL:
Depends on:
Blocks:
 
Reported: 2014-10-22 09:12 UTC by Kevin.Murray
Modified: 2016-06-27 00:03 UTC (History)
23 users (show)

Tags: ac android functional switch devicespecific
Is this bug a regression?: ---
Last known good build:


Attachments
Samsung Switch Bug sample project (3.76 MB, application/x-zip-compressed)
2014-10-22 09:12 UTC, Kevin.Murray
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Kevin.Murray 2014-10-22 09:12:43 UTC
Created attachment 8466 [details]
Samsung Switch Bug sample project

Possibly similar to issue 23908.

Attached find sample project exhibiting the bug. Basically, in a Master/Detail app, when I have a Detail page that uses Navigate.PushAsync to display another page, this page has issues with Switch controls on Samsung devices. Namely, some of them don't even show up.

This code DOES work on the emulator, an LG device, a BLU device...just not Samsung devices (tried a Note 8 tablet and an S5 phone).

The sample app shows a Master/Detail setup. On the Detail page is a + button. Tap that, the "Entry" page should show. On that page should be three (3) switch controls. On my Samsung Note 8, for example, only the middle one shows up (the one not in an embedded StackLayout), and it shows up right justified (all the way on the right of the screen). The other two, StackLayout-ed with Labels, do not show up at all (the Labels show, just not the switches).  This is all in a ScrollView, because this is how our actual app is doing it, because the pages exhibiting the error in our app have more than just this handful of controls on them. So I left it that way (in the ScrollView), in case it is actually a contributing factor.
Comment 1 Arpit Jha 2014-10-27 03:39:02 UTC
We have checked this issue and able to reproduce it with the help of bug description.

We are getting same behavior as mentioned in bug description and observed that at start when switch control page open only one Switch control display but after some time we can see all three switch control.

Screencast regarding same :
http://www.screencast.com/t/VZJzfOowC51a
http://www.screencast.com/t/MWHty0lpLxx

Environment Info:

Device : Samsung Galaxy Note 3

Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Professional


Xamarin   3.7.230.0 (e78d10d6993f95fc3ebe791aeb4aacff165bf8bb)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.18.0.39 (0ef616ae42005ece52f6df7aa1e093ceb11998f8)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.4.0.0 (209abebbd8f1a292d042420edb45fa5fbd3f017b)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 2 Rui Marinho 2014-12-12 13:54:44 UTC
It should be fixed in Xamarin Forms 1.3 pre3, can you try it Kevin? 

Thanks
Comment 4 Kevin.Murray 2015-01-12 09:45:37 UTC
I tried it out, and it still doesn't work on my devices.
Comment 5 Jason Smith [MSFT] 2015-02-05 05:43:36 UTC
Can no longer reproduce in 1.3.3 (there were some fixes in this area so this is not unexpected)

If you still have issues please re-open
Comment 6 Robin van Nooij 2015-02-18 08:36:29 UTC
I did a test with Xamarin.Forms 1.3.4.6332 and still not working on my Samsung Galaxy S3. The Switch control is not visible. 

A SwitchCell is visible, but a Switch is not.
Comment 7 Kevin.Murray 2015-02-25 09:37:06 UTC
Using 1.3.4, the situation is rather worse.  None of the Switch's show up now on my Samsung devices (when under the conditions mentioned).  Before, some might show up, some would initially be hidden but would show when we clicked in an edit control, but now they just don't show at all...
Comment 8 Mo 2015-03-14 14:14:31 UTC
Same problem with 1.4 using Galaxy Tab 4 with API 19.
Has anybody found a workaround?
Comment 9 herzock@web.de 2015-05-11 19:22:59 UTC
Switches are also not working for me.
Comment 10 daniel.moreira 2015-05-12 02:20:24 UTC
Same thing here.

I was testing on a Samsung Galaxy S5 Mini, and the switches don't show up.

But when rotating the screen, they magically appear.
Comment 11 Seth Rosetter 2015-06-02 18:11:32 UTC
The Samsung Note 8 issue seems to be resolved in our current stable (Xamarin.Forms 1.4.2). I have tested with a Samsung Note 8 running Android 4.1.2.

I have confirmed this is still an issue with a Samsung Galaxy Tab 4 running Android 4.4.2 and Xamarin.Forms 1.4.2 (current stable).
Comment 12 Matt Gerber 2015-07-27 14:27:03 UTC
I am also still seeing this behavior (missing switches) on a Samsung Galaxy S3 running Android 4.4.2 with Xamarin Forms 1.4.3.6376. The switches are missing from pages that are pushed onto the navigation stack via Navigation.PushAsync.
Comment 13 Matt Gerber 2015-07-28 09:36:30 UTC
Also, I can confirm that the toggles reappear after switching the orientation of the device from portrait mode to landscape mode (by rotating it). After switching back, the toggles are still present.

Any ideas on a workaround for this?
Comment 14 GregW 2015-08-24 17:44:32 UTC
I am also seeing this issue.

Switch in a StackLayout does not appear on Android.

Samsung Galaxy S5 (Samsung-SM-G900V)
Android 4.4.4
Xamarin Forms 1.4.4.6392

As reported by Matt Gerber, if the screen is rotated 90 degrees the switch view will then appear.

I'd appreciate a resolution to this issue as it's one of the remaining issues in releasing our next app update.
Comment 15 XamarinSnob 2015-10-09 07:51:57 UTC
I can confirm that we're also experiencing this exact same issue.
Comment 16 Matt Gerber 2015-12-22 14:48:05 UTC
Any updates from the Xamarin folks on this? The issue is also breaking my unit tests on the Xamarin Test Cloud. You can see a failed screenshot here:

https://testcloud.xamarin.com/test/sensus_de61ab72-6e63-459f-bfc0-5364dc268280/?step=0_0_1&device=samsung_galaxy_s4-4.4.2

There should be Xamarin Forms switches below the "Enabled" and "Store Data" labels, but the switches are not appearing. Because they're not appearing, my unit test is failing when waiting to interact with these UI elements.
Comment 17 Jason Smith [MSFT] 2016-03-18 08:41:31 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we no longer believe it affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
 
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team
Comment 18 faceoffers28 2016-05-09 15:12:42 UTC
I can confirm that this is still a problem on my Samsung Galaxy 3 test device. In fact, I can confirm that this happens on XF 1.5.0.6446 targeting API 22. I then upgraded over the weekend to XF 2.2.0.31 targeting API 23. I was hoping that this would fix the problem, but it did not. I use a Switch in my SignIn page for the Remember me feature. When I launch the app, the Switch is present. When I click Logout, the Switch is no longer visible on the SignIn page. The Logout code executes this statement. 

await Navigation.PushAsync(new SignIn());

I use two other Switches in my code, but I can't get to them right now. There is an issue with the XLabs Camera code that won't allow me to click on the OffersPage. I was having the same Switch issue on the OffersPage when using XF 1.5.0.6446, so I assume it is still a problem after the upgrade. I can't launch my Android app without a fix for this issue.
Comment 19 faceoffers28 2016-06-19 23:48:38 UTC
This is still an issue on my Samsung Galaxy 3, but you have it marked as "RESOLVED FIXED". For whatever reason, I also can't change the status to reopen the ticket. 

This is holding up my production project. I simply can't submit the Android version of my app to Google Play until this is resolved. Can we get an update on this issue? Thanks in advance!
Comment 20 Torsten 2016-06-20 11:29:24 UTC
Same here! Galaxy Tab SM-T310, Android 4.4.2, Kernel 3.0.31-5927237

The issue still exists
Comment 21 Torsten 2016-06-20 14:23:49 UTC
Workaround: 

//LineStack.Orientation = StackOrientation.Horizontal;

-> then Switch becomes visible :-/
Comment 22 faceoffers28 2016-06-20 14:46:10 UTC
@Torsten Thanks for that! I will try your workaround? Is there a way to set that in XAML? If not, do you have an example of how you have implemented this using C#? Are you using device specific code for Android, for example? I assume that I can somehow mix StackLayouts created in C# with those created in XAML, but I have not tried that yet. Cheers!
Comment 23 Torsten 2016-06-20 15:43:16 UTC
@faceoffers28: https://torstensboard.wordpress.com/2016/06/20/xf-bug-fixing/
Comment 24 faceoffers28 2016-06-27 00:03:55 UTC
@Torsten I tried this, but it doesn't work. Would this be the Xaml equivalent to LineStack.Orientation = StackOrientation.Horizontal;?

<StackLayout Orientation="Horizontal">			
<Switch x:Name="rememberMeSwitch" IsToggled="{Binding RememberMe}" HorizontalOptions="Start" />
</StackLayout>

It would be nice if some folks from Xamarin would respond.