Android remove focus of TextEdit when Enter is pressed

Issue I have some TextEdit inside a LinearLayout and I want to remove the cursor after I hit enter on them. Code <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context=".activity.SettingActivity" android:focusableInTouchMode="true" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:id="@+id/txtInterval1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="Edit Text

Continue reading

How to know when a LazyColumn (or any Composable for that matter) has been touched?

Issue I have the following screen built in Compose – @Composable fun DashboardScreen(heroesViewModel: HeroesViewModel = get()) { val searchState by heroesViewModel.searchState.collectAsState() val uiState by heroesViewModel.uiState.collectAsState() val focusRequester = remember { FocusRequester() } Column(modifier = Modifier.fillMaxSize()) { SearchBar( searchState = searchState,

Continue reading