Skip to content

Instantly share code, notes, and snippets.

View ayvazj's full-sized avatar

James Ayvaz ayvazj

  • San Francisco Bay Area
  • 13:49 (UTC -08:00)
  • X @jamesayvaz
View GitHub Profile
@ayvazj
ayvazj / LinkedHashMapAdapter
Created September 19, 2015 05:43
A HashMap adapter for Android
package com.github.ayvazj.hashadapter;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Filter;
import android.widget.Filterable;
@ayvazj
ayvazj / intro.btfy
Created March 16, 2016 14:52
btfy example
{
"version": 1,
"comment": "'20150313T13:08:29-OOB attract loop V2' exported by AE Butterfly Format Exporter v0.37",
"type": "stage",
"aspectRatio": 0.5625,
"size": {
"width": 720,
"height": 1280
},
"animations": [
@ayvazj
ayvazj / position keyframe
Created March 16, 2016 14:55
position keyframe
[
0,
{
"x": 1.1875,
"y": 0.22421875
},
{
"name": "cubic-bezier",
"x1": 0.0001,
"y1": 0,
@ayvazj
ayvazj / opacity keyframe
Created March 16, 2016 14:57
opacity keyframe
[
0,
0,
{
"name": "cubic-bezier",
"x1": 0.33333333,
"y1": 0,
"x2": 0.66666667,
"y2": 1
}
@ayvazj
ayvazj / parse btfy
Created March 16, 2016 14:58
parse btfy
public BtfyAnimationGroup parseAnimationGroup(JsonNode jSONObject) throws BtfyParseException {
String typeStr = jSONObject.path("type").asText();
if (typeStr.equals("animationGroup")) {
String jsonId = jSONObject.path("id").asText();
if (TextUtils.isEmpty(jsonId)) {
throw new BtfyParseException("Animation missing id.");
}
if (!jSONObject.has("initialValues")) {
throw new BtfyParseException("Animation group missing initial values.");
@ayvazj
ayvazj / btfy meta
Created March 16, 2016 14:59
btfy meta
{
"version": 1,
"comment": "'20150313T13:08:29-OOB attract loop V2' exported by AE Butterfly Format Exporter v0.37",
"type": "stage",
"aspectRatio": 0.5625,
"size": {
"width": 720,
"height": 1280
},
...
@ayvazj
ayvazj / BtfyAnimationView
Created March 16, 2016 15:00
BtfyAnimationView
public class BtfyAnimationView extends ViewGroup {
// ... load .btfy into a BtfyStage object at property this.btfyStage
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (this.btfyStage == null) {
setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec),
MeasureSpec.getSize(heightMeasureSpec));
return;
@ayvazj
ayvazj / main.dart
Created July 14, 2019 09:51
Mapbox main.dart - v1
import 'package:flutter/material.dart';
import 'package:mapbox_gl/mapbox_gl.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(home: MapWidget());
}