Skip to content

Instantly share code, notes, and snippets.

View bouchtaoui-dev's full-sized avatar

Nordin-010 bouchtaoui-dev

  • Netherlands, Rotterdam
View GitHub Profile
@bouchtaoui-dev
bouchtaoui-dev / gist:780a9a5d189d56a2a3f6
Last active August 29, 2015 14:14
A simple class that makes a view blink, without the need of Thread or Timer objects. The rest is self explanatory.
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
*
* @author Andaluz
* It's free like freedom, but with respect to each other :)'
public class MyFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
View view = inflater.inflate(R.layout.my_fragment, container, false);
// Find your buttons in view, set up onclicks, set up callbacks to your parent fragment or activity here.
// You can create ViewHolder or separate method for that.
// example of accessing views: TextView textViewExample = (TextView) view.findViewById(R.id.text_view_example);
// textViewExample.setText("example");