buildscript {
ext {
daggerHiltVersion = '2.41'
}
}
plugins {
id 'com.google.dagger.hilt.android' version "$daggerHiltVersion" apply 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
fun main() { | |
println(filterByType1<Boolean>(listOf(1, 2, "hola", true))) | |
println(listOf(1, 2, 3, "hola", false).filterIsInstance<Boolean>()) | |
println(filterByType2(listOf(10, 20, true, 10.5, "hello"), java.lang.Boolean::class.java)) | |
println(filterByType2(listOf(10, 20, true, 10.5, "hello", false), Boolean::class.javaObjectType)) | |
} | |
@Suppress("UNCHECKED_CAST") | |
inline fun <reified T> filterByType1(unfilteredList: List<*>): List<T> = unfilteredList.filter { it is T } as List<T> |
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 com.edudev.livedataroomexample | |
import android.Manifest | |
import android.app.Activity | |
import android.app.AlertDialog | |
import android.content.Intent | |
import android.content.pm.PackageManager | |
import android.net.Uri | |
import android.os.Bundle | |
import android.provider.Settings |
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
// Displays the coordinates of all elements of the secondary diagonal and of all diagonals parallel to the secondary diagonal | |
fun printSecondaryDiagonals(numColumns: Int, numRows: Int) { | |
val diagonal = mutableListOf<Pair<Int, Int>>() | |
for (k in 0..numColumns + numRows - 2) { | |
for (j in 0..k) { | |
val i = k - j | |
if (i < numRows && j < numColumns) { | |
diagonal.add(Pair(i, j)) | |
} | |
} |
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 java.math.BigDecimal | |
import java.math.RoundingMode | |
import kotlin.math.pow | |
const val EXIT = "/exit" | |
const val BACK = "/back" | |
const val BASE_10 = 10 | |
const val MAX_LENGTH_FRACTIONAL_PART = 5 | |
const val FRACTIONAL_PART_DELIMITER = '.' |
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
#built application files | |
*.apk | |
*.ap_ | |
*.aab | |
# files for the dex VM | |
*.dex | |
# Java class files | |
*.class |
Abrir la consola Git Bash.
Navegar hasta el directorio donde se encuentra el repositorio e introducir los siguientes comandos para especificar el nombre y dirección de correo electrónico que se usarán en cada commit:
git config --local user.name "Mi nombre"