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
Column( | |
modifier = Modifier.fillMaxSize(), | |
horizontalAlignment = Alignment.CenterHorizontally, | |
verticalArrangement = Arrangement.Center | |
) { | |
Text( | |
text = "Text1", | |
color = Color.Black, | |
fontSize = 21.sp | |
) |
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
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
android:gravity="center"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" |
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
val listOfNumbers = listOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) | |
val listOfEvenNumbers = listOfNumbers.filter { number -> number % 2 == 0 } | |
println(listOfEvenNumbers) |
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
val listOfNumbers = listOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) | |
val listOfEvenNumbers = mutableListOf<Int>() | |
for (number in listOfNumbers) { | |
if (number % 2 == 0) { | |
listOfEvenNumbers.add(number) | |
} | |
} | |
println(listOfEvenNumbers) |
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
class ErrorFragment : Fragment() { | |
private var _binding: FragmentErrorBinding? = null | |
private val binding get() = _binding!! | |
companion object { | |
private const val ERROR_KEY = "errorKey" | |
fun newError(error: ErrorView): ErrorFragment { | |
return ErrorFragment().apply { |
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
@Parcelize | |
class ServerError : ErrorView { | |
override fun setupView(binding: FragmentErrorBinding) { | |
binding.apply { | |
errorTitle.setText(R.string.key_error) | |
errorDescription.setText(R.string.key_server_error) | |
errorImage.setImageResource(R.drawable.ic_server) | |
} | |
} |
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
@Parcelize | |
class InternetError(private val showWarning: Boolean) : ErrorViewWithWarning { | |
@IgnoredOnParcel | |
override var warning: Snackbar? = null | |
override fun setupView(binding: FragmentErrorBinding) { | |
binding.apply { | |
errorTitle.setText(R.string.key_error) | |
errorDescription.setText(R.string.key_internet_error) |
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
@Parcelize | |
class NotFoundError : ErrorView { | |
override fun setupView(binding: FragmentErrorBinding) { | |
binding.apply { | |
errorTitle.setText(R.string.key_error) | |
errorDescription.setText(R.string.key_not_found_error) | |
errorImage.setImageResource(R.drawable.ic_not_found) | |
} | |
} | |
} |
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
interface ErrorViewWithWarning : ErrorView { | |
var warning: Snackbar? | |
fun showWarning(root: View) | |
fun dismissWarning() | |
} |
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
interface ErrorView : Parcelable { | |
fun setupView(binding: FragmentErrorBinding) | |
} |
NewerOlder