Skip to content

Instantly share code, notes, and snippets.

View ahmedlhanafy's full-sized avatar
🎯
Focusing

Ahmed Elhanafy ahmedlhanafy

🎯
Focusing
View GitHub Profile
@ahmedlhanafy
ahmedlhanafy / android.md
Last active January 31, 2024 10:46 — forked from geekygecko/android.md
Android Cheat Sheet

Android Cheat Sheet

Developer tips

Ripple Effect

android:clickable="true"
android:background="?attr/selectableItemBackground"

or

@ahmedlhanafy
ahmedlhanafy / cardview_swipeable.java
Created October 24, 2015 16:54
The Design Support Library includes some great pre-built CoordinatorLayout Behaviors for free, like the SwypeToDismissBehavior<T> which is really easy to implement:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_swipe_behavior);
mCardView = (CardView) findViewById(R.id.swype_card);
final SwipeDismissBehavior<CardView>
swipe = new SwipeDismissBehavior();
swipe.setSwipeDirection(