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
| data class WebViewArgs( | |
| val url: String, | |
| val topBarTitle: String, | |
| ) | |
| @SuppressLint("SetJavaScriptEnabled") | |
| @OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterialApi::class) | |
| @Composable | |
| fun WebViewScreen( |
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
| ExposedDropdownMenuBox( | |
| expanded = isExpanded.value, | |
| onExpandedChange = { isExpanded.value = it }, | |
| ) { | |
| FilterContainer( | |
| title = R.string.input_customer_name, | |
| ) { | |
| OutlinedTextField( | |
| modifier = Modifier | |
| .fillMaxWidth() |
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 Modifier.thenIf( | |
| condition: Boolean, | |
| factory: @Composable Modifier.() -> Modifier | |
| ): Modifier { | |
| return if (condition) factory.invoke(this) else this | |
| } |
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
| class MainActivity : ComponentActivity() { | |
| private val appUpdateManager = AppUpdateManagerFactory.create(applicationContext) | |
| private val appUpdateType = AppUpdateType.IMMEDIATE | |
| private val updateLauncher = registerForActivityResult( | |
| ActivityResultContracts.StartIntentSenderForResult() | |
| ) { result -> | |
| if (result.resultCode == RESULT_OK) { | |
| appUpdateManager.completeUpdate() | |
| } |
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
| # Gradle files | |
| .gradle/ | |
| build/ | |
| # Local configuration file (sdk path, etc) | |
| local.properties | |
| # Log/OS Files | |
| *.log |
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
| fun File.openFile(context: Context, authority: String) { | |
| val uri = FileProvider.getUriForFile( | |
| context, | |
| authority, | |
| this | |
| ) | |
| val intent = Intent(Intent.ACTION_VIEW) | |
| if (this.toString().contains(".doc") || this.toString().contains(".docx")) { | |
| // Word document |
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 ComposableLifecycle( | |
| lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current, | |
| onEvent: (LifecycleOwner, Lifecycle.Event) -> Unit | |
| ) { | |
| DisposableEffect(lifecycleOwner) { | |
| val observer = LifecycleEventObserver { source, event -> | |
| onEvent(source, event) | |
| } |
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.util.Log | |
| import android.view.Gravity | |
| import android.widget.Toast | |
| import androidx.compose.foundation.layout.Box | |
| import androidx.compose.foundation.layout.Column | |
| import androidx.compose.foundation.layout.fillMaxSize | |
| import androidx.compose.material3.Button | |
| import androidx.compose.material3.Text | |
| import androidx.compose.runtime.Composable | |
| import androidx.compose.ui.Modifier |