Skip to content

Instantly share code, notes, and snippets.

woah, how close was that?

Ozodrukh ozodrukh

woah, how close was that?
View GitHub Profile
davidwhitman / Preferences.kt
Last active Feb 20, 2021
Android SharedPreferences helper class for Kotlin. Easy-to-use delegated properties, automatic database creation, and listening for property changes.
View Preferences.kt
import android.content.Context
import android.content.SharedPreferences
import kotlin.reflect.KProperty
* Represents a single [SharedPreferences] file.
* Usage:
* ```kotlin
package spoon.test;
import spoon.reflect.declaration.*;
import java.util.ArrayList;
import java.util.IntSummaryStatistics;
import java.util.TreeSet;
import java.util.function.Consumer;
import java.util.function.ToIntFunction;
mpost / colors.xml
Last active Jan 8, 2020
This gist demonstrates how to create an animated pause/resume media playback button for Android. It uses animated vector drawables and state transitions to orchestrate the effect. Some background:
View colors.xml
<?xml version="1.0" encoding="utf-8"?>
<color name="action_pause">#FF8F00</color>
<color name="action_resume">#43A047</color>
bryanstern /
Last active Oct 15, 2020
An OkHttp backed HttpStack for Volley
* The MIT License (MIT)
* Copyright (c) 2015 Circle Internet Financial
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
rock3r /
Last active Apr 28, 2017
Move/rename *-{m|h|xh|xxh|xxxh}dpi.png" assets into proper folder structure, ready for copypasta
# License for any modification to the original (linked below):
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# Sebastiano Poggi wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return.
# ----------------------------------------------------------------------------
buckets=( mdpi hdpi xhdpi xxhdpi xxxhdpi )
package com.materialdesign.chris.materialdesignexperimenting;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.ViewAnimationUtils;
chris95x8 /
Created Dec 12, 2014
Bunch of interpolators for awesome animations in Android!
import android.view.animation.Interpolator;
* From
* Derived from:
public class CubicBezierInterpolator implements Interpolator {
* Copyright 2014 Chris Banes
* 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
* Unless required by applicable law or agreed to in writing, software
ozodrukh /
Created Nov 16, 2014
Show/Hide extra objects when scrolling
public static class HideExtraOnScroll extends RecyclerView.OnScrollListener{
final static Interpolator ACCELERATE = new AccelerateInterpolator();
final static Interpolator DECELERATE = new DecelerateInterpolator();
WeakReference<View> mTarget;
HideExtraOnScrollHelper mScrollHelper;
boolean isExtraObjectsOutside;