(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.
| // Error Codes for SignUp | |
| ERROR_OPERATION_NOT_ALLOWED` - Indicates that Anonymous accounts are not enabled. | |
| ERROR_WEAK_PASSWORD - If the password is not strong enough. | |
| ERROR_INVALID_EMAIL` - If the email address is malformed. | |
| ERROR_EMAIL_ALREADY_IN_USE - If the email is already in use by a different account. | |
| ERROR_INVALID_CREDENTIAL` - If the [email] address is malformed. | |
| // sending password reset email | |
| ERROR_INVALID_EMAIL` - If the [email] address is malformed. |
| package com.samclarke.android.util | |
| import java.security.MessageDigest | |
| /** | |
| * Hashing Utils | |
| * @author Sam Clarke <www.samclarke.com> | |
| * @license MIT | |
| */ | |
| object HashUtils { |
| //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 |
| //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); |
| android { | |
| ... | |
| defaultConfig { | |
| multiDexEnabled true | |
| ... | |
| } | |
| } | |
| dependencies { | |
| // add dependency |
| /* | |
| 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(); |
| runOnUiThread(new Runnable() { | |
| public void run() { | |
| //Your code is in here | |
| } | |
| }); |
| // No Security | |
| { | |
| "rules": { | |
| ".read": true, | |
| ".write": true | |
| } | |
| } |
| <?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> |
(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.