Skip to content

Instantly share code, notes, and snippets.

Out sick

Rany Albeg Wein RanyAlbegWein

Out sick
View GitHub Profile
alexfu /
Last active Oct 1, 2020
Add equal spacing to RecyclerView items automatically. Can handle horizontal, vertical, and grid display modes
import android.view.View;
public class EqualSpacingItemDecoration extends RecyclerView.ItemDecoration {
private final int spacing;
private int displayMode;
public static final int HORIZONTAL = 0;
cesarferreira /
Last active Jan 8, 2020
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
nickbutcher / 1 search_bar.xml
Last active Sep 15, 2020
Demonstrating morphing a search icon into a search field. To do this we use an AnimatedVectorDrawable ( made up of two paths. The first is the search icon (as a single line) the second is the horizontal bar. We then animate the 'trimPathStart' property …
View 1 search_bar.xml
<?xml version="1.0" encoding="utf-8"?>
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
MarsVard / README
Last active Jun 22, 2020
android drawable to imitate google cards.
put card.xml in your drawables directory, put colors.xml in your values directory or add the colors to your colors.xml file.
set the background of a view to card,
as you can see in card.xml the drawable handles the card margin, so you don't have to add a margin to your view
``` xml
You can’t perform that action at this time.