https://kotlinlang.org logo
Title
m

Mikołaj Kąkol

03/31/2022, 11:54 AM
hi, is there an API in compose for EditText’s
/**
 * Called when a context menu option for the text view is selected.  Currently
 * this will be one of {@link android.R.id#selectAll}, {@link android.R.id#cut},
 * {@link android.R.id#copy}, {@link android.R.id#paste} or {@link android.R.id#shareText}.
 *
 * @return true if the context menu item action was performed.
 */
public boolean onTextContextMenuItem(int id) {
s

saket

05/10/2022, 3:36 PM
👋 were you able to find a solution?
I think we can use
LocalTextToolbar
for listening to cut, copy and paste events
m

Mikołaj Kąkol

05/16/2022, 11:03 AM
my colleague is currently working on this and he is using that, by proving AndroidTextToolbar, unfortunatelly he is saying that he need to copy whole code, there is no option to attach listeners or sth similar
s

saket

05/16/2022, 1:56 PM
Gotcha. I was easily able to set a listener by creating a TextToolbar that wraps around LocalTextToolbar.current.