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
@ozodrukh
ozodrukh / BitmapHunter.kt
Created Jun 25, 2018
Very simple Bitmap loading from Disk & Assets, it's taken from Picasso (c)
View BitmapHunter.kt
package com.ozodrukh.meet
import android.app.ActivityManager
import android.content.Context
import android.content.pm.ApplicationInfo
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.BitmapFactory.Options
import android.graphics.BitmapShader
import android.graphics.Matrix
@ozodrukh
ozodrukh / arch.components.kt
Created Apr 5, 2018
Extensions to Android Arch Components
View arch.components.kt
package uz.gap.messenger.ext
import android.arch.lifecycle.*
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentActivity
import uz.gap.messenger.connection.SocketModel.MessageStatus
/**
* created at 3/31/18
*
@ozodrukh
ozodrukh / MainActivity.kt
Created Mar 15, 2018
Background View Rendering
View MainActivity.kt
package com.ozodrukh.pictureexploration
import android.content.Context
import android.graphics.BitmapFactory
import android.graphics.Canvas
import android.graphics.Picture
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.view.View
@ozodrukh
ozodrukh / CompoundDrawableClickListener.java
Created Jan 4, 2018 — forked from amaksoft/CompoundDrawableClickListener.java
Handling TextView compound drawables touch and click events
View CompoundDrawableClickListener.java
/*
* Copyright 2017, Andrey Makeev
*
* 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
@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"))
@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;
View Has weird right-to-left characters.txt
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@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
@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 / 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);
You can’t perform that action at this time.