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"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<com.google.android.material.textfield.TextInputLayout | |
android:id="@+id/textInputLayout" |
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
package com.example.preferencesdatastore | |
import android.content.Context | |
import android.os.Bundle | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.datastore.core.DataStore | |
import androidx.datastore.preferences.core.Preferences | |
import androidx.datastore.preferences.core.edit | |
import androidx.datastore.preferences.core.stringPreferencesKey | |
import androidx.datastore.preferences.preferencesDataStore |
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 Car { | |
var carName: String | |
get() = carName | |
set(value) { | |
carName = value | |
} | |
var carModel: String | |
get() = carModel | |
set(value) { | |
carModel = value |
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 Car { | |
var carName: String = "" | |
get() = field | |
set(value) { | |
field = value | |
} | |
var carModel: String = "" | |
get() = field | |
set(value) { |
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
private val _newsList = MutableLiveData<List<News>>() | |
val newsList: LiveData<List<News>> | |
get() = _newsList |
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 Car { | |
var carName: String = "" | |
get() = field | |
set(value) { | |
field = | |
if (value.length < 3) value else throw IllegalArgumentException("Name is too long") | |
} | |
} | |
fun main() { |
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
Exception in thread "main" java.lang.IllegalArgumentException: Name is too long | |
at com.oguzdogdu.backing.Car.setCarName(Car.kt:8) | |
at com.oguzdogdu.backing.CarKt.main(Car.kt:14) | |
at com.oguzdogdu.backing.CarKt.main(Car.kt) |
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
@Composable | |
fun GmailAppBar( | |
scaffoldState: ScaffoldState, | |
scope: CoroutineScope | |
) { | |
Box( | |
modifier = Modifier | |
.padding(10.dp) | |
) { | |
Card( |
OlderNewer