Skip to content

Instantly share code, notes, and snippets.

View cjae's full-sized avatar

Osagie Omon cjae

View GitHub Profile
@davidjoneshedgehog
davidjoneshedgehog / MainActivity.java
Created January 17, 2017 11:34
Android activity demonstrating having progress bars within RecyclerView elements and how these progress bars can be updated from an Asynchronous task.
package com.hedgehoglab.progressrecyclerviewsample;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
@luqmanoop
luqmanoop / MainActivity.java
Last active September 13, 2020 21:53
Android Exoplayer demo activity
import android.annotation.SuppressLint;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import com.google.android.exoplayer2.DefaultLoadControl;
import com.google.android.exoplayer2.DefaultRenderersFactory;
import com.google.android.exoplayer2.ExoPlayerFactory;
import com.google.android.exoplayer2.SimpleExoPlayer;
@cjae
cjae / DiagonalDifference.java
Created February 27, 2018 09:12
Solution to Hackerrank Diagonal Difference
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
static int diagonalDifference(int[][] a) {
// Complete this function
/* Copyright 2019 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
public class LiveDataTestUtil {
public static <T> T getOrAwaitValue(final LiveData<T> liveData) throws InterruptedException {
final Object[] data = new Object[1];
final CountDownLatch latch = new CountDownLatch(1);
Observer<T> observer = new Observer<T>() {
@Override
public void onChanged(@Nullable T o) {
data[0] = o;