Skip to content

Instantly share code, notes, and snippets.

@txuslee
txuslee / Dockerfile
Created Jun 23, 2017 — forked from balachandarlinks/Dockerfile
Dockerfile for https://github.com/gojuno/mainframer remote android build system.
View Dockerfile
FROM ubuntu:16.04
MAINTAINER Balachandar KM "balachandarlinks@gmail.com"
# Install java7
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:webupd8team/java && \
(echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections) && \
apt-get update && \
@txuslee
txuslee / FragmentUtils.java
Last active Aug 29, 2015 — forked from keyboardr/FragmentUtils.java
Utility method for getting the appropriate parent of a Fragment for a given callback interface.
View FragmentUtils.java
import android.support.v4.app.Fragment;
public class FragmentUtils {
/**
* @param fragment
* The Fragment whose parent is to be found
* @param parentClass
* The interface that the parent should implement
* @return The parent of fragment that implements parentClass,
@txuslee
txuslee / HeadlessFragment.java
Last active Aug 29, 2015 — forked from keyboardr/HeadlessFragment.java
A file template for creating a headless Fragment. The attach() methods add the fragment to the parent if it doesn't already exist and returns the attached fragment. The methods ensure that the parent implements the parent interface. If needed, parameters may be added to the attach() methods to supply fragment arguments.
View HeadlessFragment.java
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
#parse("File Header.java")
public class ${NAME} extends Fragment {
private static final String FRAG_TAG = ${NAME}.class.getCanonicalName();