Skip to content

Instantly share code, notes, and snippets.

@cesco89
cesco89 / ImplementationSample.java
Created May 11, 2014 13:04
ListView with detectable scrolling direction
list.setOnDetectScrollListener(new OnDetectScrollListener() {
@Override
public void onUpScrolling() {
// TODO Auto-generated method stub
mBottom.setVisibility(View.VISIBLE);
}
@Override
public void onDownScrolling() {
@cesco89
cesco89 / FragmentPageAdapter
Last active January 11, 2022 02:56
Add Fragments dynamically to ViewPager
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
public class MyFragmentPageAdapter extends FragmentPagerAdapter {
@cesco89
cesco89 / CircleAnimatedCheckBox.java
Last active February 9, 2023 05:09
A custom animated circle checkbox based on markushi's CircleButton (https://github.com/markushi/android-circlebutton)
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.widget.CheckBox;
import android.widget.ImageView;
@cesco89
cesco89 / aaa
Last active August 29, 2015 13:56
Random test :P
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"