Last active
February 10, 2016 09:34
-
-
Save gturedi/55583af51b68e86f0999 to your computer and use it in GitHub Desktop.
abstract classes to avoid to implement unnecessary methods and boilerplate code for android development
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gturedi.gist; | |
import android.view.animation.Animation; | |
public abstract class CustomAnimationListener | |
implements Animation.AnimationListener { | |
@Override | |
public void onAnimationStart(Animation animation) { | |
} | |
@Override | |
public void onAnimationEnd(Animation animation) { | |
} | |
@Override | |
public void onAnimationRepeat(Animation animation) { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gturedi.gist; | |
import android.animation.Animator; | |
public abstract class CustomAnimatorListener | |
implements Animator.AnimatorListener { | |
@Override | |
public void onAnimationStart(Animator animation) { | |
} | |
@Override | |
public void onAnimationEnd(Animator animation) { | |
} | |
@Override | |
public void onAnimationCancel(Animator animation) { | |
} | |
@Override | |
public void onAnimationRepeat(Animator animation) { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gturedi.gist; | |
import android.view.View; | |
import android.widget.AdapterView; | |
public abstract class CustomOnItemSelectedListener | |
implements AdapterView.OnItemSelectedListener { | |
@Override | |
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { | |
} | |
@Override | |
public void onNothingSelected(AdapterView<?> parent) { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gturedi.gist; | |
import android.text.Editable; | |
import android.text.TextWatcher; | |
public abstract class CustomTextWatcher | |
implements TextWatcher { | |
@Override | |
public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
} | |
@Override | |
public void onTextChanged(CharSequence s, int start, int before, int count) { | |
} | |
@Override | |
public void afterTextChanged(Editable s) { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EditText et = new EditText(this); | |
et.addTextChangedListener(new CustomTextWatcher() { | |
@Override | |
public void afterTextChanged(Editable s) { | |
Log.w(TAG, "change: "+s); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment