(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| public class ParallaxPageTransformer implements ViewPager.PageTransformer { | |
| public void transformPage(View view, float position) { | |
| int pageWidth = view.getWidth(); | |
| if (position < -1) { // [-Infinity,-1) | |
| // This page is way off-screen to the left. | |
| view.setAlpha(1); |
| You can add this to your shell profile and then use it as dexcount file. | |
| This file should have a classes.dex in order to work, that means it has to be a android lib project or android apk. | |
| count(){ | |
| mkdir temp >/dev/null | |
| cp $1 temp/$1+copy > /dev/null | |
| unzip temp/$1+copy -d temp/ > /dev/null | |
| cat temp/classes.dex | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"' | |
| rm -R temp > /dev/null | |
| } |
| def toCamelCase(String string) { | |
| String result = "" | |
| string.findAll("[^\\W]+") { String word -> | |
| result += word.capitalize() | |
| } | |
| return result | |
| } | |
| afterEvaluate { project -> | |
| Configuration runtimeConfiguration = project.configurations.getByName('compile') |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| public class FacebookHomeProvider { | |
| protected final PublishSubject<FbPost> behaviorSubject; | |
| private Request request; | |
| public FacebookHomeProvider() { | |
| behaviorSubject = PublishSubject.create(); | |
| behaviorSubject.subscribeOn(Schedulers.io()); | |
| } | |
| /** |
| <?php | |
| /** | |
| * All custom functions should be defined in this class | |
| * and tied to WP hooks/filters w/in the constructor method | |
| */ | |
| class Custom_Functions { | |
| // Custom metaboxes and fields configuration |
| task robolectric(type: Test, dependsOn: assembleRelease) { | |
| testClassesDir = sourceSets.robolectric.output.classesDir | |
| android.sourceSets.main.java.srcDirs.each { dir -> | |
| project.getPlugins().getPlugin('android').prepareTaskMap.each { | |
| sourceSets.robolectric.compileClasspath += files(it.value.explodedDir.getAbsolutePath() + '/classes.jar') | |
| sourceSets.robolectric.runtimeClasspath += files(it.value.explodedDir.getAbsolutePath() + '/classes.jar') | |
| } |
| package com.andraskindler.sandbox.activity; | |
| import retrofit.RestAdapter; | |
| import retrofit.http.GET; | |
| import retrofit.http.Query; | |
| import rx.Observable; | |
| import rx.Subscriber; | |
| import rx.schedulers.Schedulers; | |
| public class ApiManager { |
| buildscript { | |
| repositories { | |
| maven { url 'http://repo1.maven.org/maven2' } | |
| mavenCentral() | |
| } | |
| dependencies { | |
| classpath 'com.android.tools.build:gradle:0.9.1' | |
| } |
| 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) |