Skip to content

Instantly share code, notes, and snippets.

🌴
Aloha

Quentin Klein quentin7b

🌴
Aloha
Block or report user

Report or block quentin7b

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@quentin7b
quentin7b / app_build.gradle
Last active Mar 7, 2019
gradle build file for Android
View app_build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId "your.app.id"
minSdkVersion 21
@quentin7b
quentin7b / MainActivity.kt
Last active Nov 16, 2018
CAF_Sender_Activity
View MainActivity.kt
package com.github.quentin7b.estimateit
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.Menu
import com.google.android.gms.cast.framework.CastButtonFactory
import com.google.android.gms.cast.framework.CastContext
import com.google.android.gms.cast.framework.CastSession
import kotlinx.android.synthetic.main.activity_estimate.*
import java.util.*
@quentin7b
quentin7b / AndroidManifest.xml
Created Nov 13, 2018
CAF_Sender_Manifest_1
View AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.quentin7b.estimateit">
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name">
<meta-data
android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
android:value="com.github.quentin7b.estimateit.CastOptionsProvider" />
View CastOptionsProvider.kt
package com.github.quentin7b.estimateit
import android.content.Context
import com.google.android.gms.cast.framework.CastOptions
import com.google.android.gms.cast.framework.OptionsProvider
class CastOptionsProvider : OptionsProvider {
override fun getCastOptions(ctx: Context): CastOptions {
return CastOptions
.Builder()
@quentin7b
quentin7b / build.gradle
Last active Nov 13, 2018
CAF_Sender_build
View build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.github.quentin7b.estimateit"
@quentin7b
quentin7b / index.html
Last active Nov 13, 2018
CAF_Receiver
View index.html
<!doctype html>
<html>
<head>
<title>Estimate It</title>
</head>
<body>
<div id="content"></div>
<script src="//www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js"></script>
@quentin7b
quentin7b / TheActivity.kt
Last active Jun 6, 2019
Android ViewModel use LiveData as an Event bus
View TheActivity.kt
class TheActivity : AppCompatActivity() {
private val theSharedViewModel by viewModel<TheSharedViewModel>()
override fun onCreate(savedInstanceState: Bundle?) {
// bla bla bla
theSharedViewModel.getEvent().observe(this, Observer {
Log.i("TheSharedEvent", "Event Triggered")
})
}
@quentin7b
quentin7b / Android_tests.gradle
Last active May 23, 2018
Android build.gradle adds
View Android_tests.gradle
// Root build.gradle
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
// Module build.gradle
@quentin7b
quentin7b / Test_module_build.gradle
Last active Aug 29, 2015
[Robolectric / Jacoco] Test module build.gradle
View Test_module_build.gradle
apply plugin: 'jacoco'
android {
testOptions {
unitTests.returnDefaultValues = true
}
jacoco {
version "0.7.1.201405082137"
}
}
@quentin7b
quentin7b / Test_TestMyObject.java
Last active Aug 29, 2015
[Robolectric / Jacoco] Test Example
View Test_TestMyObject.java
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ErrorCollector;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.not;
You can’t perform that action at this time.