Skip to content

Instantly share code, notes, and snippets.

Avatar

Rafael Toledo rafaeltoledo

View GitHub Profile
@rafaeltoledo
rafaeltoledo / MainActivity.java
Created May 22, 2015
Intercept Autolinks in TextView
View MainActivity.java
package net.rafaeltoledo.autolinks;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.text.SpannableString;
import android.text.style.URLSpan;
import android.util.Log;
import android.view.View;
@rafaeltoledo
rafaeltoledo / list.md
Last active Mar 21, 2020
Movies of the Decade
View list.md

Compiled from RapaduraCast 594

= best of year

🗑️ = hmmm... not good

By Year

2010

@rafaeltoledo
rafaeltoledo / kotlinconf2019.srt
Created Dec 12, 2019
Transcrição / Tradução do keynote da KotlinConf 2019
View kotlinconf2019.srt
1
00:00:00,100 --> 00:00:07,000
[Música]
2
00:00:11,500 --> 00:00:13,500
Olá pessoal, bom dia!
3
00:00:13,500 --> 00:00:18,200
View CoroutineCallAdapterFactory.kt
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.Deferred
import retrofit2.Call
import retrofit2.CallAdapter
import retrofit2.Callback
import retrofit2.HttpException
import retrofit2.Response
import retrofit2.Retrofit
import java.lang.reflect.ParameterizedType
import java.lang.reflect.Type
View build.gradle
# Our merge report task
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) {
reports {
xml.enabled = true
html.enabled = true
}
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
View build.gradle
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) {
reports {
xml.enabled = true
html.enabled = true
}
def fileFilter = [ '**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*' ]
def debugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug", excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/kotlin"
@rafaeltoledo
rafaeltoledo / Fastfile
Created Dec 5, 2018
Android Pipeline files
View Fastfile
update_fastlane
default_platform(:android)
platform :android do
desc "Deploy a new version to the Google Play Internal track"
lane :deploy do
upload_to_play_store(track: 'internal', aab: 'app/build/outputs/bundle/release/app.aab', skip_upload_apk: true)
end
@rafaeltoledo
rafaeltoledo / MainTest.kt
Created Oct 24, 2018
Desenvolvido no Kotlin Meetup SP em 23/10/2018
View MainTest.kt
import junit.framework.Assert.assertTrue
import kotlinx.coroutines.*
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Test
class MainTest {
@Test
fun `Assert launch coroutine works`() {
View build.gradle
android {
compileSdkVersion 27
defaultConfig {
applicationId 'net.rafaeltoledo.coverage'
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName '1.0'
View build.gradle
dependencies {
implementation 'com.android.support:appcompat-v7:27.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2-alpha1'
androidTestUtil 'com.android.support.test:orchestrator:1.0.2-alpha1'
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:3.7.1'
}