Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Donskoy <donskdmitry@mail.ru>2019-05-23 12:27:38 +0300
committerAleksandr Zatsepin <alexzatsepin@users.noreply.github.com>2019-05-31 13:54:40 +0300
commitb1e7679d9f7eb63513b3be6178759318e9c184ac (patch)
treebc208a5526b4c7d9f819c270d7e0ecb0e81ce164 /android
parent2ddb33ffd4d320cb0e26b4c00d9773e32af1f68e (diff)
[android] Added stub catalog gallery into PP
Diffstat (limited to 'android')
-rw-r--r--android/res/layout/place_page_details.xml2
-rw-r--r--android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java64
2 files changed, 64 insertions, 2 deletions
diff --git a/android/res/layout/place_page_details.xml b/android/res/layout/place_page_details.xml
index 5cb5d09ecf..e521ee0b9f 100644
--- a/android/res/layout/place_page_details.xml
+++ b/android/res/layout/place_page_details.xml
@@ -36,6 +36,8 @@
android:layout_marginBottom="@dimen/margin_half"
tools:visibility="gone"/>
+ <include layout="@layout/catalog_promo_container"/>
+
<include layout="@layout/place_page_hotel_gallery"/>
<include layout="@layout/place_page_hotel_description"/>
diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java
index 24c7c7f0c4..a85f2f0f39 100644
--- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java
+++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java
@@ -43,6 +43,10 @@ import com.mapswithme.maps.Framework;
import com.mapswithme.maps.MwmActivity;
import com.mapswithme.maps.MwmApplication;
import com.mapswithme.maps.R;
+import com.mapswithme.maps.adapter.AdapterPositionConverter;
+import com.mapswithme.maps.adapter.DefaultPositionConverter;
+import com.mapswithme.maps.adapter.OnItemClickListener;
+import com.mapswithme.maps.adapter.RecyclerCompositeAdapter;
import com.mapswithme.maps.ads.LocalAdInfo;
import com.mapswithme.maps.api.ParsedMwmRequest;
import com.mapswithme.maps.bookmarks.PlaceDescriptionActivity;
@@ -52,6 +56,11 @@ import com.mapswithme.maps.bookmarks.data.BookmarkManager;
import com.mapswithme.maps.bookmarks.data.DistanceAndAzimut;
import com.mapswithme.maps.bookmarks.data.MapObject;
import com.mapswithme.maps.bookmarks.data.Metadata;
+import com.mapswithme.maps.bookmarks.data.RoadWarningMarkType;
+import com.mapswithme.maps.discovery.AdapterDataObserverWrapper;
+import com.mapswithme.maps.discovery.CatalogPromoAdapter;
+import com.mapswithme.maps.discovery.CatalogPromoItem;
+import com.mapswithme.maps.discovery.MoreAdapter;
import com.mapswithme.maps.downloader.CountryItem;
import com.mapswithme.maps.downloader.DownloaderStatusIcon;
import com.mapswithme.maps.downloader.MapManager;
@@ -68,7 +77,6 @@ import com.mapswithme.maps.search.FilterUtils;
import com.mapswithme.maps.search.HotelsFilter;
import com.mapswithme.maps.search.Popularity;
import com.mapswithme.maps.settings.RoadType;
-import com.mapswithme.maps.bookmarks.data.RoadWarningMarkType;
import com.mapswithme.maps.taxi.TaxiType;
import com.mapswithme.maps.ugc.Impress;
import com.mapswithme.maps.ugc.UGCController;
@@ -316,6 +324,22 @@ public class PlacePageView extends NestedScrollView
@Nullable
private RoutingModeListener mRoutingModeListener;
+ @SuppressWarnings("NullableProblems")
+ @NonNull
+ private CatalogPromoAdapter mCatalogPromoAdapter;
+
+ @SuppressWarnings("NullableProblems")
+ @NonNull
+ private RecyclerView mCatalogPromoRecycler;
+
+ @SuppressWarnings("NullableProblems")
+ @NonNull
+ private View mCatalogPromoPlaceholderCard;
+
+ @SuppressWarnings("NullableProblems")
+ @NonNull
+ private View mCatalogPromoProgress;
+
void setScrollable(boolean scrollable)
{
mScrollable = scrollable;
@@ -455,6 +479,7 @@ public class PlacePageView extends NestedScrollView
initHotelGalleryView();
initHotelNearbyView();
initHotelRatingView();
+ initCatalogPromoView();
mUgcController = new UGCController(this);
@@ -808,6 +833,32 @@ public class PlacePageView extends NestedScrollView
mRvHotelGallery.setAdapter(mGalleryAdapter);
}
+ private void initCatalogPromoView()
+ {
+ mCatalogPromoRecycler = findViewById(R.id.catalog_promo_recycler);
+ mCatalogPromoPlaceholderCard = findViewById(R.id.catalog_promo_placeholder_card);
+ mCatalogPromoProgress = mCatalogPromoPlaceholderCard.findViewById(R.id.progress);
+ mCatalogPromoAdapter = new CatalogPromoAdapter();
+
+ MoreAdapter moreAdapter = new MoreAdapter(new MoreClickListener());
+ mCatalogPromoRecycler.setNestedScrollingEnabled(false);
+ mCatalogPromoRecycler.setLayoutManager(new LinearLayoutManager(getContext(),
+ LinearLayoutManager.HORIZONTAL,
+ false));
+ mCatalogPromoRecycler.addItemDecoration(
+ ItemDecoratorFactory.createSponsoredGalleryDecorator(getContext(),
+ LinearLayoutManager.HORIZONTAL));
+ AdapterPositionConverter converter =
+ new DefaultPositionConverter(Arrays.asList(mCatalogPromoAdapter, moreAdapter));
+ RecyclerCompositeAdapter compositeAdapter = new RecyclerCompositeAdapter(converter,
+ mCatalogPromoAdapter,
+ moreAdapter);
+
+ AdapterDataObserverWrapper observer = new AdapterDataObserverWrapper(compositeAdapter);
+ mCatalogPromoAdapter.registerAdapterDataObserver(observer);
+ mCatalogPromoRecycler.setAdapter(compositeAdapter);
+ }
+
private void initHotelFacilitiesView()
{
mHotelFacilities = findViewById(R.id.ll__place_hotel_facilities);
@@ -1362,7 +1413,7 @@ public class PlacePageView extends NestedScrollView
}
boolean isConnected = ConnectionState.isConnected();
- if (isConnected && policy.сanUseNetwork())
+ if (isConnected && policy.canUseNetwork())
showHotelDetailViews();
else
hideHotelDetailViews();
@@ -2043,6 +2094,15 @@ public class PlacePageView extends NestedScrollView
return mPreview.getHeight();
}
+ private static class MoreClickListener implements OnItemClickListener<String>
+ {
+ @Override
+ public void onItemClick(@NonNull View v, @NonNull String item)
+ {
+
+ }
+ }
+
private class EditBookmarkClickListener implements OnClickListener
{
@Override