This file contains hidden or 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
| BasicTextField( | |
| value = searchTextFieldValue.value, | |
| onValueChange = { newText -> | |
| searchTextFieldValue.value = newText | |
| }, | |
| cursorBrush = SolidColor(MaterialTheme.colorScheme.onTertiaryContainer), | |
| keyboardOptions = KeyboardOptions( | |
| capitalization = KeyboardCapitalization.None, | |
| autoCorrect = false, | |
| keyboardType = KeyboardType.Text, |
This file contains hidden or 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 FlowExample(counter: Int, onAdd: () -> Unit, onRemove: () -> Unit) { | |
| Row( | |
| modifier = Modifier | |
| .padding(horizontal = 10.dp) | |
| .fillMaxSize(), | |
| verticalAlignment = Alignment.CenterVertically, | |
| horizontalArrangement = Arrangement.SpaceAround | |
| ) { | |
| Button(onClick = { onAdd() }) { |
This file contains hidden or 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 androidx.lifecycle.ViewModel | |
| import kotlinx.coroutines.flow.MutableStateFlow | |
| import kotlinx.coroutines.flow.asStateFlow | |
| class MainViewModel : ViewModel(){ | |
| //Create a flow for counter | |
| private val _counter = MutableStateFlow(0) |
This file contains hidden or 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 android.os.Bundle | |
| import androidx.activity.ComponentActivity | |
| import androidx.activity.compose.setContent | |
| import androidx.activity.viewModels | |
| import androidx.compose.foundation.background | |
| import androidx.compose.foundation.layout.Arrangement | |
| import androidx.compose.foundation.layout.Box | |
| import androidx.compose.foundation.layout.Row | |
| import androidx.compose.foundation.layout.fillMaxSize |
This file contains hidden or 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 androidx.compose.foundation.background | |
| import androidx.compose.foundation.layout.Box | |
| import androidx.compose.foundation.layout.Column | |
| import androidx.compose.foundation.layout.fillMaxSize | |
| import androidx.compose.foundation.layout.fillMaxWidth | |
| import androidx.compose.foundation.layout.padding | |
| import androidx.compose.foundation.layout.statusBarsPadding | |
| import androidx.compose.foundation.shape.RoundedCornerShape | |
| import androidx.compose.foundation.text.ClickableText |
This file contains hidden or 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 ExpandableTextDemo() { | |
| var showMore = remember { mutableStateOf(false) } | |
| var isTextOverFlown = remember { mutableStateOf(false) } | |
| val text =""" | |
| Lorem Ipsum is simply dummy text of the printing and typesetting industry. | |
| """.trimIndent() | |
| Card( | |
| modifier = Modifier | |
| .padding(10.dp) |
This file contains hidden or 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
| implementation("com.google.accompanist:accompanist-permissions:0.31.0-alpha") |
This file contains hidden or 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 android.Manifest | |
| import android.content.Intent | |
| import android.net.Uri | |
| import android.os.Build | |
| import android.provider.Settings | |
| import android.widget.Toast | |
| import androidx.annotation.RequiresApi | |
| import androidx.compose.foundation.layout.Box | |
| import androidx.compose.foundation.layout.Column |
This file contains hidden or 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 android.Manifest | |
| import android.content.Intent | |
| import android.net.Uri | |
| import android.os.Build | |
| import android.provider.Settings | |
| import android.widget.Toast | |
| import androidx.annotation.RequiresApi | |
| import androidx.compose.foundation.layout.Box | |
| import androidx.compose.foundation.layout.Column |
This file contains hidden or 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 android.app.Application | |
| import dagger.hilt.android.HiltAndroidApp | |
| @HiltAndroidApp | |
| class App : Application() { | |
| override fun onCreate() { | |
| super.onCreate() | |
| } | |
| } |