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
package com.keyboardr.testing | |
import com.google.common.truth.* | |
import com.google.common.truth.Truth.assertWithMessage | |
import com.google.common.truth.Truth.assert_ | |
import java.math.BigDecimal | |
import kotlin.contracts.ExperimentalContracts | |
import kotlin.contracts.InvocationKind | |
import kotlin.contracts.contract |
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
package com.keyboardr.bluejay.audio | |
import com.keyboardr.bluejay.util.toFraction | |
import java.nio.ByteBuffer | |
import kotlin.math.* | |
class LoudnessMeasurer(private val channelCount: Int, sampleRate: Float, totalFrames: Int) { | |
private class LoudnessMeasurerChannel(var bufferFrames: Int, | |
/** How many frames are needed for a gating block. Will correspond to 400ms |
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
package com.keyboardr.bluejay.ui.playlist | |
import android.content.Context | |
import android.graphics.Canvas | |
import android.graphics.Color | |
import android.graphics.Paint | |
import android.media.MediaCodec | |
import android.media.MediaExtractor | |
import android.media.MediaFormat | |
import android.util.AttributeSet |
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.arch.lifecycle.LiveData; | |
import android.support.annotation.NonNull; | |
import android.util.Log; | |
import com.google.firebase.database.DataSnapshot; | |
import com.google.firebase.database.DatabaseError; | |
import com.google.firebase.database.DatabaseReference; | |
import com.google.firebase.database.GenericTypeIndicator; | |
import com.google.firebase.database.ValueEventListener; |
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
package com.keyboardr.bluejay.model; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.text.TextUtils; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.Comparator; |
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
/** | |
* What you'd think an abstract factory would look like. Unfortunately, this class won't compile. | |
*/ | |
public abstract class HeadlessFragmentFactory<F extends Fragment & ParentedFragment<F, ? extends P>, P> { | |
protected abstract F newInstance(); | |
/* There will be a compiler warning on P. When joining types, only the first type is allowed to | |
be a class. All others MUST be interfaces. In this situation, there is no way for the compiler | |
to know that P will be an interface. If P is removed, there is no longer a compile-time check |
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.annotation.WorkerThread; | |
import android.support.annotation.Nullable; | |
import android.database.Cursor; | |
public class CursorReaderExample { | |
// Example columns, would likely be in a different file (e.g. a contract class). | |
private static String COLUMN_FOO = "foo"; | |
private static String COLUMN_BAR = "bar"; |
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
@TargetApi(VERSION_CODES.LOLLIPOP) | |
private Animator createCenteredReveal(View view) { | |
// Could optimize by reusing a temporary Rect instead of allocating a new one | |
Rect bounds = new Rect(); | |
view.getDrawingRect(bounds); | |
int centerX = bounds.centerX(); | |
int centerY = bounds.centerY(); | |
int finalRadius = Math.max(bounds.width(), bounds.height()); | |
return ViewAnimationUtils.createCircularReveal(view, centerX, centerY, 0f, finalRadius); | |
} |
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
#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(); |
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.content.Context; | |
import android.content.res.Resources; | |
import android.graphics.Bitmap; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.graphics.drawable.Drawable; | |
import android.graphics.drawable.LayerDrawable; | |
import android.net.Uri; | |
import android.util.Log; | |
import com.squareup.picasso.Picasso; |
NewerOlder