Skip to content

Instantly share code, notes, and snippets.

Luca Nicoletti lnicolet

Block or report user

Report or block lnicolet

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
@davidvavra
davidvavra / NonNullAssertionDetector.kt
Created Mar 22, 2019
Lint check for detecting non-null assertion (!!) in your code
View NonNullAssertionDetector.kt
import com.android.tools.lint.client.api.UElementHandler
import com.android.tools.lint.detector.api.*
import org.jetbrains.uast.UElement
import org.jetbrains.uast.UPostfixExpression
class NonNullAssertionDetector : Detector(), Detector.UastScanner {
override fun getApplicableUastTypes(): List<Class<out UElement>>? {
return listOf(UPostfixExpression::class.java)
}
@nickbutcher
nickbutcher / rainbow.xml
Last active Mar 18, 2019
Demonstrating using VectorDrawable gradients to create a rainbow effect. See https://twitter.com/crafty/status/1011922414983352320
View rainbow.xml
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Google Inc.
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 distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the specific language governing permissions and limitations under
the License.
@twocity
twocity / SimpleHeaderDecoration.java
Last active Aug 3, 2018
An empty header (or footer) decoration for RecyclerView, since RecyclerView can't clipToPadding
View SimpleHeaderDecoration.java
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;
/**
* An empty header (or footer) decoration for RecyclerView, since RecyclerView can't clipToPadding
*/
public class SimpleHeaderDecoration extends RecyclerView.ItemDecoration {
private final int headerHeight;
private final int footerHeight;
You can’t perform that action at this time.