Record a video of your app
Developer options -> Check show touches
adb shell screenrecord /sdcard/video.mp4
adb pull /sdcard/video.mp4
public void copyFileOrDir(String path) { | |
AssetManager assetManager = this.getAssets(); | |
String assets[] = null; | |
try { | |
assets = assetManager.list(path); | |
if (assets.length == 0) { | |
copyFile(path); | |
} else { | |
String fullPath = "/data/data/" + this.getPackageName() + "/" + path; | |
File dir = new File(fullPath); |
# built application files | |
*.apk | |
*.ap_ | |
# files for the dex VM | |
*.dex | |
# Java class files | |
*.class |
int xPos = (canvas.getWidth() / 2); | |
int yPos = (int) ((canvas.getHeight() / 2) - ((textPaint.descent() + textPaint.ascent()) / 2)) ; | |
//((textPaint.descent() + textPaint.ascent()) / 2) is the distance from the baseline to the center. | |
canvas.drawText("Hello", xPos, yPos, textPaint); |
public abstract class CachedRefreshable<P, T> extends Refreshable<P, T> { | |
protected abstract Observable<T> getSourceObservable(P parameters); | |
/** | |
* Return the Observable that gets data from a cached source. | |
* | |
* @return Observable from cache item, or null if the cache misses. | |
*/ | |
protected abstract Observable<T> getCachedObservable(P parameters); |
package com.example.widgets; | |
import android.content.Context; | |
import android.content.res.ColorStateList; | |
import android.content.res.TypedArray; | |
import android.util.AttributeSet; | |
import android.widget.ImageView; | |
import com.example.R; |
in the root project's build.gradle: | |
ext { | |
compileSdkVersion = 19 | |
buildToolsVersion = "19.0.1" | |
} | |
in all the android modules: | |
android { |
import android.graphics.Color; | |
import android.support.design.widget.TextInputLayout; | |
import android.text.Editable; | |
import android.text.Layout; | |
import android.text.SpannableStringBuilder; | |
import android.text.Spanned; | |
import android.text.TextWatcher; | |
import android.text.style.AlignmentSpan; | |
import android.text.style.ForegroundColorSpan; |