package com.jachdev.consumerprotection.ui.webview;

import androidx.appcompat.app.AppCompatActivity;
import butterknife.BindView;

import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.jachdev.commonlibs.base.BaseActivity;
import com.jachdev.consumerprotection.R;

public class WebViewActivity extends BaseActivity {

    @BindView(R.id.webview)
    WebView webView;

    @Override
    protected int layoutRes() {
        return R.layout.activity_web_view;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_web_view);

        init();
    }

    private void init() {

        webView = (WebView) findViewById(R.id.webview);
        // Configure related browser settings
        webView.getSettings().setLoadsImagesAutomatically(true);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
        // Configure the client to use when opening URLs
        webView.setWebViewClient(new WebViewClient());
        // Load the initial URL
        webView.loadUrl("https://unimeal.com/step-goal");
    }
}