// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int NOT_AVAILABLE = -100000;
// 
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static int TOAST_VERTICAL_OFFSET ;                    // The Y offset, in dp, for Toasts


import androidx.appcompat.app.AlertDialog;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import org.greenrobot.eventbus.EventBus;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.NOT_AVAILABLE;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.TOAST_VERTICAL_OFFSET;
import android.app.Dialog;
import android.content.DialogInterface;
import android.graphics.PorterDuff;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
                    for (int i = 0; i < tracktypeImageView.length; i++) {
                        if (view == tracktypeImageView[i]) {
                            tracktypeImageView[i].setColorFilter(getResources().getColor(R.color.textColorRecControlPrimary), PorterDuff.Mode.SRC_IN);
                            selectedTrackType = i;
                        } else
                            tracktypeImageView[i].setColorFilter(getResources().getColor(R.color.colorIconDisabledOnDialog), PorterDuff.Mode.SRC_IN);
                    }
                }
            });
        }
        // Activate the right image
        if (selectedTrackType != NOT_AVAILABLE)
            tracktypeImageView[selectedTrackType].setColorFilter(getResources().getColor(R.color.textColorRecControlPrimary), PorterDuff.Mode.SRC_IN);
        else if ((trackToEdit != null) && (trackToEdit.getEstimatedTrackType() != Track.TRACK_TYPE_ND))
            tracktypeImageView[trackToEdit.getEstimatedTrackType()].setColorFilter(getResources().getColor(R.color.textColorRecControlSecondary), PorterDuff.Mode.SRC_IN);

        createPlacemarkAlert.setView(view)
                .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {

                    @Override
                    public void onClick(DialogInterface dialog, int id) {
                        if (isAdded()) {
                            String trackDescription = etDescription.getText().toString();
                            trackToEdit.setDescription (trackDescription.trim());
                            if (selectedTrackType != NOT_AVAILABLE) trackToEdit.setType(selectedTrackType);  // the user selected a track type!
                            GPSApplication.getInstance().gpsDataBase.updateTrack(trackToEdit);
                            if (finalizeTrackWithOk) {
                                // a request to finalize a track
                                EventBus.getDefault().post(EventBusMSG.NEW_TRACK);
                                Toast toast = Toast.makeText(GPSApplication.getInstance().getApplicationContext(), R.string.toast_track_saved_into_tracklist, Toast.LENGTH_SHORT);
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int NOT_AVAILABLE = -100000;
// 
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static int TOAST_VERTICAL_OFFSET ;                    // The Y offset, in dp, for Toasts


// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/FragmentTrackPropertiesDialog.java
import androidx.appcompat.app.AlertDialog;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import org.greenrobot.eventbus.EventBus;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.NOT_AVAILABLE;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.TOAST_VERTICAL_OFFSET;
import android.app.Dialog;
import android.content.DialogInterface;
import android.graphics.PorterDuff;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;

                    for (int i = 0; i < tracktypeImageView.length; i++) {
                        if (view == tracktypeImageView[i]) {
                            tracktypeImageView[i].setColorFilter(getResources().getColor(R.color.textColorRecControlPrimary), PorterDuff.Mode.SRC_IN);
                            selectedTrackType = i;
                        } else
                            tracktypeImageView[i].setColorFilter(getResources().getColor(R.color.colorIconDisabledOnDialog), PorterDuff.Mode.SRC_IN);
                    }
                }
            });
        }
        // Activate the right image
        if (selectedTrackType != NOT_AVAILABLE)
            tracktypeImageView[selectedTrackType].setColorFilter(getResources().getColor(R.color.textColorRecControlPrimary), PorterDuff.Mode.SRC_IN);
        else if ((trackToEdit != null) && (trackToEdit.getEstimatedTrackType() != Track.TRACK_TYPE_ND))
            tracktypeImageView[trackToEdit.getEstimatedTrackType()].setColorFilter(getResources().getColor(R.color.textColorRecControlSecondary), PorterDuff.Mode.SRC_IN);

        createPlacemarkAlert.setView(view)
                .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {

                    @Override
                    public void onClick(DialogInterface dialog, int id) {
                        if (isAdded()) {
                            String trackDescription = etDescription.getText().toString();
                            trackToEdit.setDescription (trackDescription.trim());
                            if (selectedTrackType != NOT_AVAILABLE) trackToEdit.setType(selectedTrackType);  // the user selected a track type!
                            GPSApplication.getInstance().gpsDataBase.updateTrack(trackToEdit);
                            if (finalizeTrackWithOk) {
                                // a request to finalize a track
                                EventBus.getDefault().post(EventBusMSG.NEW_TRACK);
                                Toast toast = Toast.makeText(GPSApplication.getInstance().getApplicationContext(), R.string.toast_track_saved_into_tracklist, Toast.LENGTH_SHORT);
                                toast.setGravity(Gravity.BOTTOM, 0, TOAST_VERTICAL_OFFSET);