1.8 fixes (#637)

* fix lint warnings

* upgrade dependencies

* auto cancel notifications

* improve dependency injection

* fix tests

* remove old comment from BaseActivity

* fix missing injectors
This commit is contained in:
Konrad Pozniak 2018-05-08 19:15:10 +02:00 committed by GitHub
commit 27b4cf8739
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 34 additions and 135 deletions

View file

@ -6,6 +6,6 @@ import android.text.style.ClickableSpan
abstract class ClickableSpanNoUnderline : ClickableSpan() {
override fun updateDrawState(ds: TextPaint?) {
super.updateDrawState(ds)
ds?.isUnderlineText = false;
ds?.isUnderlineText = false
}
}

View file

@ -264,6 +264,7 @@ public class NotificationHelper {
.setDeleteIntent(deletePendingIntent)
.setColor(ContextCompat.getColor(context, (R.color.primary)))
.setGroup(account.getAccountId())
.setAutoCancel(true)
.setDefaults(0); // So it doesn't ring twice, notify only in Target callback
setupPreferences(account, builder);
@ -521,7 +522,6 @@ public class NotificationHelper {
return null;
}
@Nullable
private static String bodyForType(Notification notification) {
switch (notification.getType()) {
case FOLLOW:

View file

@ -1,17 +1,9 @@
package com.keylesspalace.tusky.util;
import android.util.Patterns;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.regex.Matcher;
public class StringUtils {
public final static String carriageReturn = System.getProperty("line.separator");
final static String QUOTE = "\"";
public static String randomAlphanumericString(int count) {
char[] chars = new char[count];
Random random = new Random();
@ -22,13 +14,4 @@ public class StringUtils {
return new String(chars);
}
static List<String> extractUrl(String text) {
List<String> links = new ArrayList<>();
Matcher m = Patterns.WEB_URL.matcher(text);
while (m.find()) {
String url = m.group();
links.add(url);
}
return links;
}
}