Skip to content

Instantly share code, notes, and snippets.

:octocat:
I may be slow to respond.

Rodrigo rodrigosimoesrosa

:octocat:
I may be slow to respond.
Block or report user

Report or block rodrigosimoesrosa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rodrigosimoesrosa
rodrigosimoesrosa / README.md
Created May 22, 2019 — forked from lopspower/README.md
Hexadecimal color code for transparency
View README.md

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

View Float.kt
import java.math.RoundingMode
import kotlin.math.round
/**
* Created by rodrigosimoesrosa.
*/
const val DIGITS = 1
fun Float.round(decimals: Int = DIGITS): Float {
var multiplier = 1.0f
View FixAppBarLayoutBehavior.kt
/*
* Copyright (C) 2018 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
@rodrigosimoesrosa
rodrigosimoesrosa / circle_drawable_shadow.xml
Last active Jul 19, 2018
Shadow for circle drawable Android.
View circle_drawable_shadow.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- Shadow -->
<item>
<shape android:shape="oval">
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
You can’t perform that action at this time.