fixed 2 issues reported by new linter

This commit is contained in:
Daniel Gultsch 2019-09-11 15:42:43 +02:00
parent 810d3455a2
commit a39fff5c8e
2 changed files with 5 additions and 13 deletions

View File

@ -954,7 +954,7 @@ public class NotificationService {
createTryAgainIntent()); createTryAgainIntent());
mBuilder.setDeleteIntent(createDismissErrorIntent()); mBuilder.setDeleteIntent(createDismissErrorIntent());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 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); mBuilder.setSmallIcon(R.drawable.ic_warning_white_24dp);
} else { } else {
mBuilder.setSmallIcon(R.drawable.ic_stat_alert_warning); mBuilder.setSmallIcon(R.drawable.ic_stat_alert_warning);

View File

@ -1,14 +1,12 @@
package eu.siacs.conversations.ui.widget; package eu.siacs.conversations.ui.widget;
import android.annotation.TargetApi;
import android.content.ClipData; import android.content.ClipData;
import android.content.ClipboardManager; import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.os.Build; import android.support.v7.widget.AppCompatTextView;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.widget.TextView;
public class CopyTextView extends TextView { public class CopyTextView extends AppCompatTextView {
public CopyTextView(Context context) { public CopyTextView(Context context) {
super(context); super(context);
@ -22,14 +20,8 @@ public class CopyTextView extends TextView {
super(context, attrs, defStyleAttr); 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 interface CopyHandler {
public String transformTextForCopy(CharSequence text, int start, int end); String transformTextForCopy(CharSequence text, int start, int end);
} }
private CopyHandler copyHandler; private CopyHandler copyHandler;
@ -40,7 +32,7 @@ public class CopyTextView extends TextView {
@Override @Override
public boolean onTextContextMenuItem(int id) { public boolean onTextContextMenuItem(int id) {
CharSequence text = getText(); final CharSequence text = getText();
int min = 0; int min = 0;
int max = text.length(); int max = text.length();
if (isFocused()) { if (isFocused()) {