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
@OptIn(ExperimentalMaterialApi::class) | |
@Composable | |
fun PullToRefreshAnimation() { | |
val path = remember { | |
GitHubLogoPath.path.toPath() | |
} | |
val lines = remember { | |
path.asAndroidPath().flatten(error = 0.5f).toList() | |
} |
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 androidx.compose.samples.animationfactory | |
import androidx.compose.animation.core.Animatable | |
import androidx.compose.animation.core.infiniteRepeatable | |
import androidx.compose.animation.core.tween | |
import androidx.compose.foundation.Canvas | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.aspectRatio | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.foundation.layout.padding |
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 androidx.fragment.app.Fragment | |
import androidx.lifecycle.DefaultLifecycleObserver | |
import androidx.lifecycle.LifecycleOwner | |
import androidx.lifecycle.Observer | |
import kotlin.properties.ReadOnlyProperty | |
import kotlin.reflect.KProperty | |
fun <T> Fragment.viewLifecycleLazy(initialise: () -> T): ReadOnlyProperty<Fragment, T> = | |
object : ReadOnlyProperty<Fragment, T>, DefaultLifecycleObserver { |
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
// Location-related Kotlin extension properties for Android. | |
// They must be implemented in an Activity because Geocoder needs a context. | |
// Or else, they must be turned from extension properties to extension functions that receive a context as parameter. | |
// Example of use | |
// Use case: show the user his locality name on a TextView | |
val userLocation = Location(someLatitude, someLongitude) | |
launch(UI) { | |
aTextView.text = userLocation.localityName.await() |
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) 2017 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
#!groovy | |
import groovy.json.JsonOutput | |
import java.util.Optional | |
import hudson.tasks.test.AbstractTestResultAction | |
import hudson.model.Actionable | |
import hudson.tasks.junit.CaseResult | |
def speedUp = '--configure-on-demand --daemon --parallel' | |
def nebulaReleaseScope = (env.GIT_BRANCH == 'origin/master') ? '' : "-Prelease.scope=patch" |
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
# to run: docker-compose run | |
# | |
# Create a .evn file in the same folder as this file and change the variables. | |
# MOUNT_POINT=/tmp/ | |
# VPN_PROVIDER=changeme | |
# VPN_CONFIG=changeme | |
# VPN_USERNAME=changeme | |
# VPN_PASSWORD=changeme | |
# | |
# |
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 rx.Observable; | |
import rx.android.schedulers.AndroidSchedulers; | |
import rx.schedulers.Schedulers; | |
/** | |
* Transformer for observables. You can pass it to class that uses subscriptions to have full | |
* control of schedulers used. Also it is preferable way to mock schedulers in tests. | |
* | |
* <p>Usage example: | |
* <code><pre> |
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
apply plugin: 'checkstyle' | |
// Add checkstyle to the check task. | |
check.dependsOn 'checkstyle' | |
task checkstyle(type: Checkstyle) { | |
configFile file("../config/quality/checkstyle/checkstyle.xml") | |
configProperties.checkstyleSuppressionsPath = file("../config/quality/checkstyle/suppressions.xml").absolutePath | |
source 'src' | |
include '**/*.java' |
NewerOlder