Skip to content

Instantly share code, notes, and snippets.

View Sloy's full-sized avatar

Rafa Vázquez Sloy

View GitHub Profile
@falkorichter
falkorichter / build.gradle
Created July 1, 2014 20:37
Android-L gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion "android-L"
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "sensorbeacon.android.sensorberg"
minSdkVersion 'L'
targetSdkVersion 'L'
@fedefernandez
fedefernandez / SignUpActivity.java
Created September 15, 2014 15:35
Abstract ActionBar with Dagger (from Architecting Android Applications with Dagger - Jake Wharton)
public class SignUpActivity extends Activity {
private final ObjectGraph childOg;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState):
ExampleApp app = (ExampleApp) getApplication();
ObjectGraph og = app.getObjectGraph();
import com.google.android.*;
import com.anderwebs.Ander;
import com.warthon.Jake;
public class App extends AnderApp {
public void onCreate(Bundle bundle) {
Anderwebs.noHacks()
.runAtFps(60)
.noHexagonal()
@Aracem
Aracem / build.gradle
Created October 13, 2014 09:33
Gradle Example
apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'
apply plugin: 'hugo'
apply plugin: 'crashlytics'
def versionMajor = 1
def versionMinor = 7
def versionPatch = 0
def versionBuild = 0 // bump for dogfood builds, public betas, etc.
@rocboronat
rocboronat / PopularBrowser.java
Last active July 21, 2016 15:58
Use the more popular browser in the user's phone to open a URL
package com.fewlaps.quitnow;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import java.util.ArrayList;
import java.util.List;
@drewhannay
drewhannay / FinishingActivityTestRule.java
Last active June 21, 2017 18:25
Android Espresso Activity Clean Up
/**
* Copyright (C) 2017 Drew Hannay
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
@Sloy
Sloy / InjectedInstrumentationTest.java
Last active June 7, 2018 11:15
Injector (Dagger 1)
public class InjectedInstrumentationTestRule implements MethodRule {
private final Object testModule;
public InjectedInstrumentationTestRule(Object testModule) {
this.testModule = testModule;
}
@Override
public Statement apply(final Statement statement, FrameworkMethod frameworkMethod, final Object testClassInstance) {
@thombergs
thombergs / build.gradle
Last active October 21, 2020 21:51
Accessing the SVN revision number in a Gradle script
import org.tmatesoft.svn.core.wc.*
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'org.tmatesoft.svnkit', name: 'svnkit', version: '1.7.11'
}
}
@nickbutcher
nickbutcher / 10: animator-morph_ridge_2_to_tick.xml
Last active February 20, 2021 07:32
Demonstrating an animation for scanning a fingerprint and showing success or failure. This uses a number of AnimatedVectorDrawables (https://developer.android.com/reference/android/graphics/drawable/AnimatedVectorDrawable.html) to 'morph' parts of the fingerprint into the tick or cross to report success or failure. It also uses a moving clip-pat…
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0