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 (C) 2014 The Android Open Source Project | |
* | |
* 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
fun main(args: Array<String>) { | |
println("a" to "b") | |
println("a" to "b" tre "c") | |
println("a" to "b" tre "c" fo "d") | |
println("a" to "b" tre "c" fo "d" fi "e") | |
println("a" to "b" tre "c" fo "d" fi "e" sik "f") | |
println("a" to "b" tre "c" fo "d" fi "e" sik "f" seva "g") | |
} | |
infix fun <A, B, C> Pair<A, B>.tre(c: C) = Triple(first, second, c) |
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: 2019-*, Oleksandr Kucherenko (olku@artfulbits.se) */ | |
apply plugin: 'com.android.library' | |
android { | |
/* ... default android lib OR app configuration ... */ | |
} | |
configurations { | |
repack { transitive = false } | |
compatibility { transitive = 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
public class TintableImageView extends ImageView { | |
private ColorStateList tint; | |
public TintableImageView(Context context) { | |
super(context); | |
} | |
public TintableImageView(Context context, AttributeSet attrs) { | |
super(context, attrs); |
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
/** | |
* Utils for I/O operations. | |
* <p/> | |
* Created by Tomek on 09/06/15. | |
*/ | |
public class IoUtils { | |
/** | |
* Reads file and returns a String. | |
* |
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 kotlinx.coroutines.experimental.* | |
import kotlinx.coroutines.experimental.channels.ReceiveChannel | |
import kotlinx.coroutines.experimental.channels.consumeEach | |
import kotlinx.coroutines.experimental.channels.produce | |
import kotlin.coroutines.experimental.CoroutineContext | |
fun <E> ReceiveChannel<E>.debounce( | |
wait: Long = 50, | |
context: CoroutineContext = DefaultDispatcher | |
): ReceiveChannel<E> = produce(context) { |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.myapplication" > | |
<application | |
android:allowBackup="true" | |
android:icon="@drawable/ic_launcher" | |
android:label="@string/app_name" | |
android:theme="@style/AppTheme" > | |
<activity |
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 LMCustomerSDK // Your Kotlin Multiplatform Library | |
import RxSwift | |
struct RxAsyncResult<ResultElement: AnyObject> { | |
#if targetEnvironment(simulator) | |
let async: AsyncResult<ResultElement> | |
#else | |
let async: AsyncResult | |
#endif |
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
/// Pack For XCode | |
val packForXcode by tasks.creating(Sync::class) { | |
group = "build" | |
val mode = System.getenv("CONFIGURATION") ?: "DEBUG" | |
val sdkName = System.getenv("SDK_NAME") ?: "iphonesimulator" | |
val targetName = "ios" + if (sdkName.startsWith("iphoneos")) "Arm64" else "X64" | |
val framework = kotlin.targets.getByName<KotlinNativeTarget>(targetName).binaries.getFramework(mode) | |
inputs.property("mode", mode) | |
dependsOn(framework.linkTask) | |
val targetDir = File(buildDir, "xcode-frameworks") |
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
@Scope | |
public @interface ActivityScope { | |
} |