From b961e5b10491b9986f1eb00565cf1526eda25379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=97=D0=B0=D1=86=D0=B5=D0=BF=D0=B8=D0=BD?= Date: Thu, 29 Jun 2017 18:45:01 +0300 Subject: [PATCH] [android] Added Yandex.Taxi title to taxi panel --- .../maps/routing/RoutingBottomMenuController.java | 2 +- .../src/com/mapswithme/maps/taxi/TaxiAdapter.java | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/android/src/com/mapswithme/maps/routing/RoutingBottomMenuController.java b/android/src/com/mapswithme/maps/routing/RoutingBottomMenuController.java index c6003c38ed..f615f2f043 100644 --- a/android/src/com/mapswithme/maps/routing/RoutingBottomMenuController.java +++ b/android/src/com/mapswithme/maps/routing/RoutingBottomMenuController.java @@ -158,7 +158,7 @@ final class RoutingBottomMenuController implements View.OnClickListener final List products = info.getProducts(); mTaxiInfo = info; mTaxiProduct = products.get(0); - final PagerAdapter adapter = new TaxiAdapter(mContext, products); + final PagerAdapter adapter = new TaxiAdapter(mContext, mTaxiInfo.getType(), products); DotPager pager = new DotPager.Builder(mContext, (ViewPager) mTaxiFrame.findViewById(R.id.pager), adapter) .setIndicatorContainer((ViewGroup) mTaxiFrame.findViewById(R.id.indicator)) diff --git a/android/src/com/mapswithme/maps/taxi/TaxiAdapter.java b/android/src/com/mapswithme/maps/taxi/TaxiAdapter.java index 7f80cc355a..9f1cc1d6ee 100644 --- a/android/src/com/mapswithme/maps/taxi/TaxiAdapter.java +++ b/android/src/com/mapswithme/maps/taxi/TaxiAdapter.java @@ -19,10 +19,14 @@ public class TaxiAdapter extends PagerAdapter private final Context mContext; @NonNull private final List mProducts; + @TaxiManager.TaxiType + private final int mType; - public TaxiAdapter(@NonNull Context context, @NonNull List products) + public TaxiAdapter(@NonNull Context context, @TaxiManager.TaxiType int type, + @NonNull List products) { mContext = context; + mType = type; mProducts = products; } @@ -45,7 +49,12 @@ public class TaxiAdapter extends PagerAdapter View v = LayoutInflater.from(mContext).inflate(R.layout.taxi_pager_item, container, false); TextView name = (TextView) v.findViewById(R.id.product_name); - name.setText(product.getName()); + // We ignore all Yandex.Taxi product names until they do support of passing product parameters + // to their app vie deeplink. + if (mType == TaxiManager.PROVIDER_YANDEX) + name.setText(R.string.yandex_taxi_title); + else + name.setText(product.getName()); TextView timeAndPrice = (TextView) v.findViewById(R.id.arrival_time_price); int time = Integer.parseInt(product.getTime()); CharSequence waitTime = RoutingController.formatRoutingTime(mContext, time, R.dimen.text_size_body_3);