Skip to content

Instantly share code, notes, and snippets.

@no99gk
no99gk / gist:7b765287d31c68c88486772c5222c8b5
Last active March 9, 2018 07:11
Set conditional argument for kapt according to variant
// ...
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
kapt {
arguments {
// Property 'variant' is available inside kapt.arguments block. See https://git.io/vAxN4 for details.
arg('butterknife.debuggable', variant.buildType.debuggable)
@no99gk
no99gk / gist:53444486e073a9975ba3
Created June 4, 2015 06:06
Fix glitches on setting up TabLayout with ViewPager
package io.github.no99gk.play;
import android.support.design.widget.TabLayout;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
/** Helper class which fixes some glitches on TabLayout */