forked from organicmaps/organicmaps
[android] Removed ITEM_TYPE_LOCAL_EXPERTS on Discovery Screen and disabled the List of items
This commit is contained in:
parent
cc66a0473d
commit
3284c924fb
2 changed files with 6 additions and 20 deletions
|
@ -76,6 +76,7 @@
|
|||
<TextView
|
||||
android:id="@+id/localGuidesTitle"
|
||||
android:text="@string/discovery_button_subtitle_local_guides"
|
||||
android:visibility="gone"
|
||||
android:textAppearance="@style/MwmTextAppearance.Discovery.Subtitle"
|
||||
style="@style/MwmWidget.Discovery.Subtitle"
|
||||
android:layout_marginTop="@dimen/margin_base_plus"
|
||||
|
@ -88,6 +89,7 @@
|
|||
android:layout_height="wrap_content"/>
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/localGuides"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<include layout="@layout/catalog_promo_container"/>
|
||||
|
|
|
@ -65,7 +65,6 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
|
|||
private static final int[] ITEM_TYPES = { DiscoveryParams.ITEM_TYPE_HOTELS,
|
||||
DiscoveryParams.ITEM_TYPE_ATTRACTIONS,
|
||||
DiscoveryParams.ITEM_TYPE_CAFES,
|
||||
DiscoveryParams.ITEM_TYPE_LOCAL_EXPERTS,
|
||||
DiscoveryParams.ITEM_TYPE_PROMO};
|
||||
private boolean mOnlineMode;
|
||||
@Nullable
|
||||
|
@ -137,11 +136,6 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
|
|||
setLayoutManagerAndItemDecoration(requireContext(), catalogPromoRecycler);
|
||||
}
|
||||
|
||||
private void initLocalExpertsGallery()
|
||||
{
|
||||
setLayoutManagerAndItemDecoration(getContext(), getGallery(R.id.localGuides));
|
||||
}
|
||||
|
||||
private static void setLayoutManagerAndItemDecoration(@NonNull Context context,
|
||||
@NonNull RecyclerView rv)
|
||||
{
|
||||
|
@ -190,7 +184,6 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
|
|||
initHotelGallery();
|
||||
initAttractionsGallery();
|
||||
initFoodGallery();
|
||||
initLocalExpertsGallery();
|
||||
initSearchBasedAdapters();
|
||||
initCatalogPromoGallery();
|
||||
requestDiscoveryInfoAndInitAdapters();
|
||||
|
@ -215,21 +208,12 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
|
|||
|
||||
private void initNetworkBasedAdapters()
|
||||
{
|
||||
UiUtils.showIf(mOnlineMode, getRootView(), R.id.localGuidesTitle, R.id.localGuides);
|
||||
if (mOnlineMode)
|
||||
{
|
||||
RecyclerView localGuides = getGallery(R.id.localGuides);
|
||||
localGuides.setAdapter(Factory.createLocalExpertsLoadingAdapter());
|
||||
RecyclerView promoRecycler = getGallery(R.id.catalog_promo_recycler);
|
||||
BaseItemSelectedListener<Items.Item> listener = new CatalogPromoSelectedListener(requireActivity());
|
||||
promoRecycler.setAdapter(Factory.createCatalogPromoLoadingAdapter(listener));
|
||||
if (!mOnlineMode)
|
||||
return;
|
||||
}
|
||||
|
||||
// It means that the user doesn't permit mobile network usage, so network based galleries UI
|
||||
// should be hidden in this case.
|
||||
UiUtils.showIf(ConnectionState.isMobileConnected(), getView(), R.id.localGuidesTitle,
|
||||
R.id.localGuides);
|
||||
RecyclerView promoRecycler = getGallery(R.id.catalog_promo_recycler);
|
||||
BaseItemSelectedListener<Items.Item> listener = new CatalogPromoSelectedListener(requireActivity());
|
||||
promoRecycler.setAdapter(Factory.createCatalogPromoLoadingAdapter(listener));
|
||||
}
|
||||
|
||||
private void requestDiscoveryInfo()
|
||||
|
|
Loading…
Add table
Reference in a new issue