From a39fff5c8efe174beb5fd72ed2816dbfeafacd73 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 11 Sep 2019 15:42:43 +0200 Subject: [PATCH] fixed 2 issues reported by new linter --- .../services/NotificationService.java | 2 +- .../conversations/ui/widget/CopyTextView.java | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index 01bf371af..79f1dd526 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -954,7 +954,7 @@ public class NotificationService { createTryAgainIntent()); mBuilder.setDeleteIntent(createDismissErrorIntent()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - mBuilder.setVisibility(NotificationCompat.VISIBILITY_PRIVATE); + mBuilder.setVisibility(Notification.VISIBILITY_PRIVATE); mBuilder.setSmallIcon(R.drawable.ic_warning_white_24dp); } else { mBuilder.setSmallIcon(R.drawable.ic_stat_alert_warning); diff --git a/src/main/java/eu/siacs/conversations/ui/widget/CopyTextView.java b/src/main/java/eu/siacs/conversations/ui/widget/CopyTextView.java index bed56192e..d22a2deae 100644 --- a/src/main/java/eu/siacs/conversations/ui/widget/CopyTextView.java +++ b/src/main/java/eu/siacs/conversations/ui/widget/CopyTextView.java @@ -1,14 +1,12 @@ package eu.siacs.conversations.ui.widget; -import android.annotation.TargetApi; import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; -import android.os.Build; +import android.support.v7.widget.AppCompatTextView; import android.util.AttributeSet; -import android.widget.TextView; -public class CopyTextView extends TextView { +public class CopyTextView extends AppCompatTextView { public CopyTextView(Context context) { super(context); @@ -22,14 +20,8 @@ public class CopyTextView extends TextView { super(context, attrs, defStyleAttr); } - @SuppressWarnings("unused") - @TargetApi(Build.VERSION_CODES.LOLLIPOP) - public CopyTextView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); - } - public interface CopyHandler { - public String transformTextForCopy(CharSequence text, int start, int end); + String transformTextForCopy(CharSequence text, int start, int end); } private CopyHandler copyHandler; @@ -40,7 +32,7 @@ public class CopyTextView extends TextView { @Override public boolean onTextContextMenuItem(int id) { - CharSequence text = getText(); + final CharSequence text = getText(); int min = 0; int max = text.length(); if (isFocused()) {