Fix test and lint
This commit is contained in:
parent
ad894756bc
commit
6c9f819431
|
@ -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…
Reference in New Issue