Skip to content

Instantly share code, notes, and snippets.

View zaki50's full-sized avatar

Makoto Yamazaki zaki50

View GitHub Profile
@zaki50
zaki50 / studio.vmoptions
Created December 9, 2014 13:05
今使ってる ~/Library/Preferences/AndroidStudio/studio.vmoptions
-Xms2048m
-Xmx2048m
-XX:MaxPermSize=768m
-XX:ReservedCodeCacheSize=256m
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops
@zaki50
zaki50 / RealmUtils.java
Last active August 29, 2015 14:19
Realm インスタンスを取得するためのユーティリティクラスはこんな感じか? Application#onCreate() で setupDatabase() を呼んで、 Activity/Fragment#onCreate() で getRealm() して onDestroy() で Realm#close()
import android.content.Context;
import java.io.File;
import io.realm.Realm;
import io.realm.RealmMigration;
import io.realm.exceptions.RealmMigrationNeededException;
public class RealmUtils {
Applicati
$ diff -Nur 22.1.0 22.1.1
diff -Nur 22.1.0/android/support/v4/view/LayoutInflaterCompatHC.java 22.1.1/android/support/v4/view/LayoutInflaterCompatHC.java
--- 22.1.0/android/support/v4/view/LayoutInflaterCompatHC.java 2015-04-20 18:55:38.000000000 +0900
+++ 22.1.1/android/support/v4/view/LayoutInflaterCompatHC.java 2015-04-23 18:58:12.000000000 +0900
@@ -49,7 +49,16 @@
final LayoutInflater.Factory2 factory2 = factory != null
? new FactoryWrapperHC(factory) : null;
inflater.setFactory2(factory2);
- forceSetFactory2(inflater, factory2);
+
repositories {
maven {
url 'https://github.com/zaki50/bundles_maven_repo/raw/master/maven_repo'
}
}
dependencies {
compile 'com.neenbedankt.bundles:bundles:1.0.3'
compile 'com.neenbedankt.bundles:frozen:1.0.3'
package com.example;
import android.support.annotation.IntDef;
import android.util.SparseArray;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import static com.example.Size.ValidSize.SIZE_L;
import static com.example.Size.ValidSize.SIZE_M;
diff -Nur support-v4-22.2.1/android/support/v4/animation/AnimatorCompatHelper.java support-v4-23.0.0/android/support/v4/animation/AnimatorCompatHelper.java
--- support-v4-22.2.1/android/support/v4/animation/AnimatorCompatHelper.java 2015-07-17 03:08:30.000000000 +0900
+++ support-v4-23.0.0/android/support/v4/animation/AnimatorCompatHelper.java 2015-06-23 08:43:44.000000000 +0900
@@ -17,6 +17,7 @@
package android.support.v4.animation;
import android.os.Build;
+import android.view.View;
abstract public class AnimatorCompatHelper {
diff -Nur appcampat-v7-22.2.1/android/support/v7/app/ActionBar.java appcampat-v7-23.0.0/android/support/v7/app/ActionBar.java
--- appcampat-v7-22.2.1/android/support/v7/app/ActionBar.java 2015-07-17 03:08:30.000000000 +0900
+++ appcampat-v7-23.0.0/android/support/v7/app/ActionBar.java 2015-06-23 08:43:44.000000000 +0900
@@ -46,45 +46,38 @@
* A primary toolbar within the activity that may display the activity title, application-level
* navigation affordances, and other interactive items.
*
- * <p>Beginning with Android 3.0 (API level 11), the action bar appears at the top of an
- * activity's window when the activity uses the system's {@link
- * android.R.style#Theme_Holo Holo} theme (or one of its descendant themes), which is the default.
@zaki50
zaki50 / gist:03c6b3f213881e6c5e16
Last active September 7, 2015 00:13
Data Binding を使うと Espresso 標準の withText(String) の Matcher が使い物にならなくなるので Data Binding 使用時にも使える withText(String) の実装。Data Binding は Stringではない CharSequence をセットするのが原因。
private static Matcher<View> withText(final String expectedText) {
return new BoundedMatcher<View, TextView>(TextView.class) {
@Override
public void describeTo(Description description) {
description.appendText("with string : ");
description.appendValue(expectedText);
}
@Override
public boolean matchesSafely(TextView textView) {
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="foo">His name is <xliff:g id="name" example="Andy Rubin">%1$s</xliff:g>.</string>
</resources>
package com.example.realm_template.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
public class User extends RealmObject {
@PrimaryKey