Fix test and lint

main
a1batross 5 years ago
parent 8641b0f220
commit 473ac895b9
  1. 5
      app/src/main/java/com/keylesspalace/tusky/view/EmojiKeyboard.java
  2. 7
      app/src/test/java/com/keylesspalace/tusky/FilterTest.kt

@ -5,6 +5,7 @@ import android.content.*;
import android.util.*;
import android.widget.*;
import android.app.*;
import android.text.*;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;
import androidx.viewpager2.widget.ViewPager2;
@ -90,12 +91,12 @@ public class EmojiKeyboard extends LinearLayout {
if(size > MAX_RECENTS_ITEMS) {
List<String> list = new ArrayList<String>(recents);
list = list.subList(size - MAX_RECENTS_ITEMS, size);
joined = String.join(RECENTS_DELIM, list);
joined = TextUtils.join(RECENTS_DELIM, list);
if(isSticky) {
recents = new LinkedHashSet<String>(list);
}
} else {
joined = String.join(RECENTS_DELIM, recents);
joined = TextUtils.join(RECENTS_DELIM, recents);
}
editor.putString(preferenceKey, joined);

@ -11,6 +11,7 @@ import com.keylesspalace.tusky.fragment.SFragment
import com.keylesspalace.tusky.network.MastodonApi
import com.nhaarman.mockitokotlin2.mock
import okhttp3.Request
import okio.Timeout
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Before
@ -57,7 +58,9 @@ class FilterTest {
override fun request(): Request {
throw Error("not implemented")
}
override fun timeout(): Timeout {
throw Error("not implemented")
}
override fun enqueue(callback: Callback<List<Filter>>) {
callback.onResponse(
this,
@ -250,4 +253,4 @@ class FakeFragment: SFragment() {
override fun filterIsRelevant(filter: Filter): Boolean {
return filter.context.contains(Filter.HOME)
}
}
}

Loading…
Cancel
Save