// Path: app/src/main/java/wseemann/media/romote/utils/ViewUtils.java
// public class ViewUtils {
// 
//     private ViewUtils() {
// 
//     }
// 
//     public static void provideHapticFeedback(View view, int vibrateDurationMs) {
//         if (PreferenceUtils.shouldProvideHapticFeedback(view.getContext())) {
//             Vibrator vibe = (Vibrator) view.getContext().getSystemService(Context.VIBRATOR_SERVICE);
//             vibe.vibrate(vibrateDurationMs);
//         }
//     }
// }


import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import androidx.appcompat.widget.AppCompatImageButton;
import wseemann.media.romote.utils.ViewUtils;
package wseemann.media.romote.view;




public class VibratingImageButton extends AppCompatImageButton {

    private static final int VIBRATE_DURATION_MS = 100;

    private View.OnClickListener mListener;

    public VibratingImageButton(Context context) {
        this(context, null);
    }

    public VibratingImageButton(Context context, AttributeSet attrs) {
        this(context, attrs, android.R.attr.buttonStyle);
    }

    public VibratingImageButton(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        super.setOnClickListener((View view) -> {
// Path: app/src/main/java/wseemann/media/romote/utils/ViewUtils.java
// public class ViewUtils {
// 
//     private ViewUtils() {
// 
//     }
// 
//     public static void provideHapticFeedback(View view, int vibrateDurationMs) {
//         if (PreferenceUtils.shouldProvideHapticFeedback(view.getContext())) {
//             Vibrator vibe = (Vibrator) view.getContext().getSystemService(Context.VIBRATOR_SERVICE);
//             vibe.vibrate(vibrateDurationMs);
//         }
//     }
// }


// Path: app/src/main/java/wseemann/media/romote/view/VibratingImageButton.java
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import androidx.appcompat.widget.AppCompatImageButton;
import wseemann.media.romote.utils.ViewUtils;

package wseemann.media.romote.view;




public class VibratingImageButton extends AppCompatImageButton {

    private static final int VIBRATE_DURATION_MS = 100;

    private View.OnClickListener mListener;

    public VibratingImageButton(Context context) {
        this(context, null);
    }

    public VibratingImageButton(Context context, AttributeSet attrs) {
        this(context, attrs, android.R.attr.buttonStyle);
    }

    public VibratingImageButton(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        super.setOnClickListener((View view) -> {
            ViewUtils.provideHapticFeedback(view, VIBRATE_DURATION_MS);