package com.youra.qlicker.Acitvitys.Finalisation;

import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.github.gcacace.signaturepad.views.SignaturePad;
import com.youra.qlicker.Classes.Globals;
import com.youra.qlicker.R;

public class FinalAutreDocActivity extends AppCompatActivity {

    private WebView webView;
    private String pathDoc = "file:///android_asset/AEOI.html";

    private LinearLayout ly_bottom ;

    @RequiresApi(api = Build.VERSION_CODES.M)
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_final_autre_doc);

        TextView btn_next = (TextView) findViewById(R.id.btn_next);
        SignaturePad signpad =(SignaturePad) findViewById(R.id.signaturePad);
        ImageView img_clear = (ImageView) findViewById(R.id.img_clear);
        ly_bottom = (LinearLayout)findViewById(R.id.ly_bottom);

        /// click btn continuer
        btn_next.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                // startActivity(new Intent( getApplicationContext() ,      .class ));

            }
        });


        /////
        webView = findViewById(R.id.webView);
        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl(pathDoc);
        WebSettings webSettings = webView.getSettings();
        webSettings.setJavaScriptEnabled(true);

        webView.setOnScrollChangeListener(
                (view, scrollX, scrollY, oldScrollX, oldScrollY) ->
                        // calling function rhe tecteed scroll
                        Globals.isScrolling(getApplicationContext() , ly_bottom , view , scrollY   ));




    }
}