This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static com.google.common.base.Optional.of; | |
import static com.google.common.collect.Iterables.concat; | |
import static com.google.common.collect.Iterables.filter; | |
import static com.google.common.collect.Iterables.isEmpty; | |
import static com.google.common.collect.Iterables.transform; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Comparator; | |
import com.google.common.base.Function; | |
import com.google.common.base.Optional; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.Path; | |
import android.os.Bundle; | |
import android.support.v7.app.ActionBarActivity; | |
import android.view.MotionEvent; | |
import android.view.View; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName(); | |
private int previousTotal = 0; // The total number of items in the dataset after the last load | |
private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. | |
int firstVisibleItem, visibleItemCount, totalItemCount; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JSONUtils { | |
/** | |
* Open a json file from raw and construct as class using Gson. | |
* | |
* @param resources | |
* @param resId | |
* @param classType | |
* @param <T> | |
* @return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM default-java8 | |
MAINTAINER [email protected] | |
# Installs i386 architecture required for running 32 bit Android tools | |
RUN dpkg --add-architecture i386 && \ | |
apt-get update -y && \ | |
apt-get install -y libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 && \ | |
rm -rf /var/lib/apt/lists/* && \ | |
apt-get autoremove -y && \ | |
apt-get clean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Pager adapter to display a feed item image in a square image view | |
*/ | |
public class MultipleFeedPostItemAdapter extends PagerAdapter { | |
private final Context mContext; | |
private List<FeedItem> mFeedPosts = new ArrayList<>(); | |
private ImageView mCurrentView; | |
public MultipleFeedPostItemAdapter(final Context pContext, final List<FeedItem> pFeedPosts) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Increment version code when running a production release | |
def versionPropsFile = file('version.properties') | |
if (versionPropsFile.canRead()) { | |
def Properties versionProps = new Properties() | |
versionProps.load(new FileInputStream(versionPropsFile)) | |
def value = 0 | |
def runTasks = gradle.startParameter.taskNames | |
if ('assembleProductionRelease' in runTasks) { | |
value = 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void playVideo(final File file) { | |
Uri intentUri = Uri.fromFile(file); | |
file.setReadable(true, false); // security? | |
Intent intent = new Intent(); | |
intent.setAction(Intent.ACTION_VIEW); | |
intent.setDataAndType(intentUri, "video/*"); | |
startActivity(intent); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import android.content.Context; | |
import android.media.AudioManager; | |
import android.media.SoundPool; | |
import android.util.Log; | |
public class SoundManager implements SoundPool.OnLoadCompleteListener { | |
/** SoundPool left volume */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
final Movie intro = MovieCreator.build(new FileDataSourceImpl(file1)); | |
final Movie main = MovieCreator.build(new FileDataSourceImpl(file2)); | |
final Movie resultClip = MovieCreator.build(new FileDataSourceImpl(file3)); | |
final Movie end = MovieCreator.build(new FileDataSourceImpl(file4)); | |
final Movie[] movies = new Movie[]{intro, main, resultClip, end}; | |
final List<Track> videoTracks = new LinkedList<>(); |