package com.example.fitbot.ui.components;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Path;
import android.view.View;

import com.example.fitbot.util.processing.GesturePath;
import com.example.fitbot.util.processing.MotionData;
import com.example.fitbot.util.processing.MotionProcessor;
import com.example.fitbot.util.processing.Vector3;

public class PersonalMotionPreviewElement extends View {

    private GesturePath path;
    private double pathTime = 0.0D; // The timestamp at which the path is currently at.
    private MotionProcessor motionProcessor;
    private Path targetPath, personalPath;

    /**
     * Method that calculates the path that will be drawn on the
     * canvas. This method will be called every time new motion data is received.
     */
    private void calculateDrawingPath(Vector3 transformedVector, MotionData motionData, int sampleIndex, double sampleRate) {

    }


    public PersonalMotionPreviewElement(Context context, GesturePath path) {
        super(context);
        this.path = path;
        this.motionProcessor = new MotionProcessor();
        this.motionProcessor.startListening();
        this.motionProcessor.setMotionDataEventHandler(this::calculateDrawingPath);
        this.targetPath = new Path();
        this.personalPath = new Path();
    }

    @Override
    public void onDraw(Canvas canvas) {
        // Draw the sport preview canvas
    }
}
