Search in sources :

Example 1 with MapZoneAndObject

use of com.example.alphatour.oggetti.MapZoneAndObject in project AlphaTour by Frank99DG.

the class PercorsoWizard method moveToDashboard.

private void moveToDashboard() {
    List<String> a = Step4.getZone_select();
    List<String> b = Step4.getOggetti_select();
    List<String> c = Step2.getArray_database();
    List<MapZoneAndObject> d = Step4.getZoneAndObjectList_();
    List<MapZoneAndObject> e = ReviewZoneSelected.getZoneAndObjectList();
    List<MapZoneAndObject> f = CreateJsonActivity.getZoneAndObjectListReviewPath();
    if (a.isEmpty())
        Step4.getZone_select().clear();
    if (b.isEmpty())
        Step4.getOggetti_select().clear();
    if (c.isEmpty())
        Step2.getArray_database().clear();
    if (d.isEmpty())
        Step4.getZoneAndObjectList_().clear();
    if (e.isEmpty())
        ReviewZoneSelected.getZoneAndObjectList().clear();
    if (f.isEmpty())
        CreateJsonActivity.getZoneAndObjectListReviewPath().clear();
    DashboardActivity.setFirstZoneChosen(false);
    PercorsoWizard.setDescriptionPath("");
    PercorsoWizard.setNamePath("");
    PercorsoWizard.setPlace(null);
    Intent intent = new Intent(PercorsoWizard.this, DashboardActivity.class);
    startActivity(intent);
}
Also used : MapZoneAndObject(com.example.alphatour.oggetti.MapZoneAndObject) Intent(android.content.Intent)

Example 2 with MapZoneAndObject

use of com.example.alphatour.oggetti.MapZoneAndObject in project AlphaTour by Frank99DG.

the class Step3 method verifyStep.

@Nullable
@Override
public VerificationError verifyStep() {
    VerificationError error = null;
    control = false;
    for (int a = 0; a < arrayMonumenti.size(); a++) {
        // ciclo per contare quanti sono checkati
        if (arrayMonumenti.get(a).isChecked()) {
            // salvataggio degli oggetti scelti
            oggetti_scelti.add(arrayStringElement.get(a));
            Step4.getOggetti_select().add(arrayStringElement.get(a));
            control = true;
        }
    }
    if (control) {
        MapZoneAndObject zoneAndObject = new MapZoneAndObject(DashboardActivity.getZona_scelta(), oggetti_scelti, PercorsoWizard.getNamePath(), PercorsoWizard.getDescriptionPath());
        zoneAndObjectList.add(zoneAndObject);
    }
    if (control == false) {
        error = new VerificationError("Seleziona almeno un oggetto");
        return error;
    }
    return null;
}
Also used : VerificationError(com.stepstone.stepper.VerificationError) MapZoneAndObject(com.example.alphatour.oggetti.MapZoneAndObject) Nullable(androidx.annotation.Nullable)

Example 3 with MapZoneAndObject

use of com.example.alphatour.oggetti.MapZoneAndObject in project AlphaTour by Frank99DG.

the class CreateJsonActivity method moveToDashboard.

private void moveToDashboard() {
    List<String> a = Step4.getZone_select();
    List<String> b = Step4.getOggetti_select();
    List<String> c = Step2.getArray_database();
    List<MapZoneAndObject> d = Step4.getZoneAndObjectList_();
    List<MapZoneAndObject> e = ReviewZoneSelected.getZoneAndObjectList();
    List<MapZoneAndObject> f = CreateJsonActivity.getZoneAndObjectListReviewPath();
    if (a.isEmpty())
        Step4.getZone_select().clear();
    if (b.isEmpty())
        Step4.getOggetti_select().clear();
    if (c.isEmpty())
        Step2.getArray_database().clear();
    if (d.isEmpty())
        Step4.getZoneAndObjectList_().clear();
    if (e.isEmpty())
        ReviewZoneSelected.getZoneAndObjectList().clear();
    if (f.isEmpty())
        CreateJsonActivity.getZoneAndObjectListReviewPath().clear();
    zoneAndObjectListReviewPath.clear();
    DashboardActivity.setFirstZoneChosen(false);
    PercorsoWizard.setDescriptionPath("");
    PercorsoWizard.setNamePath("");
    PercorsoWizard.setPlace(null);
    Intent intent = new Intent(CreateJsonActivity.this, DashboardActivity.class);
    startActivity(intent);
}
Also used : MapZoneAndObject(com.example.alphatour.oggetti.MapZoneAndObject) Intent(android.content.Intent)

Example 4 with MapZoneAndObject

use of com.example.alphatour.oggetti.MapZoneAndObject in project AlphaTour by Frank99DG.

the class Step1 method moveToDashboard.

private void moveToDashboard() {
    List<String> a = Step4.getZone_select();
    List<String> b = Step4.getOggetti_select();
    List<String> c = Step2.getArray_database();
    List<MapZoneAndObject> d = Step4.getZoneAndObjectList_();
    List<MapZoneAndObject> e = ReviewZoneSelected.getZoneAndObjectList();
    List<MapZoneAndObject> f = CreateJsonActivity.getZoneAndObjectListReviewPath();
    if (a.isEmpty())
        Step4.getZone_select().clear();
    if (b.isEmpty())
        Step4.getOggetti_select().clear();
    if (c.isEmpty())
        Step2.getArray_database().clear();
    if (d.isEmpty())
        Step4.getZoneAndObjectList_().clear();
    if (e.isEmpty())
        ReviewZoneSelected.getZoneAndObjectList().clear();
    if (f.isEmpty())
        CreateJsonActivity.getZoneAndObjectListReviewPath().clear();
    DashboardActivity.setFirstZoneChosen(false);
    PercorsoWizard.setDescriptionPath("");
    PercorsoWizard.setNamePath("");
    PercorsoWizard.setPlace(null);
    Intent intent = new Intent(getContext(), DashboardActivity.class);
    startActivity(intent);
}
Also used : MapZoneAndObject(com.example.alphatour.oggetti.MapZoneAndObject) Intent(android.content.Intent)

Example 5 with MapZoneAndObject

use of com.example.alphatour.oggetti.MapZoneAndObject in project AlphaTour by Frank99DG.

the class Step4 method savePath.

private void savePath() {
    progressBar.setVisibility(View.VISIBLE);
    List<MapZoneAndObject> zoneAndObjectList = zoneAndObjectList_;
    MapZoneAndObject mapZoneAndOb = zoneAndObjectList.get(0);
    Path path = new Path();
    path.setName(mapZoneAndOb.getName());
    path.setDescription(mapZoneAndOb.getDescription());
    path.setIdUser(user.getUid());
    for (int i = 0; i < zoneAndObjectList_.size(); i++) {
        MapZoneAndObject mapZoneAndObject = zoneAndObjectList.get(i);
        // String delete = "delete";
        // if(!mapZoneAndObject.getZone().matches(delete)) {
        ZoneChoosed zoneChoosed = new ZoneChoosed();
        zoneChoosed.setName(mapZoneAndObject.getZone());
        List<String> obj = mapZoneAndObject.getListObj();
        for (int j = 0; j < obj.size(); j++) {
            zoneChoosed.setObjectChoosed(obj.get(j));
        }
        graph.addVertex(zoneChoosed);
        zoneChooseds.add(zoneChoosed);
        if (i >= 1) {
            graph.addEdge(zoneChooseds.get(i - 1), zoneChooseds.get(i));
        }
        path.setZonePath(zoneChoosed);
    // }
    }
    if (receiver.isConnected()) {
        savePathRemote(path);
        savePathLocal(path);
    } else {
        savePathRemote(path);
        savePathLocal(path);
        moveToCreateJsonActivity();
        progressBar.setVisibility(View.GONE);
    }
}
Also used : Path(com.example.alphatour.oggetti.Path) ZoneChoosed(com.example.alphatour.oggetti.ZoneChoosed) MapZoneAndObject(com.example.alphatour.oggetti.MapZoneAndObject)

Aggregations

MapZoneAndObject (com.example.alphatour.oggetti.MapZoneAndObject)7 Intent (android.content.Intent)3 Path (com.example.alphatour.oggetti.Path)2 ZoneChoosed (com.example.alphatour.oggetti.ZoneChoosed)2 Nullable (androidx.annotation.Nullable)1 VerificationError (com.stepstone.stepper.VerificationError)1