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 {
void nearbyFragmentAndMapViewReady1();
void nearbyFragmentAndMapViewReady2();
void nearbyFragmentsAreReady();
void nearbyMapViewReady();
}
}

View file

@ -4,7 +4,6 @@ import android.content.Context;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@ -174,7 +173,7 @@ public class NearbyMapFragment extends CommonsDaggerSupportFragment implements N
}
this.mapboxMap = mapboxMap;
viewsAreReadyCallback.nearbyFragmentAndMapViewReady2();
viewsAreReadyCallback.nearbyMapViewReady();
//addMapMovementListeners();
//updateMapSignificantlyForCurrentLocation();
});
@ -399,7 +398,7 @@ public class NearbyMapFragment extends CommonsDaggerSupportFragment implements N
public void viewsAreAssignedToPresenter(NearbyParentFragmentContract.ViewsAreReadyCallback viewsAreReadyCallback) {
Timber.d("Views are set");
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
*/
@Override
public void nearbyFragmentAndMapViewReady1() {
Timber.d("Nearby map view ready");
public void nearbyFragmentsAreReady() {
Timber.d("Nearby fragments are ready to be used by presenter");
nearbyViewsAreReady = true;
// The condition for initialize operations is both having views ready and tab is selected
if (onTabSelected) {
@ -83,12 +83,14 @@ public class NearbyParentFragmentPresenter
}
}
/**
* Will be called when map view is created and ready to be used.
*/
@Override
public void nearbyFragmentAndMapViewReady2() {
public void nearbyMapViewReady() {
Timber.d("Nearby map view is created and ready");
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: add search this area thing here
this.nearbyParentFragmentView.addSearchThisAreaButtonAction();
this.nearbyMapFragmentView.addOnCameraMoveListener(onCameraMove(getCameraTarget()));
}