Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Angad Singh Angads25

🎯
Focusing
Block or report user

Report or block Angads25

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Angads25
Angads25 / Dockerfile
Last active Apr 11, 2019
Docker file for Android Tests
View Dockerfile
FROM openjdk:8-jdk
MAINTAINER Angad Singh <angads25@gmail.com>
CMD ["gradle"]
ENV GRADLE_HOME /opt/gradle
ENV GRADLE_VERSION 5.3.1
ARG GRADLE_DOWNLOAD_SHA256=b018a7308cb43633662363d100c14a3c41c66fd4e32b59e1dfc644d6fd2109f6
RUN set -o errexit -o nounset \
@Angads25
Angads25 / OnItemClickListener.java
Created Jan 16, 2019
RecyclerView Touch Helper
View OnItemClickListener.java
import android.support.v7.widget.RecyclerView;
import android.view.View;
public interface OnItemClickListener {
void onClick(RecyclerView parent, View v, int position);
}
@Angads25
Angads25 / Utility.java
Last active Jan 22, 2019
Utility functions used regularly
View Utility.java
public class Utility {
public static void copyDatabaseToSdcard(Context context, String databaseName) {
if(BuildConfig.DEBUG) {
String currentDBPath = context.getDatabasePath(databaseName).getAbsolutePath();
String downloadDir = Environment.getExternalStorageDirectory() + "/Dump/" + databaseName + ".db";
File dataBase = new File(currentDBPath);
File file = new File(downloadDir);
try {
file.delete();
@Angads25
Angads25 / SortedUniqueList.java
Created Oct 4, 2018
An array list that keeps items sorted and unique
View SortedUniqueList.java
import com.github.angads25.javaplayground.model.UniqueListItem;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Collection;
public class SortedUniqueList<T extends UniqueListItem> extends AbstractList<T> {
private ArrayList<T> internalList = new ArrayList<>();
@Override public boolean add(T t) {
You can’t perform that action at this time.