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.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 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.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 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 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 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 FaqRepositoryImpl( | |
| val api: Api, | |
| val faqApiInternal: InternalFaqRepository | |
| ): FaqRepository { | |
| override fun apiRest(): FaqModel { | |
| val result = api.apiFaq() | |
| if (result.code.isSuccess()) { | |
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 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 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
| val dismissState = rememberDismissState( | |
| confirmStateChange = { dismissValue -> | |
| if (dismissValue == DismissValue.DismissedToStart) { | |
| dismissAction() | |
| true | |
| } else { | |
| false | |
| } | |
| } | |
| ) |
OlderNewer