[android] Removed unused place page state listener from MwmActivity

This commit is contained in:
alexzatsepin 2020-10-12 21:05:44 +03:00 committed by Arsentiy Milchakov
parent a65d755360
commit e5e2072a6d
4 changed files with 9 additions and 45 deletions

View file

@ -144,7 +144,6 @@ import com.mapswithme.maps.widget.menu.MyPositionButton;
import com.mapswithme.maps.widget.placepage.PlacePageController;
import com.mapswithme.maps.widget.placepage.PlacePageData;
import com.mapswithme.maps.widget.placepage.PlacePageFactory;
import com.mapswithme.maps.widget.placepage.PlacePageStateListener;
import com.mapswithme.maps.widget.placepage.RoutingModeListener;
import com.mapswithme.util.Counters;
import com.mapswithme.util.InputUtils;
@ -199,8 +198,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
OnIsolinesLayerToggleListener,
OnGuidesLayerToggleListener,
GuidesGalleryListener,
NoConnectionListener,
PlacePageStateListener
NoConnectionListener
{
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
private static final String TAG = MwmActivity.class.getSimpleName();
@ -558,7 +556,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
setContentView(R.layout.activity_map);
mPlacePageController = PlacePageFactory.createCompositePlacePageController(
this, this, this, this, this);
this, this, this, this);
mPlacePageController.initialize(this);
mPlacePageController.onActivityCreated(this, savedInstanceState);
@ -2737,24 +2735,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
return mMainMenuController;
}
@Override
public void onPlacePageDetails()
{
// Do nothing.
}
@Override
public void onPlacePagePreview()
{
// Do nothing.
}
@Override
public void onPlacePageClosed()
{
// Do nothing.
}
public void showTrackOnMap(long trackId)
{
Track track = BookmarkManager.INSTANCE.getTrack(trackId);

View file

@ -21,8 +21,6 @@ class PlacePageControllerComposite implements PlacePageController
private final RoutingModeListener mRoutingModeListener;
@Nullable
private final GuidesGalleryListener mGuidesGalleryListener;
@Nullable
private final PlacePageStateListener mStateListener;
@NonNull
private final List<PlacePageController> mControllers = new ArrayList<>();
@SuppressWarnings("NullableProblems")
@ -32,14 +30,12 @@ class PlacePageControllerComposite implements PlacePageController
PlacePageControllerComposite(@NonNull AdsRemovalPurchaseControllerProvider adsProvider,
@NonNull SlideListener slideListener,
@Nullable RoutingModeListener routingModeListener,
@Nullable GuidesGalleryListener galleryListener,
@Nullable PlacePageStateListener stateObserver)
@Nullable GuidesGalleryListener galleryListener)
{
mAdsProvider = adsProvider;
mSlideListener = slideListener;
mRoutingModeListener = routingModeListener;
mGuidesGalleryListener = galleryListener;
mStateListener = stateObserver;
}
@Override
@ -123,7 +119,7 @@ class PlacePageControllerComposite implements PlacePageController
PlacePageController richController =
PlacePageFactory.createRichController(mAdsProvider, mSlideListener,
mRoutingModeListener, mStateListener);
mRoutingModeListener);
richController.initialize(activity);
mControllers.add(richController);

View file

@ -13,21 +13,19 @@ public class PlacePageFactory
@NonNull AdsRemovalPurchaseControllerProvider provider,
@NonNull PlacePageController.SlideListener slideListener,
@NonNull RoutingModeListener routingModeListener,
@Nullable GuidesGalleryListener galleryListener,
@Nullable PlacePageStateListener stateListener)
@Nullable GuidesGalleryListener galleryListener)
{
return new PlacePageControllerComposite(provider, slideListener, routingModeListener,
galleryListener, stateListener);
galleryListener);
}
@NonNull
static PlacePageController createRichController(
@NonNull AdsRemovalPurchaseControllerProvider provider,
@NonNull PlacePageController.SlideListener listener,
@Nullable RoutingModeListener routingModeListener,
@Nullable PlacePageStateListener stateListener)
@Nullable RoutingModeListener routingModeListener)
{
return new RichPlacePageController(provider, listener, routingModeListener, stateListener);
return new RichPlacePageController(provider, listener, routingModeListener);
}
@NonNull

View file

@ -82,8 +82,6 @@ public class RichPlacePageController implements PlacePageController, LocationLis
private final SlideListener mSlideListener;
@Nullable
private final RoutingModeListener mRoutingModeListener;
@Nullable
private final PlacePageStateListener mStateListener;
@NonNull
private final BottomSheetChangedListener mBottomSheetChangedListener = new BottomSheetChangedListener()
{
@ -91,8 +89,6 @@ public class RichPlacePageController implements PlacePageController, LocationLis
public void onSheetHidden()
{
onHiddenInternal();
if (mStateListener != null)
mStateListener.onPlacePageClosed();
}
@Override
@ -106,8 +102,6 @@ public class RichPlacePageController implements PlacePageController, LocationLis
{
mBannerController.onPlacePageDetails();
mPlacePageTracker.onDetails();
if (mStateListener != null)
mStateListener.onPlacePageDetails();
}
@Override
@ -116,8 +110,6 @@ public class RichPlacePageController implements PlacePageController, LocationLis
mPlacePage.resetScroll();
mBannerController.onPlacePagePreview();
setPeekHeight();
if (mStateListener != null)
mStateListener.onPlacePagePreview();
}
@Override
@ -204,13 +196,11 @@ public class RichPlacePageController implements PlacePageController, LocationLis
RichPlacePageController(@NonNull AdsRemovalPurchaseControllerProvider provider,
@NonNull SlideListener listener,
@Nullable RoutingModeListener routingModeListener,
@Nullable PlacePageStateListener stateListener)
@Nullable RoutingModeListener routingModeListener)
{
mPurchaseControllerProvider = provider;
mSlideListener = listener;
mRoutingModeListener = routingModeListener;
mStateListener = stateListener;
}
@SuppressLint("ClickableViewAccessibility")