cat /dev/random | base64 | head -c 24 && echo
keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
| public void somewhere() { | |
| EditText editText = result.findViewById(R.id.edit_text); | |
| new SoftInputHelper(editText) | |
| .setShowFlags(InputMethodManager.SHOW_FORCED) // NOTE this line can be omitted for most cases | |
| .show(); | |
| } |
| import android.graphics.Canvas; | |
| import android.graphics.Paint; | |
| import android.support.annotation.NonNull; | |
| import android.support.annotation.Nullable; | |
| import android.text.style.ReplacementSpan; | |
| public class MonospaceSpan extends ReplacementSpan { | |
| private boolean ignoreFullText; | |
| public void setIgnoreFullText(boolean ignoreFullText) { |
| import android.content.res.ColorStateList; | |
| import android.graphics.Canvas; | |
| import android.graphics.Color; | |
| import android.graphics.ColorFilter; | |
| import android.graphics.Paint; | |
| import android.graphics.PixelFormat; | |
| import android.graphics.Rect; | |
| import android.graphics.Typeface; | |
| import android.graphics.drawable.Drawable; | |
| import android.os.Build; |
| @NonNull | |
| @UiThread | |
| public Executor getThreadPool() { | |
| if (threadPool == null) { | |
| final String threadNamePrefix = getClass().getSimpleName(); | |
| int corePoolSize = 0; | |
| int maxPoolSize = Math.max(2, Runtime.getRuntime().availableProcessors() * 2 + 1); | |
| long keepAliveTime = 10; |
| import android.util.Log; | |
| import java.io.ByteArrayOutputStream; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| public final class LoggingInputStream extends InputStream { | |
| static { | |
| if (!BuildConfig.DEBUG) { | |
| throw new AssertionError(); |
| //Declaring the inputs and outputs of a task | |
| //build.gradle | |
| task transform { | |
| ext.srcFile = file('mountains.xml') | |
| ext.destDir = new File(buildDir, 'generated') | |
| inputs.file srcFile | |
| outputs.dir destDir | |
| doLast { | |
| println "Transforming source file." |
| <?xml version="1.0" encoding="ISO-8859-1"?> | |
| <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > | |
| <xsl:template match="/"> | |
| <svg xmlns="http://www.w3.org/2000/svg"> | |
| <xsl:attribute name="width"> | |
| <xsl:value-of select="substring-before(vector/@width, 'dp')"/> | |
| </xsl:attribute> | |
| <xsl:attribute name="height"> | |
| <xsl:value-of select="substring-before(vector/@height, 'dp')"/> | |
| </xsl:attribute> |
| apply plugin: 'java' | |
| configurations.all { | |
| resolutionStrategy { | |
| eachDependency { DependencyResolveDetails details -> | |
| //specifying a fixed version for all libraries with 'org.gradle' group | |
| if (details.requested.group == 'org.springframework') { | |
| details.useVersion "$springVersion" | |
| } | |
| } |