Skip to content

Instantly share code, notes, and snippets.

@Psest328
Psest328 / ExpListViewWithCheckBox.java
Last active April 14, 2023 15:15
ExpandableListView adapter with Checkboxes - BaseExpandableListAdapter that accurately tracks child checkbox states (no random checks/unchecks). This is setup for checkboxes but can be used for anything that uses true/false values
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AccountManagerCallback;
import android.accounts.AccountManagerFuture;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
@asimmon
asimmon / ionic-login-form.html
Created November 20, 2015 14:20
Centered login form with Ionic Framework HTML
<ion-view id="login" hide-nav-bar="true">
<ion-content padding="true" scroll="false">
<form>
<div class="row responsive-md">
<div class="col col-50 col-offset-25">
<div class="header padding text-center">
<img src="img/logo.png" alt="Your logo here"/>
</div>
@cyberrob-zz
cyberrob-zz / EndlessRecyclerOnScrollListener.java
Last active October 5, 2017 06:20 — 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;
@tomitrescak
tomitrescak / meteor.d.ts
Created March 2, 2016 23:14
Typescript definition for Meteor 1.3
// Type definitions for Meteor 1.3
// Project: http://www.meteor.com/
// Definitions by: Dave Allen <https://github.com/fullflavedave>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/**
* These are the common (for client and server) modules and interfaces that can't be automatically generated from the Meteor data.js file
*/
interface EJSONable {
@esantiago1
esantiago1 / AdapterItem.java
Last active April 2, 2022 05:02
Endless Scroll RecyclerView
import android.os.Handler;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;