Bug 29093 - BackgroundColor of an Entry Control Is Ignored on Samsung Devices With TouchWiz
Summary: BackgroundColor of an Entry Control Is Ignored on Samsung Devices With TouchWiz
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 1.4.1
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-04-14 15:03 UTC by Jimmy [MSFT]
Modified: 2015-05-22 19:56 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Repro Project (174.86 KB, application/zip)
2015-04-14 15:03 UTC, Jimmy [MSFT]

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:

Description Jimmy [MSFT] 2015-04-14 15:03:52 UTC
Created attachment 10758 [details]
Repro Project

*** Overview ***
On Samsung devices with TouchWiz, an Entry control will always be rendered with a background color from the TouchWiz theme even if the Entry.BackgroundColor has been set to a different color. TouchWiz seems to always override the BackgroundColor property unless the app has been set to explicitly use one of Android's default themes like Holo.
I tested the attached repro project on a Samsung S4 running Android 4.4.2 and with Forms 1.4.1.

*** Steps to Reproduce ***
1. Open the "EntryTest.cs" file from the repro project and note the Entry's background color has been set to blue on line 27 
2. Run the app on a Samsung device

*** Actual Results ***
The Entry's background color will be a different color than what has been set in the source code. In my test, the background was always black even when I tried changing the color on line 27.

*** Expected Results ***
The Entry control should be rendered with the background color that has been set in the source code regardless of phone model.

*** Additional Info ***
Adding the line:

> [assembly: Application(Theme="@android:style/Theme.Holo")]

to the project's AssemblyInfo.cs file forces the app to use the Holo theme and fixes the issue. Would it be possible to add this line by default when the Android project is created in order to prevent this issue?

*** Environment Info ***
=== Xamarin Studio ===

Version 5.8.3 (build 1)
Installation UUID: 94ce5106-6a72-4691-b34e-cd5857b1db66
	Mono 3.12.1 ((detached/0849ec7)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312010003

=== Xamarin.Android ===

Version: (Business Edition)
Android SDK: /Users/jimmygarrido/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 6.3 (7569)
Build 6D570

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: f7736a4
Build date: 2015-04-09 04:22:08-0400

=== Xamarin.Mac ===

Version: (Business Edition)

=== Build Information ===

Release ID: 508030001
Git revision: 6e8e725e0d689351901c2c70453bfa4ea25e293b
Build date: 2015-04-06 20:31:47-04
Xamarin addins: 051cd5f8c1b5dbfc87eaef80a74aec03f34c60a8

=== Operating System ===

Mac OS X 10.10.3
Darwin Jimmys-MacBook-Pro.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 1 Jason Smith [MSFT] 2015-05-22 19:56:37 UTC
The background color of an entry actually is still setting the background color, it is just below the additional drawing touchwiz is doing. You will need to manage the theme yourself to handle that case if it is important to you. We cant stop the theme from drawing like that really.