package com.yono.messeripos.response;

import android.widget.ImageView;

import androidx.databinding.BindingAdapter;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.yono.messeripos.R;

public class PaymentResponse {

    private String url;
    private String bank;
    private boolean isSelected;

    public boolean isSelected() {
        return isSelected;
    }

    public void setSelected(boolean selected) {
        isSelected = selected;
    }

    public PaymentResponse(String url, String bank) {
        this.url = url;
        this.bank = bank;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUrl() {
        return url;
    }

    public String getBank() {
        return bank;
    }

    public void setBank(String bank) {
        this.bank = bank;
    }

    @BindingAdapter("logo_bank")
    public static void loadImage(ImageView view, String url) {
        Glide.with(view.getContext())
                .applyDefaultRequestOptions(new RequestOptions().placeholder(R.drawable.skeleton).error(R.drawable.skeleton))
                .load(url)
                .into(view);
    }
}