Bug 31987 - [Android] Tabs on HTC One X with Android version 4.1.1 are displaying wrong color
Summary: [Android] Tabs on HTC One X with Android version 4.1.1 are displaying wrong c...
Status: RESOLVED UPSTREAM
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 5.1
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2015-07-15 16:37 UTC by Amalia
Modified: 2015-07-17 20:10 UTC (History)
3 users (show)

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


Attachments
Test case (35.60 KB, application/zip)
2015-07-15 16:37 UTC, Amalia
Details
Updated Java test case that shows the same problem (90.71 KB, application/zip)
2015-07-17 19:18 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details
Screen capture from the updated Java test case (21.92 KB, image/png)
2015-07-17 19:19 UTC, Brendan Zagaeski (Xamarin Team, assistant)
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 UPSTREAM

Description Amalia 2015-07-15 16:37:21 UTC
Created attachment 12048 [details]
Test case

### Overview

When Xamarin.Android applications with tabs are run on a physical HTC One X with Android version 4.1.1, the selected tab is white with white text instead of black with white text like it's supposed to be.

This has been tested on several devices and the tabs display correctly on all of them: Physical HTC One M9 with Android version 5.0.2, physical Galaxy Nexus with Android version 4.0.4, simulator HTC One X with Android version 4.1.1

I also wrote a Java app in Android Studio with the same basic tabs, and it works correctly on the HTC One X with Android version 4.1.1.
Java app: https://www.dropbox.com/s/8uvq116duwrbzc0/JavaTabs.zip?dl=0


### Steps to reproduce

1) Download and open the attached app (SamplePlainAndroid)

2) Run the app on a physical HTC One with Android version 4.1.1

3) Click on the tabs


### Expected results

The selected tab is highlighted as expected (blue-black)


### Actual results

The selected tab is white with white text


### Additional information

=== Xamarin Studio ===

Version 5.9.4 (build 5)
Installation UUID: 1f52eea2-a387-4a2c-96c1-4637c8f8567a
Runtime:
	Mono 4.0.2 ((detached/c99aa0c)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400020005

=== Apple Developer Tools ===

Xcode 6.3.2 (7718)
Build 6D2105

=== Xamarin.Android ===

Version: 5.1.4.16 (Enterprise Edition)
Android SDK: /Users/amalias/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		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

=== Xamarin.iOS ===

Version: 8.10.3.2 (Enterprise Edition)
Hash: 8b265d6
Branch: master
Build date: 2015-06-30 15:19:13-0400

=== Xamarin.Mac ===

Version: 2.0.2.35 (Enterprise Edition)

=== Build Information ===

Release ID: 509040005
Git revision: 8010a90f6e246b32364e3fb46ef2c9d1be9c9a2b
Build date: 2015-06-08 16:52:06-04
Xamarin addins: 7e93e9c3503f28770f23ce1b7eafd829919f18e8

=== Operating System ===

Mac OS X 10.10.3
Darwin amalias.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 Brendan Zagaeski (Xamarin Team, assistant) 2015-07-17 19:17:47 UTC
This appears to be an upstream issue. The original Java test case from comment 0 was using:

> android.support.v7.app.ActionBar
> android.support.v7.app.ActionBarActivity

While the Xamarin test case was using:

> Android.App.ActionBar
> Android.App.Activity


Switching the Xamarin test case to use the "Support v7" classes (via the "Xamarin.Android.Support.v7.AppCompat" NuGet package) stops the problem.

And correspondingly, switching the Java test case to use the non-"Support v7" classes causes the _same_ problem to appear in the Java test case.

I will attach the updated Java test case that demonstrates the problem in the next comment.
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2015-07-17 19:18:56 UTC
Created attachment 12097 [details]
Updated Java test case that shows the same problem
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2015-07-17 19:19:29 UTC
Created attachment 12098 [details]
Screen capture from the updated Java test case
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2015-07-17 20:10:01 UTC
In case it's helpful, it appears that the reason the original Java sampled worked was actually _not_ due to the use of the "Support v7" classes, but instead because the `android:theme` was set to "Theme.AppCompat.Light.DarkActionBar" in `AndroidManifest.xml`.


## Workaround

Add the following property to the `[Activity]` attribute in "MainActivity.cs" in the original Xamarin test case from comment 0:

Theme = "@android:style/Theme.Holo"


This was sufficient to stop the problem in my tests. (You can use other themes [1] too if you prefer.)

[1] https://developer.android.com/reference/android/R.style.html#Theme_Holo