Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@teslacoil
teslacoil / SimpleFastScrollRecyclerView.java
Created December 13, 2015 21:24
Basic implementation of BaseRecyclerView from AOSP Launcher3 for use with listview style recyclerviews. In your adapter implement FastScrollTitleSectionProvider
/*
* 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
*
* Unless required by applicable law or agreed to in writing, software
@evant
evant / ViewPagerRemoveHardwareLayer.java
Created June 25, 2015 18:00
Disable ViewPager hardware layer if you are animating the items within while paging
public class ViewPagerRemoveHardwareLayer implements ViewPager.OnPageChangeListener {
private ViewPager mPager;
public ViewPagerRemoveHardwareLayer(ViewPager pager) {
mPager = pager;
}
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
@chris95x8
chris95x8 / UIActivity.java
Created December 13, 2014 22:35
FAB expand
package com.materialdesign.chris.materialdesignexperimenting;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.ViewAnimationUtils;
@chrisbanes
chrisbanes / CollapsingTitleLayout.java
Last active March 26, 2023 11:58
CollapsingTitleLayout
/*
* Copyright 2014 Chris Banes
*
* 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
@mohlendo
mohlendo / ReorderRecyclerView.java
Created November 26, 2014 14:05
A RecylcerView that can be reordered with drag&drop. Heavily inspired by https://www.youtube.com/watch?v=_BZIvjMgH-Q A complete example can be found here: https://github.com/mohlendo/ReorderRecyclerView
/*
* Copyright (C) 2014 I.C.N.H GmbH
*
* 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
@ManuelPeinado
ManuelPeinado / MainActivity.java
Created October 19, 2014 20:02
Fading action bar effect using the new Toolbar class from the support library
package com.github.manuelpeinado.toolbartest;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.View;
@homj
homj / HamburgerDrawable.java
Created October 11, 2014 23:33
I'm getting hungry!
/*
* Copyright 2014 Johannes Homeier
*
* 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
@grantland
grantland / post.md
Last active February 9, 2023 05:09
RecyclerView item onClick

RecyclerView item onClick

RecyclerView does not have an OnItemClickListener like it's predecessor, ListView. However, detecting item clicks is pretty simple.

Set an OnClickListener in your ViewHolder creation:

private class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder>  {

    public static class ViewHolder extends RecyclerView.ViewHolder
@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active March 15, 2024 06:39
FloatLabelLayout
/*
* Copyright 2014 Chris Banes
*
* 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
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: