Skip to content

Instantly share code, notes, and snippets.

View iamdeveloper-lopez's full-sized avatar
👨‍💻
Focusing

Lester Lopez iamdeveloper-lopez

👨‍💻
Focusing
View GitHub Profile
public abstract class SimpleCollapsingToolbarCallback implements AppBarLayout.OnOffsetChangedListener {
public enum State {
EXPANDED,
COLLAPSED
}
@iamdeveloper-lopez
iamdeveloper-lopez / SpacingItemDecoration.java
Created November 14, 2019 07:38
Equally spacing recyclerView items with the provided space.
public class SpacingItemDecoration extends RecyclerView.ItemDecoration {
private static final String TAG = "SPACE";
private int spacing;
public SpacingItemDecoration(int spacing) {
this.spacing = spacing;
}
@iamdeveloper-lopez
iamdeveloper-lopez / GitCommands
Created January 15, 2020 09:41
Important git commands
# rm all files
git rm -r --cached .
# add all files as per new .gitignore
git add .
# now, commit for new .gitignore to apply
git commit -m ".gitignore is now working"
Delete uncommited items in branch
git reset --hard
abstract class BaseBottomSheetDialogFragment : BottomSheetDialogFragment() {
@LayoutRes
protected abstract fun layoutRes(): Int
protected abstract fun onViewCreated()
private var sheetBehavior: BottomSheetBehavior<*>? = null
private var peekHeight = 0
private var expandedOffset = 0