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.Dispatchers | |
import kotlinx.coroutines.ExperimentalCoroutinesApi | |
import kotlinx.coroutines.test.TestDispatcher | |
import kotlinx.coroutines.test.UnconfinedTestDispatcher | |
import kotlinx.coroutines.test.resetMain | |
import kotlinx.coroutines.test.setMain | |
import org.junit.rules.TestRule | |
import org.junit.rules.TestWatcher | |
import org.junit.runner.Description |
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
@OptIn(ExperimentalAnimationApi::class) | |
@Composable | |
private fun AnimatedCurrencyValue( | |
targetValue: Double, | |
delayOfDigits: Long = 100L, | |
locale: Locale = Locale.US | |
) { | |
// create variable for current time | |
var currentValue by remember { |
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
@OptIn(ExperimentalAnimationApi::class) | |
@Composable | |
private fun AnimatedDoubleValue( | |
targetValue: Double, | |
delayOfDigits: Long = 100L | |
) { | |
// create variable for current time | |
var currentValue by remember { | |
mutableStateOf(0.0) |
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
@OptIn(ExperimentalAnimationApi::class) | |
@Composable | |
private fun AnimatedIntValue( | |
targetValue: Int, | |
delayOfDigits: Long = 100L | |
) { | |
// create variable for current time | |
var currentValue by remember { | |
mutableStateOf(0) |
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 CustomArcShape : Shape { | |
override fun createOutline( | |
size: Size, | |
layoutDirection: LayoutDirection, | |
density: Density | |
): Outline { | |
return Outline.Generic( | |
path = drawArcPath(size = size) | |
) | |
} |
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
@Composable | |
fun ChipVerticalGrid( | |
modifier: Modifier = Modifier, | |
spacing: Dp, | |
content: @Composable () -> Unit | |
) { | |
Layout( | |
content = content, | |
modifier = modifier | |
) { measurables, constraints -> |
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
# Visual Studio Code | |
sudo ln -s /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code /usr/local/bin/code | |
# Sublime Text | |
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl |
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
apply plugin: 'org.sonarqube' | |
sonarqube { | |
properties { | |
property "sonar.host.url", "http://localhost:9000" | |
property "sonar.projectKey", "br.com.appfut" | |
property "sonar.projectName", "AppFut" | |
property "sonar.sources", "src/main/java/" | |
property "sonar.binaries", "build" | |
property "sonar.language", "koltin" |
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
apply plugin: 'jacoco' | |
jacoco { | |
toolVersion = '0.8.6' //Use latest version | |
} | |
tasks.withType(Test) { | |
jacoco.includeNoLocationClasses = true | |
} | |
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) { |
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 android.support.v7.widget.RecyclerView | |
import android.view.View | |
interface OnItemClickListener { | |
fun onItemClicked(position: Int, view: View) | |
} | |
fun RecyclerView.addOnItemClickListener(onClickListener: OnItemClickListener) { | |
this.addOnChildAttachStateChangeListener(object: RecyclerView.OnChildAttachStateChangeListener { | |
override fun onChildViewDetachedFromWindow(view: View?) { |
NewerOlder