package com.friendvilla.bucksbuddy.controls;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.friendvilla.bucksbuddy.R;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;

public class MessageBox extends BottomSheetDialogFragment {
    private final String mssg;
    public MessageBox(String msg) {
        this.mssg = msg;
    }
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.message,container,false);
        TextView msg = v.findViewById(R.id.ttx);
        TextView button = v.findViewById(R.id.btn);
        msg.setText(mssg);setCancelable(false);
        setStyle(BottomSheetDialogFragment.STYLE_NORMAL,R.style.CustomSheet);
        button.setOnClickListener(view -> dismiss());
        return v;
    }
}
