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
<?xml version="1.0" encoding="utf-8"?> | |
<vector xmlns:android="http://schemas.android.com/apk/res/android" | |
android:width="40dp" | |
android:height="40dp" | |
android:viewportHeight="40.0" | |
android:viewportWidth="40.0"> | |
<path | |
android:name="curves" | |
android:pathData="M 30 5 |
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
# no logging in production | |
-assumenosideeffects class android.util.Log { | |
v(...); | |
d(...); | |
i(...); | |
w(...); | |
e(...); | |
println(...); | |
} |
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
import java.math.BigDecimal; | |
import java.util.Locale; | |
import java.text.*; | |
public class CurrencyAmoutBdecimalConverter{ | |
public static void main(String []args)throws ParseException{ | |
final String dollarsA = "$199.00"; | |
final String real = "R$ 399,00"; | |
final String dollarsB = "£25.00"; | |
final String tailingEuro = "90,83 €"; |
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
import java.text.NumberFormat; | |
import java.util.Currency; | |
import java.util.Locale; | |
import java.util.Scanner; | |
public class CurrencyFormatter { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
double payment = scanner.nextDouble(); |
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
import java.util.*; | |
import java.util.stream.Collectors; | |
public class Anagrams { | |
private static String[] anagrams = { | |
"pear", | |
"amleth", | |
"dormitory", | |
"tinsel", | |
"dirty room", |
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 View.snack(message: String, length: Int = Snackbar.LENGTH_LONG, f: Snackbar.() -> Unit) { | |
val snack = Snackbar.make(this, message, length) | |
snack.f() | |
snack.show() | |
} | |
fun Snackbar.action(action: String, color: Int? = null, listener: (View) -> Unit) { | |
setAction(action, listener) | |
color?.let { setActionTextColor(color) } | |
} |
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 <T> Bundle.put(key: String, value: T) { | |
when (value) { | |
is Boolean -> putBoolean(key, value) | |
is String -> putString(key, value) | |
is Int -> putInt(key, value) | |
is Short -> putShort(key, value) | |
is Long -> putLong(key, value) | |
is Byte -> putByte(key, value) | |
is ByteArray -> putByteArray(key, value) | |
is Char -> putChar(key, value) |