package com.za.common.util;

import android.view.View;

public class ClickProxy implements View.OnClickListener {
    private long lastClick = 0;
    private final View.OnClickListener onClickListener;

    public ClickProxy(View.OnClickListener onClickListener) {
        this.onClickListener = onClickListener;
    }

    @Override
    public void onClick(View v) {
        if (System.currentTimeMillis() - lastClick >= 1000) {
            onClickListener.onClick(v);
            lastClick = System.currentTimeMillis();
        }
    }
}
