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. 5
      app/src/test/java/com/keylesspalace/tusky/FilterTest.kt

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

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

Loading…
Cancel
Save