Verified Commit 532edff6 authored by akwizgran's avatar akwizgran

Minor code cleanups.

parent c229e194
Pipeline #2945 passed with stage
in 8 minutes and 53 seconds
......@@ -78,7 +78,9 @@ public class ImagePreview extends ConstraintLayout {
}
interface ImagePreviewListener {
void onUriError(Uri uri);
void onCancel();
}
......
......@@ -25,8 +25,7 @@ class ImagePreviewAdapter extends Adapter<ImagePreviewViewHolder> {
@LayoutRes
private final int layout;
public ImagePreviewAdapter(Collection<Uri> items,
ImagePreviewListener listener) {
ImagePreviewAdapter(Collection<Uri> items, ImagePreviewListener listener) {
this.items = new ArrayList<>(items);
this.listener = listener;
this.layout = items.size() == 1 ?
......@@ -35,14 +34,16 @@ class ImagePreviewAdapter extends Adapter<ImagePreviewViewHolder> {
}
@Override
public ImagePreviewViewHolder onCreateViewHolder(ViewGroup viewGroup, int type) {
public ImagePreviewViewHolder onCreateViewHolder(ViewGroup viewGroup,
int type) {
View v = LayoutInflater.from(viewGroup.getContext())
.inflate(layout, viewGroup, false);
return new ImagePreviewViewHolder(v, requireNonNull(listener));
}
@Override
public void onBindViewHolder(ImagePreviewViewHolder viewHolder, int position) {
public void onBindViewHolder(ImagePreviewViewHolder viewHolder,
int position) {
viewHolder.bind(items.get(position));
}
......
......@@ -188,6 +188,7 @@ public class TextAttachmentController extends TextSendController
}
private static class SavedState extends AbsSavedState {
@Nullable
private List<Uri> imageUris;
......@@ -207,16 +208,18 @@ public class TextAttachmentController extends TextSendController
out.writeList(imageUris);
}
public static final Parcelable.Creator<SavedState> CREATOR
= new Parcelable.Creator<SavedState>() {
public SavedState createFromParcel(Parcel in) {
return new SavedState(in);
}
public SavedState[] newArray(int size) {
return new SavedState[size];
}
};
public static final Creator<SavedState> CREATOR =
new Creator<SavedState>() {
@Override
public SavedState createFromParcel(Parcel in) {
return new SavedState(in);
}
@Override
public SavedState[] newArray(int size) {
return new SavedState[size];
}
};
}
public interface AttachImageListener {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment