Skip to content

Instantly share code, notes, and snippets.

View ignasi's full-sized avatar

Ignasi Busquets ignasi

View GitHub Profile
@blundell
blundell / WatchFaceLifecycle-ExampleActivity.java
Last active August 29, 2015 14:03
Unofficial Base WatchFace Listener
public class ExampleActivity extends Activity implements WatchFaceLifecycle.Listener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_layout);
WatchFaceLifecycle.attach(this, savedInstanceState, this);
}
@Override
@alexjlockwood
alexjlockwood / ActivityTransitionCoordinator.java
Last active August 29, 2015 14:08
ActivityTransitionCoordinator.java
package android.app;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Bundle;
import android.os.Handler;
import android.os.Parcelable;
import android.os.ResultReceiver;
@johnkil
johnkil / list_selector.xml
Last active January 4, 2016 00:19
Android 4.4 KitKat list selector
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<solid android:color="#1A000000"/>
</shape>
</item>
<item android:state_focused="true">
@jeffarese
jeffarese / qhdpullrequest.js
Last active August 24, 2016 14:49
FHD & QHD width on Github pull requests
javascript:(function(){ var style = document.createElement(%27style%27), styleContent = document.createTextNode(%27.container { width: 1600px !important; } .timeline-comment-wrapper { width: 1380px !important; } .comment-holder{ max-width: none !important;} .discussion-item { width: 1300px !important; }%27); style.appendChild(styleContent ); var caput = document.getElementsByTagName(%27head%27); caput[0].appendChild(style); })();
@jgilfelt
jgilfelt / ExpandingListView.java
Created November 6, 2013 19:03
Fixes for Daniel Olshansky's DevByte example "ListView Expanding Cells Animation" (lines 130-132), also adds compatibility back to API 11. http://www.youtube.com/watch?v=mwE61B56pVQ http://developer.android.com/shareables/devbytes/ListViewExpandingCells.zip
/*
* Copyright (C) 2013 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
*
* Unless required by applicable law or agreed to in writing, software
@nicolasjafelle
nicolasjafelle / SafeAsyncTask.java
Last active February 16, 2017 12:36
SafeAsyncTask taken from Roboguice 2.0. and adapted to work without roboguice. Simple copy and paste this class and follow the javadoc.
package com.asynctask.util;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import java.io.InterruptedIOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.concurrent.Callable;
@dextorer
dextorer / strip.conf
Created July 6, 2014 13:01
google-play-services-strip-script
actions=true
ads=true
analytics=true
appindexing=true
appstate=true
auth=true
cast=true
common=true
drive=false
dynamic=true
@jessedc
jessedc / iOS Icon.png bash script
Last active February 25, 2018 03:02
A simple bash script using OSX command line tool sips to resample a 1024x1024 image
#!/bin/bash
f=$(pwd)
sips --resampleWidth 512 "${f}/${1}" --out "${f}/iTunesArtwork"
sips --resampleWidth 1024 "${f}/${1}" --out "${f}/iTunesArtwork@2x"
sips --resampleWidth 57 "${f}/${1}" --out "${f}/Icon.png"
sips --resampleWidth 114 "${f}/${1}" --out "${f}/Icon@2x.png"
sips --resampleWidth 29 "${f}/${1}" --out "${f}/Icon-Small.png"
sips --resampleWidth 58 "${f}/${1}" --out "${f}/Icon-Small@2x.png"
sips --resampleWidth 50 "${f}/${1}" --out "${f}/Icon-Small-50.png"
@dweinstein
dweinstein / build.gradle
Last active June 1, 2018 02:48
Gradle build files for Android native library development
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
@PomepuyN
PomepuyN / SettingsAdapter.java
Last active June 5, 2018 09:02
Functional example of WearableListView
public class SettingsAdapter extends WearableListView.Adapter {
private final Context context;
private final List<SettingsItems> items;
public SettingsAdapter(Context context, List<SettingsItems> items) {
this.context = context;
this.items = items;
}