... | ... | @@ -102,4 +102,27 @@ okButton.setOnClickListener { |
|
|
|
|
|
## HW
|
|
|
|
|
|
TODO: spisat edittext hw |
|
|
\ No newline at end of file |
|
|
Vytvorte layout, ktorý bude obsahovať editText1, edittext2, textView a tlačítko _Check_. Po stlačení tlačítka sa skontroluje, či editTexty obsahujú rovnaký text -- ak áno, vypíše sa zeleným _Texty jsou stejné_, inak červenou farbou _Texty jsou různé_.
|
|
|
|
|
|
Layout bude vyzerať nasledovne (konkrétny typ layoutu nechávam na vás):
|
|
|
|
|
|
```
|
|
|
+-------------+
|
|
|
| editText1 |
|
|
|
+-------------+
|
|
|
| textView |
|
|
|
+-------------+
|
|
|
| editText2 |
|
|
|
+-------------+
|
|
|
| button |
|
|
|
+-------------+
|
|
|
```
|
|
|
|
|
|
- porovnávanie reťazcov:
|
|
|
```java
|
|
|
editText1.text.toString() == editText2.text.toString()
|
|
|
```
|
|
|
- nastavenie farby textu:
|
|
|
```java
|
|
|
resultText.setTextColor(Color.GREEN)
|
|
|
``` |
|
|
\ No newline at end of file |