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 routing | |
import Readers._ | |
import cats.implicits._ | |
import errors.internal.base.AppError | |
import play.api.libs.json.{Json, OWrites} | |
sealed trait PathSegment | |
object PathSegment { |
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
sealed trait AcquiringOrder extends Product with Serializable { | |
val id: BSONObjectID | |
val info: AcquiringOrder.Info | |
val createdAt: OffsetDateTime | |
val updatedAt: OffsetDateTime | |
} | |
object AcquiringOrder { |
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
/************ 1 ******************/ | |
class LaunchesSceneController @Inject constructor( | |
private val dateTimeFormatter: DateTimeFormatter | |
) : SceneController() { | |
var launches = emptyList<LaunchEntity>() | |
var isProgressBarVisible = false | |
var onLaunchClicked: ((launch: LaunchEntity) -> Unit)? = 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
1 |
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 FullscreenImagesDialogFragment : DialogFragment() { | |
sealed class Params { | |
@Parcelize | |
data class Images( | |
val images: List<String>, | |
val offset: Int = 0 | |
) : Params(), Parcelable |
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 <reified T> Fragment.argument(name: String? = null): ReadOnlyProperty<Fragment, T> = | |
object : ReadOnlyProperty<Fragment, T> { | |
override operator fun getValue(thisRef: Fragment, property: KProperty<*>): T { | |
return thisRef.arguments?.get(name ?: property.name) as T | |
} | |
} | |
class FullscreenImagesDialogFragment : DialogFragment() { | |
private val something by argument<String>(SOMETHING_KEY) |
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
override fun findSnapView(layoutManager: RecyclerView.LayoutManager) = | |
if (layoutManager is LinearLayoutManager) { | |
if (layoutManager.canScrollHorizontally()) { | |
getStartView(layoutManager, getHorizontalHelper(layoutManager)) | |
} else { | |
getStartView(layoutManager, getVerticalHelper(layoutManager)) | |
} | |
} else { | |
super.findSnapView(layoutManager) | |
} |
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
override fun currentUserCollection(page: Int?, limit: Int?): Single<PaginationResponse<UserCurrentEntity>> = | |
Single.create<PaginationResponse<UserCurrentEntity>> { emitter -> | |
realm.executeTransaction { realm -> | |
realm.where(RealmUserCurrentEntity::class.java) | |
.findAll() | |
.run { | |
val items = this.drop(page * limit) | |
.take(limit) | |
.let { realm.copyFromRealm(it) } | |
.map { it.toDomain() } |
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
override fun deletePhotoItem(id: String): Completable { | |
return network.deletePhotoItem(id) | |
.andThen(local.deletePhotoItem(id)) | |
} |
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
// | |
// просто берем параметры и подставляем в запрос realm'а | |
// нейминг здесь корявый, но он берется из Api дока, так что тут уже не наша сторона | |
override fun deletePhotoItem(id: String) = Completable.create { emitter -> | |
realm.executeTransaction { realm -> | |
val photo = realm.where(RealmPhotoEntity::class.java) | |
.equalTo("id", id) | |
.findFirst() | |
if (photo != null) { |
NewerOlder