// 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.fragment.app.FragmentManager;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.TOAST_VERTICAL_OFFSET;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

    @Override
    public void onPause() {
        EventBus.getDefault().unregister(this);
        super.onPause();
    }

    /**
     * The EventBus receiver for Short Messages.
     */
    @Subscribe (threadMode = ThreadMode.MAIN)
    public void onEvent(Short msg) {
        if (msg == EventBusMSG.UPDATE_TRACK) {
            Update();
        }
    }

    /**
     * Toggles the status of the recording, by managing the button behaviour and
     * the status of the recording process.
     * It also displays some toasts to inform the user about some conditions.
     */
    public void onToggleRecord() {
        if (isAdded()) {
            if (!gpsApp.isBottomBarLocked()) {
                if (!gpsApp.isStopButtonFlag()) {
                    gpsApp.setRecording(!gpsApp.isRecording());
                    if (!gpsApp.isFirstFixFound() && (gpsApp.isRecording())) {
                        if (toast != null) toast.cancel();
                        toast = Toast.makeText(gpsApp.getApplicationContext(), R.string.toast_recording_when_gps_found, Toast.LENGTH_LONG);
// 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/FragmentRecordingControls.java
import androidx.fragment.app.FragmentManager;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.TOAST_VERTICAL_OFFSET;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;


    @Override
    public void onPause() {
        EventBus.getDefault().unregister(this);
        super.onPause();
    }

    /**
     * The EventBus receiver for Short Messages.
     */
    @Subscribe (threadMode = ThreadMode.MAIN)
    public void onEvent(Short msg) {
        if (msg == EventBusMSG.UPDATE_TRACK) {
            Update();
        }
    }

    /**
     * Toggles the status of the recording, by managing the button behaviour and
     * the status of the recording process.
     * It also displays some toasts to inform the user about some conditions.
     */
    public void onToggleRecord() {
        if (isAdded()) {
            if (!gpsApp.isBottomBarLocked()) {
                if (!gpsApp.isStopButtonFlag()) {
                    gpsApp.setRecording(!gpsApp.isRecording());
                    if (!gpsApp.isFirstFixFound() && (gpsApp.isRecording())) {
                        if (toast != null) toast.cancel();
                        toast = Toast.makeText(gpsApp.getApplicationContext(), R.string.toast_recording_when_gps_found, Toast.LENGTH_LONG);
                        toast.setGravity(Gravity.BOTTOM, 0, TOAST_VERTICAL_OFFSET);