Skip to content

Instantly share code, notes, and snippets.

View ViksaaSkool's full-sized avatar
:octocat:
I've set my status

ViksaaSkool ViksaaSkool

:octocat:
I've set my status
View GitHub Profile
@ViksaaSkool
ViksaaSkool / KotlinBasics.kt
Last active October 7, 2018 21:51
KotlinBasics
/* Declaring variables */
//[val/var] name_of_variable : [type] = value
//no need for ; at the end of the line
val a: Int = 1
var b: String = "NullPointerException is dead"
var c: Double? = 0.4
//val - read only value, constant
@ViksaaSkool
ViksaaSkool / PerfectLoopMediaPlayer.java
Last active November 14, 2021 13:40
PerfectLoopMediaPlayer because it's 2017 and this is still an issue on Android
import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.media.MediaPlayer;
import android.util.Log;
import java.io.IOException;
/**
* Created by viksaaskool on 13-04-2017.
*/
@ViksaaSkool
ViksaaSkool / DrawableMatcher.java
Last active March 25, 2017 16:24
DrawableMatcher for medium article https://is.gd/Ru0XVF
public class DrawableMatcher extends TypeSafeMatcher<View> {
private final int expectedId;
private String resourceName;
private int isAnimatedDrawable = -1;
private int randomFrame = 0;
public DrawableMatcher(int expectedId) {
super(View.class);