This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package co.nexlabs.nexyKeyboard.d; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
/* loaded from: classes.dex */ | |
public class NexyConverter { | |
public static boolean a = false; | |
public static boolean b = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LineLogin : ActivityResultContract<LineLogin.Input, LineLoginResult>() { | |
data class Input( | |
val channelId: String, | |
val params: LineAuthenticationParams, | |
val isBrowserLoginOnly: Boolean | |
) | |
override fun createIntent(context: Context, input: Input): Intent { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline fun ImageView.loadWithDefault( | |
url: String?, | |
imageLoader: ImageLoader = Coil.loader(), | |
builder: LoadRequestBuilder.() -> Unit = {} | |
): RequestDisposable { | |
val loadRequestBuilder = LoadRequestBuilder( | |
this.context, LoadRequest( | |
this.context, | |
defaults = DefaultRequestOptions() | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
whenever(imageLoader.load(requestCaptor.capture())).thenAnswer { | |
//Set a black color drawable | |
requestCaptor.lastValue.target?.onSuccess(ColorDrawable(Color.BLACK)) | |
object : RequestDisposable { | |
override fun isDisposed() = true | |
override fun dispose() {} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fakeMovieList.forEachIndexed { index, movie -> | |
//Scroll to position to force onBind | |
onView(withId(R.id.rvMovie)).perform( | |
RecyclerViewActions.scrollToPosition<RecyclerView.ViewHolder>( | |
index | |
) | |
) | |
if (imageLoader is FakeImageLoader) { | |
val fakeImageLoader = imageLoader as FakeImageLoader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
runBlockingTest { | |
imageLoader = TestApplication.appComponent().imageLoader() | |
whenever(imageLoader.load(any())) | |
.thenReturn(object : RequestDisposable { | |
override fun isDisposed() = true | |
override fun dispose() {} | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Module(includes = [TestImageLoaderModule.Provider::class]) | |
abstract class TestImageLoaderModule { | |
@Module | |
object Provider { | |
@Provides @JvmStatic @Singleton fun imageLoader(): ImageLoader { | |
return mock() | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (imageLoader is FakeImageLoader) { | |
val fakeImageLoader = imageLoader as FakeImageLoader | |
val requestSet = fakeImageLoader.requestSet | |
val request = requestSet.elementAt(index) | |
val url = request.data as String | |
Assert.assertEquals(movie.posterPath, url) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FakeImageLoader : ImageLoader { | |
val requestSet = mutableSetOf<Request>() | |
override fun load(request: LoadRequest): RequestDisposable { | |
// Always call onStart before onSuccess. | |
requestSet.add(request) | |
request.target?.onStart(drawable) | |
request.target?.onSuccess(drawable) | |
return disposable |
NewerOlder