forked from organicmaps/organicmaps
[android] Added Yandex.Taxi title to taxi panel
This commit is contained in:
parent
053115b34e
commit
b961e5b104
2 changed files with 12 additions and 3 deletions
|
@ -158,7 +158,7 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
final List<TaxiInfo.Product> 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))
|
||||
|
|
|
@ -19,10 +19,14 @@ public class TaxiAdapter extends PagerAdapter
|
|||
private final Context mContext;
|
||||
@NonNull
|
||||
private final List<TaxiInfo.Product> mProducts;
|
||||
@TaxiManager.TaxiType
|
||||
private final int mType;
|
||||
|
||||
public TaxiAdapter(@NonNull Context context, @NonNull List<TaxiInfo.Product> products)
|
||||
public TaxiAdapter(@NonNull Context context, @TaxiManager.TaxiType int type,
|
||||
@NonNull List<TaxiInfo.Product> 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);
|
||||
|
|
Loading…
Add table
Reference in a new issue