(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
public class MyApp extends Application { | |
@Override | |
public void onCreate() { | |
TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf | |
} | |
} |
# -------------------------------- | |
# macOS temporary files | |
# -------------------------------- | |
.DS_Store | |
*.lock | |
*.swp | |
# -------------------------------- | |
# Xcode | |
# -------------------------------- |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- google's material design colours from | |
http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
<!--reds--> | |
<color name="md_red_50">#FFEBEE</color> | |
<color name="md_red_100">#FFCDD2</color> | |
<color name="md_red_200">#EF9A9A</color> |
// No Security | |
{ | |
"rules": { | |
".read": true, | |
".write": true | |
} | |
} |
runOnUiThread(new Runnable() { | |
public void run() { | |
//Your code is in here | |
} | |
}); |
/* | |
This is a common problem, you can not reach the context first and therefore it is null. | |
What you need to do here is that if you use "ActivityName.this" instead of getApplicationContext(), | |
context etc. your problem will be resolved. | |
*/ | |
//For example Alert Dialog; | |
AlertDialog.Builder alertDialog = new AlertDialog.Builder(MainActivity.this); //Activity name | |
alertDialog.setMessage("Test Messages"); | |
alertDialog.setPositiveButton("OK", listener); | |
AlertDialog alert = alertDialog.create(); |
android { | |
... | |
defaultConfig { | |
multiDexEnabled true | |
... | |
} | |
} | |
dependencies { | |
// add dependency |
//For Kotlin | |
val inputManager:InputMethodManager =getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager | |
inputManager.hideSoftInputFromWindow(currentFocus.windowToken, InputMethodManager.SHOW_FORCED) | |
//For Java | |
InputMethodManager inputManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); | |
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.SHOW_FORCED); |
//if you only want to use within your restriction you use vetoable | |
var name by vetoable("adali") { property: KProperty<*>, oldValue, newValue -> | |
newValue.startsWith("A") | |
} | |
name = "umut" | |
// # : name = "adali" ->because name not startwith S so | |
name = "Adanalı" | |
// # : name = "adanali" -> that's it |