Kotlin 1.4 Online Event, October 12–15, 2020 で発表されたトークについてのメモ
This file contains 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
// IMPORTANT! READ THIS FIRST | |
// Assisted Injection doesn't work with @HiltViewModel or @ViewModelInject | |
// Read more about the issue here: https://github.com/google/dagger/issues/2287 | |
// | |
// | |
// AssistedInject and Hilt working together in v2.28-alpha times | |
// Example of a ViewModel using AssistedInject injected in a Fragment by Hilt | |
// As AssistedInject isn't part of Dagger yet, we cannot use in | |
// conjuction with @ViewModelInject |
This file contains 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 io.github.yaraki.coroutineex | |
import android.arch.lifecycle.LiveData | |
import android.content.Context | |
import kotlinx.coroutines.experimental.Job | |
import kotlinx.coroutines.experimental.android.UI | |
import kotlinx.coroutines.experimental.channels.Channel | |
import kotlinx.coroutines.experimental.channels.SendChannel | |
import kotlinx.coroutines.experimental.delay | |
import kotlinx.coroutines.experimental.launch |
This file contains 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
apply plugin: "jacoco" | |
jacoco { | |
toolVersion = deps.test.jacocoVersion | |
} | |
tasks.withType(Test) { | |
jacoco.includeNoLocationClasses = true | |
} |
This file contains 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 Foundation | |
import UIKit | |
class MySampleView :UIView{ | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
self.backgroundColor = UIColor.blue | |
} | |
This file contains 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
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | |
val binding = parent.inflateBinding<ListItemCommentBinding>() | |
return ViewHolder(binding) | |
} |
This file contains 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
local pressedKeyTable = {} | |
-- TODO: Consider about consumed per keys is necessary or not. | |
local consumed = false | |
local keyCodeTable = {} | |
keyCodeTable[0x66] = true -- EISUU | |
keyCodeTable[0x68] = true -- KANA | |
eventtap = hs.eventtap.new({ hs.eventtap.event.types.keyDown, hs.eventtap.event.types.keyUp }, function(event) | |
local keyCode = event:getKeyCode() | |
if keyCodeTable[keyCode] == true then |
This file contains 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 com.carlosedurdo.database; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import io.realm.Realm; | |
import io.realm.RealmObject; | |
/** |
This file contains 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
// ref : https://gist.github.com/cmelchior/1a97377df0c49cd4fca9 | |
private void initGson() { | |
Type tokenInt = new TypeToken<RealmList<RealmInt>>(){}.getType(); | |
Type tokenString = new TypeToken<RealmList<RealmString>>(){}.getType(); | |
Type tokenDate = new TypeToken<Date>(){}.getType(); | |
mGson = new GsonBuilder() | |
.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.ssssss") | |
.setExclusionStrategies(new ExclusionStrategy() { | |
@Override |
This file contains 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
public class ImageViewBindingAdapter { | |
@BindingAdapter("bind:imageUrl") | |
public static void loadImage(view: ImageView, url: String) { | |
Glide.with(view.context).load(url).into(view) | |
} | |
} |
NewerOlder