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 ErrorLabelLayout extends LinearLayout implements ViewGroup.OnHierarchyChangeListener { | |
private static final int ERROR_LABEL_TEXT_SIZE = 12; | |
private static final int ERROR_LABEL_PADDING = 4; | |
private TextView mErrorLabel; | |
private Drawable mDrawable; | |
private int mErrorColor; | |
public ErrorLabelLayout(Context context) { |
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
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:state_enabled="false" | |
android:color="@color/flat_disabled_text"/> | |
<item android:color="@color/flat_normal_text"/> | |
</selector> |
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 ShadowLayout extends FrameLayout implements ViewGroup.OnHierarchyChangeListener { | |
private int mBackgroundColor; | |
private int mShadowColor; | |
private float mShadowRadius; | |
private float mCornerRadius; | |
private float mDx; | |
private float mDy; | |
private Paint mPaint; |
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 FadingToolbar extends Toolbar { | |
private Drawable mToolbarBackgroundDrawable; | |
public FadingToolbar(Context context) { | |
super(context); | |
initView(context); | |
} | |
public FadingToolbar(Context context, AttributeSet attrs) { |
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
if (BuildConfig.DEBUG) { | |
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() | |
.detectCustomSlowCalls() | |
.detectDiskReads() | |
.detectDiskWrites() | |
.detectNetwork() | |
.penaltyLog() | |
.build()); | |
StrictMode.VmPolicy.Builder vmPolicy = new StrictMode.VmPolicy.Builder() |
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
# Add project specific ProGuard rules here. | |
-dontobfuscate | |
-dontoptimize | |
-ignorewarnings |
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
// Test 1 | |
for (int i = 0; i < 10; i++) { | |
// spawn new thread which call queryNoTransaction() | |
} | |
void queryNoTransaction() { | |
try (Realm realm = Realm.getDefaultInstance()) { | |
long start = System.currentTimeMillis(); | |
RealmResults<UserProfile> users = realm.where(UserProfile.class).findAll(); | |
List<UserProfile> userCopy = realm.copyFromRealm(users); |
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
android { | |
lintOptions { | |
lintConfig file("$project.rootDir/tools/rules-lint.xml") | |
htmlOutput file("$project.buildDir/outputs/lint/lint.html") | |
warningsAsErrors true | |
xmlReport false | |
} | |
} |
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: 'com.android.application' | |
apply from: "$project.rootDir/tools/script-lint.gradle" | |
... |
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
<?xml version="1.0" encoding="utf-8"?> | |
<lint> | |
<issue id="GoogleAppIndexingWarning" severity="ignore" /> | |
</lint> |