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
val dismissState = rememberDismissState( | |
confirmStateChange = { dismissValue -> | |
if (dismissValue == DismissValue.DismissedToStart) { | |
dismissAction() | |
true | |
} else { | |
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
package dev.tigrao.myapplication | |
import android.os.Bundle | |
import android.widget.Toast | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.material.ExperimentalMaterialApi | |
import androidx.compose.material.ModalBottomSheetValue |
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
class FaqRepositoryImpl( | |
val api: Api, | |
val faqApiInternal: InternalFaqRepository | |
): FaqRepository { | |
override fun apiRest(): FaqModel { | |
val result = api.apiFaq() | |
if (result.code.isSuccess()) { | |
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.security.* | |
import java.security.spec.PKCS8EncodedKeySpec | |
import java.security.spec.X509EncodedKeySpec | |
import javax.crypto.Cipher | |
private val ALGORITHM = "RSA" | |
fun generateKeyPair(): KeyPair { | |
val keyGen: KeyPairGenerator = KeyPairGenerator.getInstance(ALGORITHM) |
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 com.google.gson.Gson | |
//Nosso enum para teste | |
enum class TestEnum { | |
FIRST, | |
SECOND | |
} | |
//Uma classe contendo uma lista de enums | |
data class EnumTypeDTO( |
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 com.google.gson.JsonElement | |
import me.tigrao.aegis.network.NetworkClient | |
import retrofit2.Call | |
import retrofit2.http.GET | |
//Interface usada em nossa instancia da retrofit | |
interface Myapi { | |
//endepoint para buscar a lista de repositorios em kotlin | |
@GET("search/repositories?q=language:kotlin&sort=stars") |
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
//Criamos uma classe | |
data class Sample( | |
val number: Int | |
) { | |
//Aqui temos um pequeno override so para exemplificar | |
override fun toString(): String { | |
return "Meu numero é $number" | |
} | |
} |
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
//Podemos calcular algo | |
val sum = 3 + 3 | |
//Então ver o resutado deste calculo | |
println("total : $sum") | |
//Ou criar um array | |
val array = arrayOf(3,2,4,2) | |
//E ver o maior elemento dentro dele |
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.example.rsatest | |
import android.security.keystore.KeyProperties | |
import android.util.Base64 | |
import java.security.Key | |
import java.security.KeyFactory | |
import java.security.spec.X509EncodedKeySpec | |
import javax.crypto.Cipher | |
private const val ALGORITHM = KeyProperties.KEY_ALGORITHM_RSA |
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
/build |
NewerOlder