Skip to content

Instantly share code, notes, and snippets.

View amsterdatech's full-sized avatar
💭
I may be slow to respond.

William Gouvea amsterdatech

💭
I may be slow to respond.
View GitHub Profile
handlePermissionsResult(requestCode, permissions, grantResults,
onPermissionGranted = {
},
onPermissionDenied = {
},
onPermissionDeniedPermanently = {
}
handlePermission(AppPermission.ACCESS_FINE_LOCATION,
onGranted = {
},
onDenied = {
},
onRationaleNeeded = {
handlePermission(AppPermission.ACCESS_FINE_LOCATION,
onGranted = {
},
onDenied = {
},
onRationaleNeeded = {
handlePermission(AppPermission.ACCESS_FINE_LOCATION,
onGranted = {
},
onDenied = {
},
onRationaleNeeded = {
handlePermission(AppPermission.ACCESS_FINE_LOCATION,
onGranted = {
},
onDenied = {
},
onRationaleNeeded = {
handlePermission(AppPermission.ACCESS_FINE_LOCATION,
onGranted = {
},
onDenied = {
},
onRationaleNeeded = {
sealed class AppPermission(
val permissionName: String, val requestCode: Int, val deniedMessageId: Int, val explanationMessageId: Int
) {
companion object {
val permissions: List<AppPermission> by lazy {
listOf(
ACCESS_FINE_LOCATION
)
}
}
fun Fragment.isGranted(permission: AppPermission) = run {
context?.let {
(PermissionChecker.checkSelfPermission(it, permission.permissionName
) == PermissionChecker.PERMISSION_GRANTED)
} ?: false
}
fun Fragment.shouldShowRationale(permission: AppPermission) = run {
shouldShowRequestPermissionRationale(permission.permissionName)
}
fun Fragment.isGranted(permission: AppPermission) = run {
context?.let {
(PermissionChecker.checkSelfPermission(it, permission.permissionName
) == PermissionChecker.PERMISSION_GRANTED)
} ?: false
}
fun Fragment.shouldShowRationale(permission: AppPermission) = run {
shouldShowRequestPermissionRationale(permission.permissionName)
}
@amsterdatech
amsterdatech / dicas.md
Created March 23, 2020 03:55 — forked from dmvieira/dicas.md
Dicas para entrar na área de dados

Como entrar na Área de Dados

Base

Então, vamos lá... Como material inicial para orientação temos o guia datascience.pizza... Se você prefere Podcast pode olhar o Pizza de Dados e o Data Hackers. Querendo um curso presencial, os únicos que indico são do Data Bootcamp que dou aula: https://databootcamp.com.br ... Para curso online existem vários no Coursera, Udemy, etc... Tem em português na Alura. Sobre o DataScienceAcademy eu não gosto muito e nem indico por várias questões.

Social

Você já tem Telegram? Se não, é muito bom entrar e olhar nos seguintes grupos que eu confio para saber das novidades e trocar uma ideia: