Skip to content

Instantly share code, notes, and snippets.

View shinil7's full-sized avatar
🎯
Focusing

Shinil shinil7

🎯
Focusing
View GitHub Profile
@shinil7
shinil7 / AllGattCharacteristics.java
Created July 27, 2023 09:27 — forked from sam016/AllGattCharacteristics.java
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
@shinil7
shinil7 / material_design_guidelines_dimens.xml
Created June 18, 2020 08:15 — forked from aeroechelon/material_design_guidelines_dimens.xml
Recommended Material Design Dimensions for Android
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
# Material Design Dimensions
These dimensions are provided as per Material Design Guidelines
to adhere to a 8 dp baseline grid. (With the exception of the
toolbar and notification bar.).
## References
package net.warmwaffles.utils.concurrent;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
/**
* A light wrapper around the {@link ThreadPoolExecutor}. It allows for you to pause execution and
@shinil7
shinil7 / CircularRevealingFragment.java
Created April 12, 2017 08:04 — forked from ferdy182/CircularRevealingFragment.java
Make circular reveal animations on a fragment
/**
* Our demo fragment
*/
public static class CircularRevealingFragment extends Fragment {
OnFragmentTouched listener;
public CircularRevealingFragment() {
}
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.text.SpannableStringBuilder;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.TextView;
package com.novoda.example.MemoryLeaker;
import android.os.Debug;
import java.io.File;
import java.io.IOException;
public class HeapDumpingUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
private static final String HPROF_DUMP_BASENAME = "LeakingApp.dalvik-hprof";
private final String dataDir;
@shinil7
shinil7 / EndlessRecyclerOnScrollListener.java
Created January 7, 2017 08:28 — forked from ssinss/EndlessRecyclerOnScrollListener.java
Endless RecyclerView OnScrollListener
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;
@shinil7
shinil7 / SimpleDatabaseHelper.java
Created October 6, 2016 09:30 — forked from mikeplate/SimpleDatabaseHelper.java
Android SQLite very simple database helper example
package se.mobileapplab.datademo;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
/**
* Class that wraps the most common database operations. This example assumes you want a single table and data entity