Messaging: Let there be lambdas

Change-Id: Iee1fc46c92ea9159abb10d92d34baee937bdee0c
This commit is contained in:
Michael W
2024-12-26 14:55:12 +01:00
parent c1b4aa4dfe
commit d43b6ff1c4
84 changed files with 991 additions and 1697 deletions
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,8 +24,6 @@ import androidx.annotation.Nullable;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.ViewGroup;
import android.widget.FrameLayout.LayoutParams;
import android.widget.ImageView;
@@ -93,22 +92,16 @@ public class AttachmentPreviewFactory {
}
if (attachmentView != null && clickListener != null) {
attachmentView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View view) {
final Rect bounds = UiUtils.getMeasuredBoundsOnScreen(view);
clickListener.onAttachmentClick(attachmentData, bounds,
false /* longPress */);
}
});
attachmentView.setOnLongClickListener(new OnLongClickListener() {
@Override
public boolean onLongClick(final View view) {
final Rect bounds = UiUtils.getMeasuredBoundsOnScreen(view);
return clickListener.onAttachmentClick(attachmentData, bounds,
true /* longPress */);
}
});
attachmentView.setOnClickListener(view -> {
final Rect bounds = UiUtils.getMeasuredBoundsOnScreen(view);
clickListener.onAttachmentClick(attachmentData, bounds,
false /* longPress */);
});
attachmentView.setOnLongClickListener(view -> {
final Rect bounds = UiUtils.getMeasuredBoundsOnScreen(view);
return clickListener.onAttachmentClick(attachmentData, bounds,
true /* longPress */);
});
}
return attachmentView;
}