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 ReceivedMediaRepository( | |
private val receivedMediaApiHelper: ReceivedMediaApiHelper, | |
private val receivedMediaDbHelper: ReceivedMediaDbHelper, | |
coroutineContext: CoroutineContext, | |
) : CoroutineScope by CoroutineScope(coroutineContext) { | |
private val coroutineScope = CoroutineScope(coroutineContext) | |
private val factory = ReceivedMediaStoreFactory(api = receivedMediaApiHelper, db = receivedMediaDbHelper) | |
private val mutableStore = factory.create() |
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
/** | |
* Created by Roman Chernyak (aka @electrolobzik) on 2024-02-22 | |
*/ | |
class Paginator<Data : Any, Cursor : Any>( | |
coroutineContext: CoroutineContext | |
) : CoroutineScope by CoroutineScope(coroutineContext) { | |
private val _state = MutableStateFlow<State<Data, Cursor>>(State.NoData.Empty()) | |
private val _sideEffects = MutableSharedFlow<SideEffect<Cursor>>() | |
private val inputActions = MutableSharedFlow<Action<Data, Cursor>>() |
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
import org.jetbrains.spek.api.Spek | |
import org.jetbrains.spek.api.dsl.given | |
import org.jetbrains.spek.api.dsl.it | |
import org.junit.Assert | |
class ExampleSpekTest : Spek({ | |
val x = 2 | |
val y = 3 |
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
/** | |
* Created with Android Studio | |
* User: electrolobzik [email protected] | |
* Date: 07/04/2017 | |
* Time: 18:55 | |
* | |
* Provides delegates for implementing regular and lazy not nullable properties which should be disposed in some moment to free memory | |
*/ | |
class DisposablePropertyManager { |
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
/** | |
* Created with Android Studio | |
* User: electrolobzik [email protected] | |
* Date: 27/03/2017 | |
* Time: 22:05 | |
* | |
* Event bus implementation with RxJava and RxRelay (https://github.com/JakeWharton/RxRelay) with API similar to https://github.com/greenrobot/EventBus | |
*/ | |
class RxBus<T> { | |
var stickyEvent: T? = null |
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
/** | |
* Factory for creating a face tracker to be associated with a new face. The multiprocessor | |
* uses this factory to create face trackers as needed -- one for each individual. | |
*/ | |
private class GraphicFaceTrackerFactory implements MultiProcessor.Factory<Face> { | |
@Override | |
public Tracker<Face> create(Face face) { | |
return FaceTracker.builder() | |
.withCameraType(CameraType.FrontCamera) | |
.withPreviewWidth(cameraSource.getPreviewSize().getHeight()) |
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 com.inperson.android.utils.leastview; | |
import android.content.Context; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
import android.view.ViewGroup; | |
public class WrappableGridLayoutManager extends GridLayoutManager { |
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
/* | |
* Copyright 2014 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
#!/bin/sh | |
# This script runs a configure script with the Android NDK toolchain | |
# You may need to adjust the COMPILE_TARGET and ANDROID_API variables | |
# depending on your requirements. | |
# | |
# Call this script in a directory with a valid configure script. | |
# Example: PREFIX=${PWD}/bin android-configure.sh | |
# Set the ANDROID_NDK variable to the root |
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
// TypeToken is a Gson class | |
Type type = new TypeToken<List<Author>>(){}.getType(); | |
GsonFieldConverterFactory factory = new GsonFieldConverterFactory(type); | |
// Register the factory and set the instance as the global Cupboard instance | |
CupboardFactory.setCupboard(new CupboardBuilder().registerFieldConverterFactory(factory).build()); |
NewerOlder