Skip to content

Instantly share code, notes, and snippets.

View quentin7b's full-sized avatar
🌴
Aloha

Quentin Klein quentin7b

🌴
Aloha
View GitHub Profile
@quentin7b
quentin7b / custom_autocomplete.widget.dart
Last active October 4, 2023 12:30
A custom AutoComplete Widget in flutter that makes it more easy to customize the render of the items
import 'package:flutter/material.dart';
class CustomAutoComplete<T extends Object> extends StatelessWidget {
final Iterable<T> options;
final Function(T) onSelected;
final String Function(T)? displayStringForOption;
final Widget Function(BuildContext, T)? optionsItemBuilder;
final Iterable<T> Function(TextEditingValue)? optionsFilter;
const CustomAutoComplete({
@quentin7b
quentin7b / app_build.gradle
Last active March 7, 2019 15:32
gradle build file for Android
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 October 17, 2019 11:33
CAF_Sender_Activity
package com.github.quentin7b.estimateit
import android.os.Bundle
import android.util.Log
import android.view.Menu
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.MenuItemCompat
import androidx.mediarouter.app.MediaRouteActionProvider
import androidx.mediarouter.media.MediaControlIntent
import androidx.mediarouter.media.MediaRouteSelector
@quentin7b
quentin7b / AndroidManifest.xml
Created November 13, 2018 16:07
CAF_Sender_Manifest_1
<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" />
@quentin7b
quentin7b / CastOptionsProvider.kt
Last active November 13, 2018 16:02
CAF_Sender_options
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 October 15, 2019 16:04
CAF_Sender_build
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 October 16, 2019 11:52
CAF_Receiver
<!doctype html>
<html>
<head>
<title>Estimate It</title>
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<style>
body {
background: white;
color: black;
@quentin7b
quentin7b / TheActivity.kt
Last active June 6, 2019 17:32
Android ViewModel use LiveData as an Event bus
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 07:24
Android build.gradle adds
// Root build.gradle
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
// Module build.gradle
@quentin7b
quentin7b / Test_module_build.gradle
Last active August 29, 2015 14:25
[Robolectric / Jacoco] Test module build.gradle
apply plugin: 'jacoco'
android {
testOptions {
unitTests.returnDefaultValues = true
}
jacoco {
version "0.7.1.201405082137"
}
}