Skip to content

Instantly share code, notes, and snippets.

# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@avatsav
avatsav / BottomNavigationBehavior.kt
Created June 21, 2018 08:10 — forked from ValCanBuild/BottomNavigationBehavior.kt
Full code of a BottomNavigationBehavior which hides itself on scroll and handles Snackbars and FAB. https://medium.com/@ValCanBuild/scroll-your-bottom-navigation-view-away-with-10-lines-of-code-346f1ed40e9e
// Apply to BottomNavigationView
class BottomNavigationBehavior<V : View>(context: Context, attrs: AttributeSet) :
CoordinatorLayout.Behavior<V>(context, attrs) {
override fun layoutDependsOn(parent: CoordinatorLayout?, child: V, dependency: View?): Boolean {
if (dependency is Snackbar.SnackbarLayout) {
updateSnackbar(child, dependency)
}
return super.layoutDependsOn(parent, child, dependency)
}
package com.pixite.fragment.widget;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable.Callback;
import android.view.Gravity;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.Canvas;
@avatsav
avatsav / BellyProgressBar.java
Created March 9, 2015 12:30
BellyProgressbar
public class BellyProgressBar extends ProgressBar {
private int mColor;
private float mStrokeWidth;
private float mRotationSpeed = 1f;
public BellyProgressBar(Context context) {
super(context);
init(context);
}
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The Android Open Source Project
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
@avatsav
avatsav / gist:b5f9f9d32bde56eee79a
Created November 6, 2014 11:01
intTo32bitBCD Java
public static byte[] intTo32BitBCD(Integer data) {
if (i == null) {
i = 0;
}
/* NumberFormat will format the integer and return a string with length 8 */
NumberFormat numberFormat = NumberFormat.getNumberInstance();
numberFormat.setMaximumFractionDigits(0);
numberFormat.setMinimumIntegerDigits(8);
numberFormat.setMaximumIntegerDigits(8);
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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
# The OAuth Bible
I tried to make this as understandable as possible for any party reading it which means that the wording, references, and terminology used may not reflect that of a technical paper or resource. Excuse me if you may for I wish all to understand this, and not just those with a degree in understanding legal or technical jargon.
## Table Of Contents
1. Reference
1. [Terminology](#terminology--reference)
2. [Signed Requests](#signed-requests)
2. OAuth 1.0a
package com.cyrilmottier.android.citybikes;
import android.os.Bundle;
import com.cyrilmottier.android.avelov.R;
import com.cyrilmottier.android.citybikes.app.BaseActivity;
public class LicensesActivity extends BaseActivity {
private WebView mWebView;