Skip to content

Instantly share code, notes, and snippets.

View felipearimateia's full-sized avatar

Felipe Arimateia felipearimateia

View GitHub Profile
@felipearimateia
felipearimateia / exemplo.kt
Last active April 2, 2020 15:55
Toast Kotlin
fun Activity.toast(message: CharSequence, duration: Int = Toast.LENGTH_SHORT) {
Toast.makeText(this, message, duration).show()
}
class MainActivity : Activity(){
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
toast("Hello, Kotlin!")
}
}
@felipearimateia
felipearimateia / exemplo.java
Last active June 16, 2016 19:16
Toast Java
public class BaseActvity extends Activity{
public void toast(String message, int duration) {
Toast.makeText(this, message, duration);
}
}
public class MainActvity extends BaseActvity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
public class BorderDrawable extends Drawable {
private int mLeftBorderWidth = 0;
private int mRightBorderWidth = 0;
private int mLeftBorderColor = Color.BLACK;
private int mRightBorderColor = Color.BLACK;
private int mTopBorderWidth = 0;
private int mBottomBorderWidth = 0;
private int mTopBorderColor = Color.BLACK;
/**
* Created by felipearimateia on 02/11/14.
*/
public class TextViewLine extends TextView{
private BorderDrawable borderDrawable;
private int selectColor;
private int backgroundColor;
public TextViewLine(Context context) {