package com.yono.messeripos;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.os.Bundle;
import android.util.Log;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;

import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.textview.MaterialTextView;
import com.yono.messeripos.models.PaymentsModels;
import com.yono.messeripos.models.VaNumberModels;
import com.yono.messeripos.response.DataResponse;

import java.util.List;

import androidmads.library.qrgenearator.QRGContents;
import androidmads.library.qrgenearator.QRGEncoder;

public class PaymentCreated extends BottomSheetDialogFragment {

    Button btnHome;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View v = inflater.inflate(
                R.layout.activity_q_r_code,
                container,
                false
        );

        btnHome = v.findViewById(R.id.btnBackHome);

        btnHome.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(v.getContext(), MainActivity.class));
                getActivity().finish();
            }
        });

        return v;
    }
}

//        qrCode = v.findViewById(R.id.qr_image);
//        vaText = v.findViewById(R.id.etVA);
//
//        WindowManager manager = (WindowManager) getActivity().getSystemService(Context.WINDOW_SERVICE);
//
//        Display display = manager.getDefaultDisplay();
//        Point point = new Point();
//        display.getSize(point);
//        int width = point.x;
//        int height = point.y;
//        int smallDimens = Math.min(width, height);
//        smallDimens = smallDimens * 3 / 4;
//        qrgEncoder = new QRGEncoder(
//                "inputValue", null,
//                QRGContents.Type.TEXT,
//                smallDimens
//        );
//
//        try {
//            bitmap = qrgEncoder.getBitmap();
//            qrCode.setImageBitmap(bitmap);
//        }catch (Exception e) {
//            Log.d("onCreate: ", e.toString());
//        }
//
//        return v;
//    }
