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
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!") | |
} | |
} |
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
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); |
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
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; |
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
/** | |
* 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) { |