Skip to content

Instantly share code, notes, and snippets.

@operando
operando / CustomPagerTabStrip.java
Last active September 29, 2015 08:10
Since v23 of the support library contain a layout bug. https://code.google.com/p/android/issues/detail?id=183127 The suggested workaround is to use this Class.
package android.support.v4.view;
import android.content.Context;
import android.util.AttributeSet;
/**
* Since v23 of the support library contain a layout bug.
* https://code.google.com/p/android/issues/detail?id=183127
*/
public class CustomPagerTabStrip extends PagerTabStrip {
@operando
operando / gist:76e9d148d0b3648354b8
Created March 21, 2016 11:50
Droidkaigi app exception
>android.view.InflateException: Binary XML file line #151: Error inflating class io.github.droidkaigi.confsched.widget.CustomLikeButton
at android.view.LayoutInflater.createView(LayoutInflater.java:620)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at io.github.droidkaigi.confsched.widget.BindingHolder.<init>(BindingHolder.java:17)
at io.github.droidkaigi.confsched.fragment.SessionsTabFragment$SessionsAdapter.onCreateViewHolder(SessionsTabFragment.java:137)
@operando
operando / NavigationViewActions.java
Created March 22, 2016 08:36
Espresso 2.2.2 Include NavigationViewActions
package android.support.test.espresso.contrib;
/*
* Copyright 2016, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
package rx.playground;
import rx.Observable;
import rx.subjects.BehaviorSubject;
import rx.subjects.SerializedSubject;
public class Variable<T> {
private T value;
private final SerializedSubject<T, T> serializedSubject;
@operando
operando / rules0.5-0.6-diff.java
Created September 8, 2016 23:42
com.android.support.test:rules rules0.5-0.6-alpha-diff
diff -ru ../0.5/android/support/test/annotation/UiThreadTest.java android/support/test/annotation/UiThreadTest.java
--- ../0.5/android/support/test/annotation/UiThreadTest.java 2016-02-22 20:52:48.000000000 +0900
+++ android/support/test/annotation/UiThreadTest.java 2016-08-02 22:18:50.000000000 +0900
@@ -22,18 +22,14 @@
import java.lang.annotation.Target;
/**
- * This annotation should be used along with {@link android.support.test.rule.UiThreadTestRule}
- * or with any rule that inherits from it. When the annotation is present, the test method is
- * executed on the application's UI thread (or main thread).
@operando
operando / runner-0.5-0.6-diff.java
Created September 9, 2016 05:22
com.android.support.test:runner runner 0.5-0.6-alpha-diff
diff -ru 0.5/android/support/test/filters/SdkSuppress.java 0.6-alpha/android/support/test/filters/SdkSuppress.java
--- 0.5/android/support/test/filters/SdkSuppress.java 2016-02-22 20:52:48.000000000 +0900
+++ 0.6-alpha/android/support/test/filters/SdkSuppress.java 2016-08-02 22:18:50.000000000 +0900
@@ -21,12 +21,20 @@
import java.lang.annotation.Target;
/**
- * Indicates that a specific test or class requires a minimum API Level to execute.
+ * Indicates that a specific test or class requires a minimum or maximum API Level to execute.
* <p/>
@operando
operando / .zshrc
Last active November 13, 2016 02:53
peco select adb history
# adb history
function peco-select-adb-history() {
local tac
if which tac > /dev/null; then
tac="tac"
else
tac="tail -r"
fi
BUFFER=$(\history -n 1 | \
eval $tac | \
@operando
operando / api-server.md
Created February 19, 2017 06:18 — forked from nulltask/api-server.md
ネイティブアプリ向け API サーバを作った時の経験談
@operando
operando / gist:dec40f8fe3b48c177781373e18478c61
Created October 3, 2017 09:30
Google Playからcom.android.vending.INSTALL_REFERRERで投げられるBroadcastのIntentの中身
10-03 18:19:15.740 D/InstallReferrerReceiver(28042): Intent { act=com.android.vending.INSTALL_REFERRER flg=0x10 pkg=com.os.operando.takosan cmp=com.os.operando.takosan/.InstallReferrerReceiver (has extras) }
10-03 18:19:15.740 D/InstallReferrerReceiver(28042): key : referrer
10-03 18:19:15.740 D/InstallReferrerReceiver(28042): value : referrer_test
10-03 18:19:15.740 D/InstallReferrerReceiver(28042): key : referrer_timestamp_seconds
10-03 18:19:15.740 D/InstallReferrerReceiver(28042): value : 1507022325
10-03 18:19:15.740 D/InstallReferrerReceiver(28042): com.android.vending.INSTALL_REFERRER
10-03 18:19:15.740 D/InstallReferrerReceiver(28042): com.os.operando.takosan
10-03 18:19:15.741 D/InstallReferrerReceiver(28042): referrer : referrer_test
class TimeoutInterceptor : Interceptor {
companion object {
const val CONNECT_TIMEOUT = "CONNECT_TIMEOUT"
const val READ_TIMEOUT = "READ_TIMEOUT"
const val WRITE_TIMEOUT = "WRITE_TIMEOUT"
}
@Throws(IOException::class)