Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
.spinBtn{
position: relative;
color: rgba(255,255,255,1);
text-decoration: none;
@CrandellWS
CrandellWS / .travis.yml
Created September 23, 2016 20:47 — forked from mariotaku/.travis.yml
Sign and upload compiled apk to Github releases automatically using Travis CI
language: android
android:
components:
# Uncomment the lines below if you want to
# use the latest revision of Android SDK Tools
- platform-tools
- tools
# The BuildTools version used by your project
- build-tools-22.0.0
@CrandellWS
CrandellWS / DismissCancelDialogActivity.java
Created May 29, 2016 17:24
Alert Dialog Cancel Activity to send onResume event.
import android.app.Activity;
import android.os.Bundle;
/**
* Created by William on 5/29/2016.
*
* new AlertDialog.Builder(this).
*
* use:(OnClickListener){setNegativeButton, setNeutralButton, setPositiveButton}
@CrandellWS
CrandellWS / height.java
Created April 30, 2016 17:14 — forked from hamakn/height.java
Android: Get height of status, action, navigation bar (pixels)
// status bar height
int statusBarHeight = 0;
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
statusBarHeight = getResources().getDimensionPixelSize(resourceId);
}
// action bar height
int actionBarHeight = 0;
final TypedArray styledAttributes = getActivity().getTheme().obtainStyledAttributes(
private class UsPhoneNumberFormatter implements TextWatcher {
//This TextWatcher sub-class formats entered numbers as 1 (123) 456-7890
private boolean mFormatting; // this is a flag which prevents the
// stack(onTextChanged)
private boolean clearFlag;
private int mLastStartLocation;
private String mLastBeforeText;
private WeakReference<EditText> mWeakEditText;
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2013 Google, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@CrandellWS
CrandellWS / AndroidManifest.xml
Created February 10, 2016 18:46
keyboard app
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ws.crandell.simplekeyboard">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<service android:name=".SimpleIME"
@CrandellWS
CrandellWS / README.md
Last active March 14, 2019 23:04
Movie Trailer Page example
@CrandellWS
CrandellWS / README.md
Last active April 12, 2021 10:39 — forked from robschmuecker/README.md
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.