From 0abffde5ef442e8bff1ce7cbfe84bf7e750b3136 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Thu, 12 Sep 2019 19:24:16 +0200 Subject: fixed 2 issues reported by new linter --- .../java/de/pixart/messenger/ui/widget/CopyTextView.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/main/java/de/pixart/messenger/ui') diff --git a/src/main/java/de/pixart/messenger/ui/widget/CopyTextView.java b/src/main/java/de/pixart/messenger/ui/widget/CopyTextView.java index 9d7a5dfb8..683c65ec0 100644 --- a/src/main/java/de/pixart/messenger/ui/widget/CopyTextView.java +++ b/src/main/java/de/pixart/messenger/ui/widget/CopyTextView.java @@ -1,16 +1,14 @@ package de.pixart.messenger.ui.widget; import android.annotation.SuppressLint; -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; @SuppressLint("AppCompatCustomView") -public class CopyTextView extends TextView { +public class CopyTextView extends AppCompatTextView { public CopyTextView(Context context) { super(context); @@ -24,14 +22,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; @@ -42,7 +34,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()) { -- cgit v1.2.3