Skip to content

Instantly share code, notes, and snippets.

View castorflex's full-sized avatar

Antoine Merle castorflex

View GitHub Profile
@christopherperry
christopherperry / adb+
Created July 30, 2012 16:12
A bash script that let's you issue adb commands to multiple devices at once
#!/bin/bash
# Script adb+
# Usage
# You can run any command adb provides on all your currently connected devices
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command>
#
# Examples
# ./adb+ version
# ./adb+ install apidemo.apk
# ./adb+ uninstall com.example.android.apis
@chrisjenx
chrisjenx / gist:3405429
Created August 20, 2012 16:14
BasePagerFragment - Simple way to place a FragmentViewPager in a Fragment!
/**
* @project
* @author chris.jenkins
* @created Dec 28, 2011
*/
package com.application.android.ui.fragments;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.FragmentStatePagerAdapter;
@romannurik
romannurik / CheatSheet.java
Last active May 16, 2023 13:42
Android helper class for showing cheat sheets (tooltips) for icon-only UI elements on long-press. This is already default platform behavior for icon-only action bar items and tabs. This class provides this behavior for any other such UI element.
/*
* Copyright 2012 Google Inc.
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
@frankiesardo
frankiesardo / QuickReturn.java
Last active December 14, 2015 22:49
A refactored version of LarsWerkman's QuickReturnListView. It should provide an easier to use API and an easier to understand library.
public class QuickReturn {
private final static int ANIMATION_DURATION_MILLIS = 250;
private final ListView listView;
private final View quickReturnView;
private final View headerPlaceholder;
private int itemCount;
private int itemOffsetY[];
@JakeWharton
JakeWharton / OkHttpStack.java
Created May 21, 2013 01:14
A `HttpStack` implementation for Volley that uses OkHttp as its transport.
import com.android.volley.toolbox.HurlStack;
import com.squareup.okhttp.OkHttpClient;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* An {@link com.android.volley.toolbox.HttpStack HttpStack} implementation which
* uses OkHttp as its transport.
*/
@cyrilmottier
cyrilmottier / _app_avelibRelease_res_values_config.xml
Last active November 20, 2020 11:27
Using the new Gradle-based Android build system: an example
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="config_app_name">AVélib</string>
<string name="config_authority">com.cyrilmottier.android.avelib.citybikes</string>
<string name="config_com.google.android.maps.v2.api_key">XXX</string>
</resources>
@eveliotc
eveliotc / RoundedAvatarDrawable.java
Created July 22, 2013 04:59
RoundedAvatarDrawable: A Drawable that draws an oval with given {@link Bitmap} See http://evel.io/2013/07/21/rounded-avatars-in-android/
/*
* Copyright 2013 Evelio Tarazona Cáceres <evelio@evelio.info>
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
@broady
broady / 1MarkerAnimation.java
Last active March 13, 2024 12:44
Animating Markers
/* Copyright 2013 Google Inc.
Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0.html */
package com.example.latlnginterpolation;
import android.animation.ObjectAnimator;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.os.Build;

Sexy transition between Activities (based on Twitter transition)

Looking at the officiel Twitter Android client I've noticed the slight cool & sexy transition between activities. I was curious to know how that worked so I had fun with android xml animations and ended up with that:

push_left_in.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
@romainpiel
romainpiel / run.sh
Last active December 26, 2015 05:09
Create a new bash run configuration on Android Studio based on that script to speed up the running process
#!/bin/sh
./gradlew installDebug --parallel --daemon
adb shell am start -n com.packagename.app/.MainActivity