Search in sources :

Example 1 with Path

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

the class Step4 method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view = inflater.inflate(R.layout.fragment_step4, container, false);
    list_zoneRiepilogo = view.findViewById(R.id.list_zoneRiepilogo);
    auth = FirebaseAuth.getInstance();
    db = FirebaseFirestore.getInstance();
    user = auth.getCurrentUser();
    dialog = new Dialog(getContext());
    dialog.setContentView(R.layout.dialog_step4);
    dialog.getWindow().setBackgroundDrawable(getResources().getDrawable(R.drawable.backgroun_dialog));
    dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    dialog.setCancelable(false);
    dialog.getWindow().getAttributes().windowAnimations = R.style.DialogAnimation;
    dialog_termina = dialog.findViewById(R.id.btn_termina);
    dialog_dismiss = dialog.findViewById(R.id.btn_dismiss);
    dialog_delete = new Dialog(getContext());
    dialog_delete.setContentView(R.layout.dialog_delete);
    dialog_delete.getWindow().setBackgroundDrawable(getResources().getDrawable(R.drawable.backgroun_dialog));
    dialog_delete.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    dialog_delete.setCancelable(false);
    dialog_delete.getWindow().getAttributes().windowAnimations = R.style.DialogAnimation;
    dialog_delete_btn = dialog_delete.findViewById(R.id.btn_okay);
    dialog_dismiss_btn = dialog_delete.findViewById(R.id.btn_cancel);
    dialog_title = dialog_delete.findViewById(R.id.textDialog);
    dialog_delete_image = dialog_delete.findViewById(R.id.imageDialog);
    path = new Path();
    progressBar = view.findViewById(R.id.pathLoadingBar);
    return view;
}
Also used : Path(com.example.alphatour.oggetti.Path) Dialog(android.app.Dialog) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Example 2 with Path

use of com.example.alphatour.oggetti.Path 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)

Example 3 with Path

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

the class Step5 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);
    // }
    }
}
Also used : Path(com.example.alphatour.oggetti.Path) ZoneChoosed(com.example.alphatour.oggetti.ZoneChoosed) MapZoneAndObject(com.example.alphatour.oggetti.MapZoneAndObject)

Aggregations

Path (com.example.alphatour.oggetti.Path)3 MapZoneAndObject (com.example.alphatour.oggetti.MapZoneAndObject)2 ZoneChoosed (com.example.alphatour.oggetti.ZoneChoosed)2 Dialog (android.app.Dialog)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1