Skip to content

Instantly share code, notes, and snippets.

View chibatching's full-sized avatar
🍃

Takao Chiba chibatching

🍃
View GitHub Profile
@sys1yagi
sys1yagi / Usage.kt
Created May 12, 2017 04:28
Magic Data Binding inflate
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val binding = parent.inflateBinding<ListItemCommentBinding>()
return ViewHolder(binding)
}

解剖 Kotlin ほんとはJavaなんだろ

Kotlinはジャバである

目次

  • null許容型の正体
  • 関数型の正体
  • ラムダ式の正体
  • 拡張関数の正体

PR: konifar/droidkaigi2016#108

もとの問題

アプリを起動(MainActivity)して任意のセッション詳細(SessionDetailActivity)を開いてSessionの状態を変更して戻る。このときMainActivityが破棄-再生成されていた場合にクラッシュする

構造的な問題

MainActivity-SessionsFragment-ViewPager-SessionsTabFragmentの構造のなかで、それぞれのコンポーネント間で直接onActivityResult()を呼び出して伝搬する方法を取っていた。

@devunwired
devunwired / GifDecoder.java
Last active January 26, 2024 21:14
An optimized implementation of GifDecoder for Android devices.
/**
* Copyright (c) 2013 Xcellent Creations, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@wobbals
wobbals / AvcEncoder.java
Created October 31, 2012 22:46
MediaCodec encoder sample
package com.opentok.media.avc;
import java.io.IOException;
import java.nio.ByteBuffer;
import android.media.MediaCodec;
import android.media.MediaCodecInfo;
import android.media.MediaFormat;
public class AvcEncoder {