Rename methods accordingly and add Javadocs

This commit is contained in:
neslihanturan 2019-05-31 13:16:40 +03:00
parent 3f847fd890
commit 1b0d614886
3 changed files with 11 additions and 10 deletions

View file

@ -44,7 +44,7 @@ public interface NearbyParentFragmentContract {
} }
interface ViewsAreReadyCallback { interface ViewsAreReadyCallback {
void nearbyFragmentAndMapViewReady1(); void nearbyFragmentsAreReady();
void nearbyFragmentAndMapViewReady2(); void nearbyMapViewReady();
} }
} }

View file

@ -4,7 +4,6 @@ import android.content.Context;
import android.graphics.Color; import android.graphics.Color;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import android.view.Gravity; import android.view.Gravity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -174,7 +173,7 @@ public class NearbyMapFragment extends CommonsDaggerSupportFragment implements N
} }
this.mapboxMap = mapboxMap; this.mapboxMap = mapboxMap;
viewsAreReadyCallback.nearbyFragmentAndMapViewReady2(); viewsAreReadyCallback.nearbyMapViewReady();
//addMapMovementListeners(); //addMapMovementListeners();
//updateMapSignificantlyForCurrentLocation(); //updateMapSignificantlyForCurrentLocation();
}); });
@ -399,7 +398,7 @@ public class NearbyMapFragment extends CommonsDaggerSupportFragment implements N
public void viewsAreAssignedToPresenter(NearbyParentFragmentContract.ViewsAreReadyCallback viewsAreReadyCallback) { public void viewsAreAssignedToPresenter(NearbyParentFragmentContract.ViewsAreReadyCallback viewsAreReadyCallback) {
Timber.d("Views are set"); Timber.d("Views are set");
this.viewsAreReadyCallback = viewsAreReadyCallback; this.viewsAreReadyCallback = viewsAreReadyCallback;
this.viewsAreReadyCallback.nearbyFragmentAndMapViewReady1(); this.viewsAreReadyCallback.nearbyFragmentsAreReady();
} }

View file

@ -74,8 +74,8 @@ public class NearbyParentFragmentPresenter
* Initializes nearby operations if tab selected, otherwise just sets nearby views are ready * Initializes nearby operations if tab selected, otherwise just sets nearby views are ready
*/ */
@Override @Override
public void nearbyFragmentAndMapViewReady1() { public void nearbyFragmentsAreReady() {
Timber.d("Nearby map view ready"); Timber.d("Nearby fragments are ready to be used by presenter");
nearbyViewsAreReady = true; nearbyViewsAreReady = true;
// The condition for initialize operations is both having views ready and tab is selected // The condition for initialize operations is both having views ready and tab is selected
if (onTabSelected) { if (onTabSelected) {
@ -83,12 +83,14 @@ public class NearbyParentFragmentPresenter
} }
} }
/**
* Will be called when map view is created and ready to be used.
*/
@Override @Override
public void nearbyFragmentAndMapViewReady2() { public void nearbyMapViewReady() {
Timber.d("Nearby map view is created and ready");
updateMapAndList(LOCATION_SIGNIFICANTLY_CHANGED, null); updateMapAndList(LOCATION_SIGNIFICANTLY_CHANGED, null);
//initializeNearbyOperations();
// TODO: document this prpoblem, if updateMapAndList is not called at checkGPS then this method never called, setup map view never ends // TODO: document this prpoblem, if updateMapAndList is not called at checkGPS then this method never called, setup map view never ends
// TODO: add search this area thing here
this.nearbyParentFragmentView.addSearchThisAreaButtonAction(); this.nearbyParentFragmentView.addSearchThisAreaButtonAction();
this.nearbyMapFragmentView.addOnCameraMoveListener(onCameraMove(getCameraTarget())); this.nearbyMapFragmentView.addOnCameraMoveListener(onCameraMove(getCameraTarget()));
} }