Skip to content

Instantly share code, notes, and snippets.

View Moes81's full-sized avatar

Andreas Spindler Moes81

  • MaibornWolff GmbH
  • Munich
View GitHub Profile
@lukelorusso
lukelorusso / RecyclerViewExtension.kt
Last active June 14, 2021 16:54
Now it's complete
fun RecyclerView.bindScrollTo(vararg destinations: RecyclerView): RecyclerView.OnScrollListener {
object : RecyclerView.OnScrollListener() {
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
// each time you drag a RecyclerView, you should STOP other destinations' scrolling
if (newState == RecyclerView.SCROLL_STATE_DRAGGING)
destinations.forEach { destinationRecyclerView ->
destinationRecyclerView.stopScroll()
}
// then you can scroll the RecyclerView, dragged or not
super.onScrollStateChanged(recyclerView, newState)
@julianshen
julianshen / CircleTransform.java
Last active November 6, 2023 12:47
CircleTransform for Picasso
/*
* Copyright 2014 Julian Shen
*
* 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
@9re
9re / ExifUtil.java
Created March 7, 2012 00:16
fix flipped / rotated image by getting exif orientation
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.os.Build;