package com.plugin.capture;

import com.getcapacitor.JSObject;
import com.getcapacitor.Plugin;
import com.getcapacitor.PluginCall;
import com.getcapacitor.PluginMethod;
import com.getcapacitor.annotation.CapacitorPlugin;


@CapacitorPlugin(name = "Capture")
public class CapturePlugin extends Plugin{
    private Capture implementation = new Capture();

    @PluginMethod
    public void echo(PluginCall call) {
        String value = call.getString("value");

        JSObject ret = new JSObject();
        ret.put("value", implementation.echo(value));
        call.resolve(ret);
    }

    @PluginMethod
    public void setScreenCaptureDisabled(PluginCall call) {
        String disable = call.getString("disabled");
        if(implementation == null) {
            implementation = new Capture();
        }
        implementation.setScreenCaptureDisable(getActivity(), disable);
    }
}
