Skip to content

Commit

Permalink
[DNM][partners_api][android][ios] Add auto partners generator support
Browse files Browse the repository at this point in the history
  • Loading branch information
greshilov authored and alexzatsepin committed Jul 9, 2018
1 parent ecbd6c0 commit a46a0ef
Show file tree
Hide file tree
Showing 16 changed files with 405 additions and 409 deletions.
38 changes: 0 additions & 38 deletions android/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,44 +163,6 @@
<color name="bg_brand_booking_pressed">#FF1B549E</color>
<color name="bg_brand_opentable">#FFDA3743</color>
<color name="bg_brand_opentable_pressed">#FFFC5965</color>
<color name="bg_brand_partner1">#FFFFDA00</color>
<color name="bg_brand_partner1_pressed">#FFF2CE00</color>
<color name="bg_brand_partner3">#FFE61717</color>
<color name="bg_brand_partner3_pressed">#FFB31212</color>
<color name="bg_brand_partner4">#FF000000</color>
<color name="bg_brand_partner4_pressed">#FF000000</color>
<color name="bg_brand_partner5">#FF0073D2</color>
<color name="bg_brand_partner5_pressed">#FF0073D2</color>
<color name="bg_brand_partner6">#FF005CB9</color>
<color name="bg_brand_partner6_pressed">#FF005CB9</color>
<color name="bg_brand_partner7">#FFE24307</color>
<color name="bg_brand_partner7_pressed">#FFE24307</color>
<color name="bg_brand_partner8">#FF8D1B2F</color>
<color name="bg_brand_partner8_pressed">#FF8D1B2F</color>
<color name="bg_brand_partner9">#FFDC0039</color>
<color name="bg_brand_partner9_pressed">#FFDC0039</color>
<color name="bg_brand_partner10">#FF025198</color>
<color name="bg_brand_partner10_pressed">#FF025198</color>
<color name="bg_brand_partner11">#FFA50300</color>
<color name="bg_brand_partner11_pressed">#FFA50300</color>
<color name="bg_brand_partner12">#FF7EBD32</color>
<color name="bg_brand_partner12_pressed">#FF7EBD32</color>
<color name="bg_brand_partner13">#FF37252B</color>
<color name="bg_brand_partner13_pressed">#FF37252B</color>
<color name="bg_brand_partner14">#FF000000</color>
<color name="bg_brand_partner14_pressed">#FF000000</color>
<color name="bg_brand_partner15">#FF000000</color>
<color name="bg_brand_partner15_pressed">#FF000000</color>
<color name="bg_brand_partner16">#FF000000</color>
<color name="bg_brand_partner16_pressed">#FF000000</color>
<color name="bg_brand_partner17">#FF000000</color>
<color name="bg_brand_partner17_pressed">#FF000000</color>
<color name="bg_brand_partner18">#FF00B956</color>
<color name="bg_brand_partner18_pressed">#FF00B956</color>
<color name="bg_brand_partner19">#FF571A8C</color>
<color name="bg_brand_partner19_pressed">#FF450F4F</color>
<color name="bg_brand_partner20">@color/bg_brand_partner19</color>
<color name="bg_brand_partner20_pressed">@color/bg_brand_partner19_pressed</color>

<!-- Banner colors -->
<color name="bg_banner_color">#FFFDFFE6</color>
Expand Down
39 changes: 39 additions & 0 deletions android/res/values/partner_colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Partner colors -->

<color name="bg_brand_partner3">#FFE61717</color>
<color name="bg_brand_partner3_pressed">#FFB31212</color>
<color name="bg_brand_partner4">#FF000000</color>
<color name="bg_brand_partner4_pressed">#FF000000</color>
<color name="bg_brand_partner6">#FF005CB9</color>
<color name="bg_brand_partner6_pressed">#FF005CB9</color>
<color name="bg_brand_partner7">#FFE24307</color>
<color name="bg_brand_partner7_pressed">#FFE24307</color>
<color name="bg_brand_partner8">#FF8D1B2F</color>
<color name="bg_brand_partner8_pressed">#FF8D1B2F</color>
<color name="bg_brand_partner9">#FFDC0039</color>
<color name="bg_brand_partner9_pressed">#FFDC0039</color>
<color name="bg_brand_partner10">#FF025198</color>
<color name="bg_brand_partner10_pressed">#FF025198</color>
<color name="bg_brand_partner11">#FFA50300</color>
<color name="bg_brand_partner11_pressed">#FFA50300</color>
<color name="bg_brand_partner12">#FF7EBD32</color>
<color name="bg_brand_partner12_pressed">#FF7EBD32</color>
<color name="bg_brand_partner13">#FF37252B</color>
<color name="bg_brand_partner13_pressed">#FF37252B</color>
<color name="bg_brand_partner14">#FF000000</color>
<color name="bg_brand_partner14_pressed">#FF000000</color>
<color name="bg_brand_partner15">#FF000000</color>
<color name="bg_brand_partner15_pressed">#FF000000</color>
<color name="bg_brand_partner16">#FF000000</color>
<color name="bg_brand_partner16_pressed">#FF000000</color>
<color name="bg_brand_partner17">#FF000000</color>
<color name="bg_brand_partner17_pressed">#FF000000</color>
<color name="bg_brand_partner18">#FF00B956</color>
<color name="bg_brand_partner18_pressed">#FF00B956</color>
<color name="bg_brand_partner19">#FF571A8C</color>
<color name="bg_brand_partner19_pressed">#FF571A8C</color>
<color name="bg_brand_partner20">#FF571A8C</color>
<color name="bg_brand_partner20_pressed">#FF571A8C</color>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ public final class PlacePageButtons
{
private static final Map<Integer, PartnerItem> PARTNERS_ITEMS = new HashMap<Integer, PartnerItem>()
{{
put(PartnerItem.PARTNER1.getIndex(), PartnerItem.PARTNER1);
// ---------------------------------------------------------------------------------------------
// Warning: the following code is autogenerated.
// Do NOT change it manually.
// %PartnersExtender.PartnerItemMap
put(PartnerItem.PARTNER3.getIndex(), PartnerItem.PARTNER3);
put(PartnerItem.PARTNER4.getIndex(), PartnerItem.PARTNER4);
put(PartnerItem.PARTNER5.getIndex(), PartnerItem.PARTNER5);
put(PartnerItem.PARTNER6.getIndex(), PartnerItem.PARTNER6);
put(PartnerItem.PARTNER7.getIndex(), PartnerItem.PARTNER7);
put(PartnerItem.PARTNER8.getIndex(), PartnerItem.PARTNER8);
Expand All @@ -46,6 +48,9 @@ public final class PlacePageButtons
put(PartnerItem.PARTNER18.getIndex(), PartnerItem.PARTNER18);
put(PartnerItem.PARTNER19.getIndex(), PartnerItem.PARTNER19);
put(PartnerItem.PARTNER20.getIndex(), PartnerItem.PARTNER20);
// /%PartnersExtender.PartnerItemMap
// End of autogenerated code.
// ---------------------------------------------------------------------------------------------
}};

private final int mMaxButtons;
Expand Down Expand Up @@ -122,10 +127,12 @@ public int getEnabledStateResId()
}

enum ButtonType {
PARTNER1,
// ---------------------------------------------------------------------------------------------
// Warning: the following code is autogenerated.
// Do NOT change it manually.
// %PartnersExtender.ButtonType
PARTNER3,
PARTNER4,
PARTNER5,
PARTNER6,
PARTNER7,
PARTNER8,
Expand All @@ -141,6 +148,9 @@ enum ButtonType {
PARTNER18,
PARTNER19,
PARTNER20,
// /%PartnersExtender.ButtonType
// End of autogenerated code.
// ---------------------------------------------------------------------------------------------
BOOKING,
BOOKING_SEARCH,
OPENTABLE,
Expand All @@ -157,12 +167,10 @@ enum ButtonType {

enum PartnerItem implements PlacePageButtons.PlacePageButton
{
PARTNER1(
1,
R.string.sponsored_partner1_action,
new ImageResources(R.drawable.ic_24px_logo_partner1),
R.drawable.button_partner1,
ButtonType.PARTNER1),
// ---------------------------------------------------------------------------------------------
// Warning: the following code is autogenerated.
// Do NOT change it manually.
// %PartnersExtender.PartnerItem
PARTNER3(
3,
R.string.sponsored_partner3_action,
Expand All @@ -175,12 +183,6 @@ enum PartnerItem implements PlacePageButtons.PlacePageButton
new ImageResources(R.drawable.ic_24px_logo_partner4),
R.drawable.button_partner4,
ButtonType.PARTNER4),
PARTNER5(
5,
R.string.sponsored_partner5_action,
new ImageResources(R.drawable.ic_24px_logo_partner5),
R.drawable.button_partner5,
ButtonType.PARTNER5),
PARTNER6(
6,
R.string.sponsored_partner6_action,
Expand Down Expand Up @@ -271,6 +273,9 @@ enum PartnerItem implements PlacePageButtons.PlacePageButton
new ImageResources(R.drawable.ic_24px_logo_partner20),
R.drawable.button_partner20,
ButtonType.PARTNER20);
// /%PartnersExtender.PartnerItem
// End of autogenerated code.
// ---------------------------------------------------------------------------------------------

private final int mIndex;
@StringRes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,12 @@ public void onPrepareVisibleView(@NonNull PlacePageButtons.PlacePageButton item,
case BOOKING:
case BOOKING_SEARCH:
case OPENTABLE:
case PARTNER1:
// ---------------------------------------------------------------------------------------
// Warning: the following code is autogenerated.
// Do NOT change it manually.
// %PartnersExtender.Switch
case PARTNER3:
case PARTNER4:
case PARTNER5:
case PARTNER6:
case PARTNER7:
case PARTNER8:
Expand All @@ -482,6 +484,9 @@ public void onPrepareVisibleView(@NonNull PlacePageButtons.PlacePageButton item,
case PARTNER18:
case PARTNER19:
case PARTNER20:
// /%PartnersExtender.Switch
// End of autogenerated code.
// ---------------------------------------------------------------------------------------
frame.setBackgroundResource(item.getBackgroundResource());
color = Color.WHITE;
break;
Expand Down Expand Up @@ -588,10 +593,12 @@ else if (controller.setStartPoint(mMapObject))

case BOOKING:
case OPENTABLE:
case PARTNER1:
// -----------------------------------------------------------------------------------------
// Warning: the following code is autogenerated.
// Do NOT change it manually.
// %PartnersExtender.SwitchClick
case PARTNER3:
case PARTNER4:
case PARTNER5:
case PARTNER6:
case PARTNER7:
case PARTNER8:
Expand All @@ -607,6 +614,9 @@ else if (controller.setStartPoint(mMapObject))
case PARTNER18:
case PARTNER19:
case PARTNER20:
// /%PartnersExtender.SwitchClick
// End of autogenerated code.
// -----------------------------------------------------------------------------------------
onSponsoredClick(true /* book */, false);
break;

Expand Down
14 changes: 14 additions & 0 deletions data/styles/clear/include/Icons.mapcss
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ node[amenity=biergarten],
area[amenity=biergarten]
{z-index: 2782;}

/* Warning: the following code is autogenerated.
Do NOT change it manually. */
/* %PartnersExtender.PartnerDeclare */

node[sponsored=partner2],
area[sponsored=partner2],
node[sponsored=partner4],
Expand All @@ -327,6 +331,9 @@ node[sponsored=partner20],
area[sponsored=partner20]
{z-index: 2792;}

/* /%PartnersExtender.PartnerDeclare */
/* End of autogenerated code. */

node[railway=halt],
node[railway=station],
area[building=train_station],
Expand Down Expand Up @@ -2688,6 +2695,10 @@ area|z18-[amenity=motorcycle_parking]

/* 8 Sponsored */

/* Warning: the following code is autogenerated.
Do NOT change it manually. */
/* %PartnersExtender.PartnerConfig */

node|z14-[sponsored=partner2],
area|z14-[sponsored=partner2]
{icon-image: partner2-l.svg;font-size: 10;text: name;text-color: @poi_label;text-offset: 1;}
Expand Down Expand Up @@ -2774,6 +2785,9 @@ node|z15-[sponsored=partner20],
area|z15-[sponsored=partner20]
{icon-image: partner20-l.svg;text: none;}

/* /%PartnersExtender.PartnerConfig */
/* End of autogenerated code. */

/* Fifa */

node|z13-[event=fc2018],
Expand Down
40 changes: 2 additions & 38 deletions iphone/Maps/Categories/UIColor+MapsMeColor.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#import "UIColor+PartnerColor.h"

@interface UIColor (MapsMeColor)

+ (UIColor *)primaryDark;
Expand Down Expand Up @@ -44,44 +46,6 @@
+ (UIColor *)ratingYellow;
+ (UIColor *)ratingLightGreen;
+ (UIColor *)ratingGreen;
+ (UIColor *)partner1Background;
+ (UIColor *)partner1TextColor;
+ (UIColor *)partner3Background;
+ (UIColor *)partner3TextColor;
+ (UIColor *)partner4Background;
+ (UIColor *)partner4TextColor;
+ (UIColor *)partner5Background;
+ (UIColor *)partner5TextColor;
+ (UIColor *)partner6Background;
+ (UIColor *)partner6TextColor;
+ (UIColor *)partner7Background;
+ (UIColor *)partner7TextColor;
+ (UIColor *)partner8Background;
+ (UIColor *)partner8TextColor;
+ (UIColor *)partner9Background;
+ (UIColor *)partner9TextColor;
+ (UIColor *)partner10Background;
+ (UIColor *)partner10TextColor;
+ (UIColor *)partner11Background;
+ (UIColor *)partner11TextColor;
+ (UIColor *)partner12Background;
+ (UIColor *)partner12TextColor;
+ (UIColor *)partner13Background;
+ (UIColor *)partner13TextColor;
+ (UIColor *)partner14Background;
+ (UIColor *)partner14TextColor;
+ (UIColor *)partner15Background;
+ (UIColor *)partner15TextColor;
+ (UIColor *)partner16Background;
+ (UIColor *)partner16TextColor;
+ (UIColor *)partner17Background;
+ (UIColor *)partner17TextColor;
+ (UIColor *)partner18Background;
+ (UIColor *)partner18TextColor;
+ (UIColor *)partner19Background;
+ (UIColor *)partner19TextColor;
+ (UIColor *)partner20Background;
+ (UIColor *)partner20TextColor;

+ (UIColor *)colorWithName:(NSString *)colorName;

Expand Down
Loading

0 comments on commit a46a0ef

Please sign in to comment.