Create presenters for map and list and implement user actions accordingly

This commit is contained in:
neslihanturan 2019-05-12 11:09:14 +03:00
parent 7dec4af113
commit 48a550f5fd
5 changed files with 105 additions and 63 deletions

View file

@ -1,24 +0,0 @@
package fr.free.nrw.commons.nearby.mvp;
/**
* General View and UserAction methods are defined under
* this interface. This interface can be considered parent
* of both NearbyMapContract and NearbyListContract
*/
public interface NearbyContract {
interface View {
void showPlaces();
}
interface UserActions {
void uploadImageGallery();
void uploadImageCamera();
void bookmarkItem();
void getDirections();
void seeWikidataItem();
void seeWikipediaArticle();
void seeCommonsFilePage();
void rotateScreen();
}
}

View file

@ -1,18 +0,0 @@
package fr.free.nrw.commons.nearby.mvp;
/**
* This interface defines specific View and UserActions for list
* part of the nearby. On the other hand both extends methods
* from parent View and UserActions where general methods are
* defined (in Nearby Contract)
*/
public interface NearbyListContract {
interface View extends NearbyContract.View {
// Even if this is empty for now, I keep this one for code consistency
}
interface UserActions extends NearbyContract.UserActions {
void expandItem();
}
}

View file

@ -1,21 +0,0 @@
package fr.free.nrw.commons.nearby.mvp;
/**
* This interface defines specific View and UserActions for map
* part of the nearby. On the other hand both extends methods
* from parent View and UserActions where general methods are
* defined (in Nearby Contract)
*/
public interface NearbyMapContract {
interface View extends NearbyContract.View{
void showSearchThisAreaButton();
void showInformationBottomSheet();
void showFABs();
}
interface UserActions extends NearbyContract.UserActions {
void searchThisArea();
void recenterMap();
}
}

View file

@ -0,0 +1,50 @@
package fr.free.nrw.commons.nearby.mvp.presenter;
import fr.free.nrw.commons.nearby.mvp.contract.NearbyListContract;
public class NearbyListPresenter implements NearbyListContract.UserActions {
@Override
public void expandItem() {
}
@Override
public void uploadImageGallery() {
}
@Override
public void uploadImageCamera() {
}
@Override
public void bookmarkItem() {
}
@Override
public void getDirections() {
}
@Override
public void seeWikidataItem() {
}
@Override
public void seeWikipediaArticle() {
}
@Override
public void seeCommonsFilePage() {
}
@Override
public void rotateScreen() {
}
}

View file

@ -0,0 +1,55 @@
package fr.free.nrw.commons.nearby.mvp.presenter;
import fr.free.nrw.commons.nearby.mvp.contract.NearbyMapContract;
public class NearbyMapPresenter implements NearbyMapContract.UserActions {
@Override
public void searchThisArea() {
}
@Override
public void recenterMap() {
}
@Override
public void uploadImageGallery() {
}
@Override
public void uploadImageCamera() {
}
@Override
public void bookmarkItem() {
}
@Override
public void getDirections() {
}
@Override
public void seeWikidataItem() {
}
@Override
public void seeWikipediaArticle() {
}
@Override
public void seeCommonsFilePage() {
}
@Override
public void rotateScreen() {
}
}