mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-05-18 05:36:39 -04:00
Fix color parsing
This commit is contained in:
@@ -105,9 +105,9 @@ public class PkpassImporter {
|
||||
if(headerColorMatcher.find())
|
||||
{
|
||||
headerColor = Color.rgb(
|
||||
Integer.parseInt(headerColorMatcher.group(0)),
|
||||
Integer.parseInt(headerColorMatcher.group(1)),
|
||||
Integer.parseInt(headerColorMatcher.group(2)));
|
||||
Integer.parseInt(headerColorMatcher.group(2)),
|
||||
Integer.parseInt(headerColorMatcher.group(3)));
|
||||
}
|
||||
|
||||
|
||||
@@ -117,9 +117,9 @@ public class PkpassImporter {
|
||||
if(headerTextColorMatcher.find())
|
||||
{
|
||||
headerTextColor = Color.rgb(
|
||||
Integer.parseInt(headerTextColorMatcher.group(0)),
|
||||
Integer.parseInt(headerTextColorMatcher.group(1)),
|
||||
Integer.parseInt(headerTextColorMatcher.group(2)));
|
||||
Integer.parseInt(headerTextColorMatcher.group(2)),
|
||||
Integer.parseInt(headerTextColorMatcher.group(3)));
|
||||
}
|
||||
|
||||
return new LoyaltyCard(-1, store, note, cardId, barcodeType, headerColor, headerTextColor);
|
||||
|
||||
@@ -111,7 +111,7 @@ public class PkpassTest {
|
||||
assertEquals(card.cardId, "0000001");
|
||||
assertEquals(card.note, "Staff Pass for Employee Number 001");
|
||||
assertEquals(card.store, "Passbook Example Company");
|
||||
assertEquals(card.headerColor, String.valueOf(Color.rgb(90, 90, 90)));
|
||||
assertEquals(card.headerTextColor, String.valueOf(Color.rgb(255, 255, 255)));
|
||||
assertEquals(card.headerColor.toString(), String.valueOf(Color.rgb(90, 90, 90)));
|
||||
assertEquals(card.headerTextColor.toString(), String.valueOf(Color.rgb(255, 255, 255)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user