Skip to content

Instantly share code, notes, and snippets.

View buddhasaikia's full-sized avatar
🏠
Working from home

Buddha Saikia buddhasaikia

🏠
Working from home
View GitHub Profile
@buddhasaikia
buddhasaikia / RecyclerView GridLayoutManager Equal column spacing
Last active October 25, 2018 06:59 — forked from yqritc/gist:ccca77dc42f2364777e1
Equal column spacing for Android RecyclerView GridLayoutManager by using custom ItemDecoration
### ItemOffsetDecoration
```java
public class ItemOffsetDecoration extends RecyclerView.ItemDecoration {
private int mItemOffset;
public ItemOffsetDecoration(int itemOffset) {
mItemOffset = itemOffset;
}
@buddhasaikia
buddhasaikia / ControllableAppBarLayout.java
Created July 4, 2018 14:44 — forked from marcelpinto/ControllableAppBarLayout.java
An extension of Android AppBarLayout, that allows to programatically change the CollapsibleToolbarLayout state and receive state changes (collapsed, expanded and idle)
package com.eatfirst.android.ui.custom;
/**
* Copyright 2015 Bartosz Lipinski
*
* 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
@buddhasaikia
buddhasaikia / ConstraintLayoutAnimation.txt
Last active May 29, 2018 06:52
ConstraintLayout Animation
ConstraintSet constraintSet = new ConstraintSet();
constraintSet.clone(getActivity(), R.layout.fragment_search_constraintset1);
ChangeBounds transition = new ChangeBounds();
transition.setInterpolator(new AnticipateOvershootInterpolator(1.0f));
transition.setDuration(800);
ConstraintLayout constraint = view.findViewById(R.id.constraint);
TransitionManager.beginDelayedTransition(constraint, transition);
constraintSet.applyTo(constraint);
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>