Bug 34776 - DateUtils.FormatSameDayTime expecting different values that the original Java version
Summary: DateUtils.FormatSameDayTime expecting different values that the original Java...
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: General (show other bugs)
Version: 5.1
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2015-10-12 15:19 UTC by Nuno
Modified: 2015-10-19 09:44 UTC (History)
3 users (show)

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


Attachments
Sample Project (30.59 KB, application/zip)
2015-10-12 15:19 UTC, Nuno
Details

Description Nuno 2015-10-12 15:19:07 UTC
Created attachment 13289 [details]
Sample Project

The last 2 parameters of  C# version of DateUtils.FormatSameDayTime are values from Android.Text.Format.AbbreviationLength, but the AbbreviationLength enum has a different range of values those expected by the original Java version.

Using any value of AbbreviationLength enum will crash the app.

Android version:
http://developer.android.com/reference/android/text/format/DateUtils.html#formatSameDayTime(long, long, int, int)
The last 2 parameters expect values from 0 to 3.

Xamarin version:
https://developer.xamarin.com/api/member/Android.Text.Format.DateUtils.FormatSameDayTime(System.Int64,System.Int64,Android.Text.Format.AbbreviationLength,Android.Text.Format.AbbreviationLength)/



Xamarin Studio
Version 5.9.7 (build 22)
Runtime:
	Mono 4.0.4 ((detached/d481017)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400040004

Apple Developer Tools
Xcode 7.0.1 (8228)
Build 7A1001

Xamarin.iOS
Version: 9.0.1.29 (Business Edition)
Hash: 1d27ac2
Branch: master
Build date: 2015-09-25 18:08:44-0400

Xamarin.Android
Version: 5.1.7.12 (Business Edition)
Android SDK: 
	Supported Android versions:
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

Build Information
Release ID: 509070022
Git revision: 6bd1f169df44ca96addf8a035316c535a4fa46fa
Build date: 2015-09-30 12:30:15-04
Xamarin addins: 1c3e5c0859bdfec0ecd481a57ad6c03bc22f5536

Operating System
Mac OS X 10.10.5
Darwin 14.5.0 Darwin Kernel Version 14.5.0
    Wed Jul 29 02:26:53 PDT 2015
    root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
Comment 1 Atsushi Eno 2015-10-19 09:44:10 UTC
You're right. Those methods parameters should not have enumified type. These methods will just take int constants in the next major update. Thanks for the report.

[master 026b050]

Note You need to log in before you can comment on or make changes to this bug.