Skip to content

Instantly share code, notes, and snippets.

View nikartm's full-sized avatar
:electron:
Bio Robot

Ivan V nikartm

:electron:
Bio Robot
View GitHub Profile
@xvadsan
xvadsan / ViewVisibilityExtensions.kt
Created December 19, 2020 07:55 — forked from brescia123/ViewVisibilityExtensions.kt
Useful Android Kotlin Extension functions to easily change the visibility of a View
/** Set the View visibility to VISIBLE and eventually animate the View alpha till 100% */
fun View.visible(animate: Boolean = true) {
if (animate) {
animate().alpha(1f).setDuration(300).setListener(object : AnimatorListenerAdapter() {
override fun onAnimationStart(animation: Animator) {
super.onAnimationStart(animation)
visibility = View.VISIBLE
}
})
} else {
@xvadsan
xvadsan / RecyclerView init animation
Last active December 19, 2020 11:15
recycler view init animation
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutAnimation="@anim/layout_animation"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
@alexoro
alexoro / NoLimitRecycledViewPool.java
Created July 29, 2019 10:22
RecycledViewPool with unlimited number of ViewHolders
package com.vk.im.ui.utils.recyclerview;
import android.support.v7.widget.RecyclerView;
import android.util.SparseIntArray;
/**
* RecycledViewPool with unlimited number of ViewHolders
* {@author uas.sorokin@gmail.com}
*/
public class NoLimitRecycledViewPool extends RecyclerView.RecycledViewPool {
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
android {
compileSdkVersion versions.compileSdk
buildToolsVersion versions.buildTools
defaultConfig {
applicationId "samples.linhtruong.com.ui_reactive_rxjava_realm"
minSdkVersion versions.minSdk
@segunfamisa
segunfamisa / app-module-build.gradle
Last active June 22, 2020 11:43
Using gradle extra properties to manage Android dependency versioning
// app module build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
defaultConfig {
applicationId "com.segunfamisa.gradleextraproperties"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion