A tab completion script that works for Bash. Relies on the BSD md5 command on Mac and md5sum on Linux, so as long as you have one of those two commands, this should work.
$ gradle [TAB]
| apply plugin: 'eclipse' | |
| apply plugin: 'maven' | |
| buildscript { | |
| repositories { | |
| mavenCentral() | |
| } | |
| dependencies { | |
| classpath 'org.apache.commons:commons-email:1.2' | |
| } |
| // Patch in | |
| task launchDebug(dependsOn: 'installDebug') << { | |
| final String cmdline = "bash ${projectDir}/../gradle/start-intent.sh android.intent.action.MAIN ${project.tasks.generateDebugBuildConfig.appPackageName} .activity.MainActivity" | |
| final Process p = cmdline.execute() | |
| p.in.eachLine { l -> println l } | |
| final int code = p.waitFor() | |
| if (code != 0) { | |
| throw new RuntimeException("Task exited with code " + code + ": " + cmdline) | |
| } | |
| } |
| import java.io.IOException; | |
| import java.io.OutputStream; | |
| import android.graphics.Bitmap; | |
| import android.graphics.Bitmap.Config; | |
| import android.graphics.Canvas; | |
| import android.graphics.Paint; | |
| public class AnimatedGifEncoder { | |
| protected int width; // image size |
ふとFoursquareアプリのLicense表示を見たら便利そうなライブラリを発見して便利だったので紹介。
MergeAdapterは、google groupsとかstackoverflowでAndroidの問題を探しているとかなりの頻度で目にするMark Murphy(@commonsguy) さんが作成した便利なAdapterです。
MergeAdapter accepts a mix of Adapters and Views and presents them as one contiguous whole to whatever ListView it is poured into. This is good for cases where you have multiple data sources, or if you have a handful of ordinary Views to mix in with lists of data, or the like.
| NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services | |
| Download the following ZIPs: | |
| ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links) | |
| Download the correct GApps for your Android version: | |
| Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip) | |
| Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip) | |
| Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip) |
| package be.digitalia.common.widgets; | |
| import android.annotation.SuppressLint; | |
| import android.annotation.TargetApi; | |
| import android.content.Context; | |
| import android.graphics.Rect; | |
| import android.os.Build; | |
| import android.support.v4.util.ObjectsCompat; | |
| import android.util.AttributeSet; | |
| import android.view.View; |
| var isOriginalImageLoaded = false | |
| // Thumbnail Request | |
| val thumbRequest = ImageRequest.Builder(ctx) | |
| .data(thumbUrl) | |
| .target( | |
| onSuccess = { result -> | |
| // If highRes image is not loaded yet, | |
| // show the thumbnail | |
| if (!isOriginalImageLoaded) { |