Skip to main content

Posts

Dropdown with Spinner & AutoCompleteTextView

  < com.google.android.material.textfield.TextInputLayout style ="@style/Widget.Material3.TextInputLayout.OutlinedBox.ExposedDropdownMenu" android :layout_width ="match_parent" android :layout_height ="wrap_content" > < AutoCompleteTextView android :id ="@+id/autoCompleteTv" android :layout_width ="match_parent" android :layout_height ="wrap_content" android :inputType ="none" /> object AutoCompleteHelper { fun < T > initializeAutoCompleteTextView ( context : Context , autoCompleteTextView : AutoCompleteTextView , data : List < T >, displayFunction : ( T ) -> String , onItemSelectedListener : ( position : Int , selectedItem : T ) -> Unit ) { val adapter = ArrayAdapter( context , android. R . layout . simple_spinner_dropdown_item , data . map ( displayFunction )) autoCompleteTextView .setAdapter( a...
Recent posts

Api Call with Mvvm+JetPackCompose Kotlin

 Add Important Dependency alias( libs . plugins . compose . compiler ) id( "org.jetbrains.kotlin.plugin.serialization" ) version "2.0.0" alias( libs . plugins . compose . compiler ) apply false buildFeatures { dataBinding = true viewBinding = true compose = true } compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose" , version . ref = "kotlin" } //jetpack compose dependency dependencies { val composeBom = platform( "androidx.compose:compose-bom:2024.10.01" ) implementation ( composeBom ) androidTestImplementation ( composeBom ) // Choose one of the following: // Material Design 3 implementation ( "androidx.compose.material3:material3" ) // or Material Design 2 implementation ( "androidx.compose.material:material" ) // or skip Material Design and build directly on top of foundational components implementation ( "androidx.compose.foundation:foundation...