remove dead code

This commit is contained in:
B. Petersen 2020-11-25 10:45:41 +01:00
parent 1cfb70cb5b
commit d4ef19b9cf
No known key found for this signature in database
GPG key ID: 3B88E92DEA8E9AFC

View file

@ -3,7 +3,6 @@ package org.thoughtcrime.securesms.components;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.graphics.Color;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.text.TextUtils; import android.text.TextUtils;
@ -41,8 +40,6 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
private static final String TAG = QuoteView.class.getSimpleName(); private static final String TAG = QuoteView.class.getSimpleName();
private static final int MESSAGE_TYPE_PREVIEW = 0; private static final int MESSAGE_TYPE_PREVIEW = 0;
private static final int MESSAGE_TYPE_OUTGOING = 1;
private static final int MESSAGE_TYPE_INCOMING = 2;
private ViewGroup mainView; private ViewGroup mainView;
private TextView authorView; private TextView authorView;
@ -56,13 +53,8 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
private DcMsg quotedMsg; private DcMsg quotedMsg;
private DcContact author; private DcContact author;
private CharSequence body; private CharSequence body;
//private TextView missingLinkText;
private SlideDeck attachments; private SlideDeck attachments;
private int messageType; private int messageType;
private int largeCornerRadius;
private int smallCornerRadius;
// private CornerMask cornerMask;
public QuoteView(Context context) { public QuoteView(Context context) {
super(context); super(context);
@ -96,16 +88,9 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
this.attachmentVideoOverlayView = findViewById(R.id.quote_video_overlay); this.attachmentVideoOverlayView = findViewById(R.id.quote_video_overlay);
this.attachmentContainerView = findViewById(R.id.quote_attachment_container); this.attachmentContainerView = findViewById(R.id.quote_attachment_container);
this.dismissView = findViewById(R.id.quote_dismiss); this.dismissView = findViewById(R.id.quote_dismiss);
// this.largeCornerRadius = getResources().getDimensionPixelSize(R.dimen.quote_corner_radius_large);
// this.smallCornerRadius = getResources().getDimensionPixelSize(R.dimen.quote_corner_radius_bottom);
// cornerMask = new CornerMask(this);
// cornerMask.setRadii(largeCornerRadius, largeCornerRadius, smallCornerRadius, smallCornerRadius);
if (attrs != null) { if (attrs != null) {
TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.QuoteView, 0, 0); TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.QuoteView, 0, 0);
int primaryColor = typedArray.getColor(R.styleable.QuoteView_quote_colorPrimary, Color.BLACK);
int secondaryColor = typedArray.getColor(R.styleable.QuoteView_quote_colorSecondary, Color.BLACK);
messageType = typedArray.getInt(R.styleable.QuoteView_message_type, 0); messageType = typedArray.getInt(R.styleable.QuoteView_message_type, 0);
typedArray.recycle(); typedArray.recycle();
@ -115,27 +100,14 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
} else { } else {
bodyView.setMaxLines(3); bodyView.setMaxLines(3);
} }
// if (messageType == MESSAGE_TYPE_PREVIEW) {
// int radius = getResources().getDimensionPixelOffset(R.dimen.quote_corner_radius_preview);
// cornerMask.setTopLeftRadius(radius);
// cornerMask.setTopRightRadius(radius);
// }
} }
dismissView.setOnClickListener(view -> setVisibility(GONE)); dismissView.setOnClickListener(view -> setVisibility(GONE));
} }
//
// @Override
// protected void dispatchDraw(Canvas canvas) {
// super.dispatchDraw(canvas);
// cornerMask.mask(canvas);
// }
@Override @Override
protected void onDetachedFromWindow() { protected void onDetachedFromWindow() {
super.onDetachedFromWindow(); super.onDetachedFromWindow();
//if (author != null) author.removeForeverObserver(this);
} }
public void setQuote(GlideRequests glideRequests, public void setQuote(GlideRequests glideRequests,
@ -144,28 +116,17 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
@Nullable CharSequence body, @Nullable CharSequence body,
@NonNull SlideDeck attachments) @NonNull SlideDeck attachments)
{ {
// if (this.author != null) this.author.removeForeverObserver(this);
quotedMsg = msg; quotedMsg = msg;
this.author = author != null ? author.getDcContact() : null; this.author = author != null ? author.getDcContact() : null;
this.body = body; this.body = body;
this.attachments = attachments; this.attachments = attachments;
//this.author.observeForever(this);
setQuoteAuthor(author); setQuoteAuthor(author);
setQuoteText(body, attachments); setQuoteText(body, attachments);
setQuoteAttachment(glideRequests, attachments); setQuoteAttachment(glideRequests, attachments);
//setQuoteMissingFooter(originalMissing);
} }
// public void setTopCornerSizes(boolean topLeftLarge, boolean topRightLarge) {
// cornerMask.setTopLeftRadius(topLeftLarge ? largeCornerRadius : smallCornerRadius);
// cornerMask.setTopRightRadius(topRightLarge ? largeCornerRadius : smallCornerRadius);
// }
public void dismiss() { public void dismiss() {
//if (this.author != null) this.author.removeForeverObserver(this);
this.author = null; this.author = null;
this.body = null; this.body = null;
@ -240,11 +201,6 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
dismissView.setBackgroundResource(R.drawable.circle_alpha); dismissView.setBackgroundResource(R.drawable.circle_alpha);
} }
} }
//
// private void setQuoteMissingFooter(boolean missing) {
// footerView.setVisibility(missing ? VISIBLE : GONE);
// footerView.setBackgroundColor(author.getColor());
// }
public CharSequence getBody() { public CharSequence getBody() {
return body; return body;