Skip to content

Commit

Permalink
Use material 2 instead of material 3 in SearchableExpandedDropDownMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
breensmbaka committed Aug 21, 2023
1 parent 1e5d1bd commit 4903a85
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion searchable-dropdown/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation "androidx.compose.ui:ui:$compose_ui_version"
implementation "androidx.compose.material3:material3:1.0.1"
implementation "androidx.compose.material:material:1.1.1"
}

afterEvaluate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,18 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.requiredSizeIn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.DropdownMenu
import androidx.compose.material.DropdownMenuItem
import androidx.compose.material.Icon
import androidx.compose.material.IconToggleButton
import androidx.compose.material.OutlinedTextField
import androidx.compose.material.Text
import androidx.compose.material.TextFieldColors
import androidx.compose.material.TextFieldDefaults
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.KeyboardArrowDown
import androidx.compose.material.icons.outlined.KeyboardArrowUp
import androidx.compose.material.icons.outlined.Search
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconToggleButton
import androidx.compose.material3.MenuDefaults
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Text
import androidx.compose.material3.TextFieldColors
import androidx.compose.material3.TextFieldDefaults
import androidx.compose.material3.Typography
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
Expand All @@ -55,6 +52,8 @@ import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.InternalCoroutinesApi
import kotlinx.coroutines.flow.collect

/**
* 🚀 A Jetpack Compose Android Library to create a dropdown menu that is searchable.
Expand All @@ -77,7 +76,7 @@ import androidx.compose.ui.unit.dp
* @param onSearchTextFieldClicked use this if you are having problems with the keyboard showing, use this to show keyboard on your side
*/

@OptIn(ExperimentalMaterial3Api::class, ExperimentalComposeUiApi::class)
@OptIn(ExperimentalComposeUiApi::class, InternalCoroutinesApi::class)
@Composable
fun <T> SearchableExpandedDropDownMenu(
modifier: Modifier = Modifier,
Expand Down Expand Up @@ -230,10 +229,9 @@ fun <T> SearchableExpandedDropDownMenu(
searchedOption = ""
expanded = false
},
text = {
content = {
dropdownItem(selectedItem)
},
colors = MenuDefaults.itemColors(),
)
}
}
Expand Down

0 comments on commit 4903a85

Please sign in to comment.