Skip to content

Instantly share code, notes, and snippets.

Avatar
🎃
woah, how close was that?

Ozodrukh ozodrukh

🎃
woah, how close was that?
View GitHub Profile
View NumberMorphingView.java
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;
View tree_html5.html
<html>
<head>
<script type="text/javascript">
window.onload = draw;
function draw(){
@ozodrukh
ozodrukh / player_get.py
Last active Jan 14, 2016
Player.uz script to grab and open direct link to serial or download sequentially by seasons and episodes
View player_get.py
# coding: utf8
import re, json, bs4, requests, argparse, os, optparse
from urlparse import parse_qs, urlsplit, urlparse
ALL = -100
KEY_EPISODE_NUMBER = "episode"
KEY_EPISODE_SEASON = "season"
KEY_EPISODE_FILE = "file"
@ozodrukh
ozodrukh / HideExtraOnScroll.java
Created Nov 16, 2014
Show/Hide extra objects when scrolling
View HideExtraOnScroll.java
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;
@ozodrukh
ozodrukh / HeaderDecor.java
Created Jun 21, 2016
Work in progress RecyclerView decoration to pin header
View HeaderDecor.java
@Beta
private class HeaderDecor extends RecyclerView.ItemDecoration {
private RecyclerView.AdapterDataObserver adapterDataObserver;
private RecyclerView.ViewHolder headerViewHolder;
private int headerViewType;
private final Rect tmpBounds = new Rect();
@Override public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
if (headerViewHolder == null) {
headerViewHolder = obtainViewHolder(parent);
@ozodrukh
ozodrukh / ActionView.java
Last active Jul 8, 2016
Simple MenuItemView with progress bar
View ActionView.java
package io.codetail.trade.activities.preview;
import android.content.Context;
import android.content.res.TypedArray;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v4.widget.TextViewCompat;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageView;
@ozodrukh
ozodrukh / Detective.kt
Created Jul 24, 2016
Detective is a small library that detects Application focus changes
View Detective.kt
object Detective : SimpleActivityLifecycleCallbacks() {
private infix fun <T> List<T>.notContains(element: T): Boolean {
return !contains(element)
}
/** Timeout when app looses focus */
private val backgroundEnterTimeout: Int = 120
private val appFocusListeners = ArrayList<ApplicationFocusListener>()
private var registered = false
View Has weird right-to-left characters.txt
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@ozodrukh
ozodrukh / CoverImageView.java
Last active Sep 7, 2016
ImageView with extended functionality
View CoverImageView.java
package uz.lamuz.player.ui.widget.cover;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.TransitionDrawable;
@ozodrukh
ozodrukh / build.gradle.kts
Created Jun 26, 2017
Gradle Kotlin Script
View build.gradle.kts
plugins {
kotlin("jvm")
}
kapt {
generateStubs = true
}
dependencies {
compile(project(":shared"))