This file contains hidden or 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.FlowPreview | |
import kotlinx.coroutines.Job | |
import kotlinx.coroutines.cancelAndJoin | |
import kotlinx.coroutines.coroutineScope | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.collect | |
import kotlinx.coroutines.flow.flow | |
import kotlinx.coroutines.launch | |
/** |
This file contains hidden or 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 FooBarFragment : Fragment() { | |
companion object { | |
fun newInstance(foo: String, bar: String?) = FooBarFragment().apply { | |
this.foo = foo | |
this.bar = bar | |
} | |
} | |
private var foo: String by argumentNotNull() |
This file contains hidden or 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.abdelmeged.ahmed.roundedlayout; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.widget.ImageView; | |
import com.bumptech.glide.load.engine.DiskCacheStrategy; | |
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions; | |
public class MainActivity extends AppCompatActivity { |
This file contains hidden or 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 com.android.tools.lint.client.api.UElementHandler | |
import com.android.tools.lint.detector.api.* | |
import org.jetbrains.uast.UElement | |
import org.jetbrains.uast.UPostfixExpression | |
class NonNullAssertionDetector : Detector(), Detector.UastScanner { | |
override fun getApplicableUastTypes(): List<Class<out UElement>>? { | |
return listOf(UPostfixExpression::class.java) | |
} |
This file contains hidden or 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
{ | |
"data": { | |
"attributes": { | |
"alias": "nikitin2", | |
"bio": null, | |
"birthdate": "09-22-1996", | |
"displayName": "nikitin", | |
"email": null, | |
"fullName": "nikitin", | |
"gender": "male", |
This file contains hidden or 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 RxSwift | |
public typealias Bootstrapper<Action> = () -> Observable<Action> | |
public typealias WishToAction<Wish, Action> = (Wish) -> Action | |
public typealias Actor<State, Action, Effect> = (State, Action) -> Observable<Effect> | |
public typealias Reducer<State, Effect> = (State, Effect) -> State | |
public typealias PostProcessor<Action, Effect, State> = (Action, Effect, State) -> Action? | |
public typealias NewsPublisher<Action, Effect, State, News> = (Action, Effect, State) -> News? | |
open class Feature<Wish, Action, Effect, State, News> { |
This file contains hidden or 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
protocol InitConfigurable { | |
init() | |
} | |
extension InitConfigurable { | |
init(configure: (Self) -> Void) { | |
self.init() | |
configure(self) | |
} | |
} |
This file contains hidden or 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
/** | |
* Authenticator that attempts to refresh the client's access token. | |
* In the event that a refresh fails and a new token can't be issued an error | |
* is delivered to the caller. This authenticator blocks all requests while a token | |
* refresh is being performed. In-flight requests that fail with a 401 are | |
* automatically retried. | |
*/ | |
class AccessTokenAuthenticator( | |
private val tokenProvider: AccessTokenProvider | |
) : Authenticator { |
NewerOlder