How to add new item to Android Long Press on Edit Text? - android

Is it possible to add new item to the list which appear when user long press on an empty EditText view? Just like Copy / Paste / Select / Select All, I want to add "Translate". How can I implement this?
I tried using setCustomSelectionActionModeCallback
but it did not work for EditText view.

Related

How to make Scrollable List of new page when I click Drop down Snipper in Kotlin

I want to make List for selecting region when user register on app.
So What I want to implement is if user click drop down menu
I want make it go another new page, not list dropped down below.
New page will have Scrollable list.
And I click this Scrollable list, I need to get this data.
So I guess I need to use RecyclerView to make Scrollable list of new page.
And Each component of RecyclerView should be button. (is that right?)
1) But what I don't know is how to make Dropdown Snipper as Clickable Button.
Snipper can't use setOnClickListener.
Should I make Button to have Text and Arrow manually?
In React Native It had some library for this purpose.
2) Is that correct Kotlin doesn't provide such library?

Customize dropdown (Picker) list in xamarin.forms

I am working on xamarin.forms. I am creating an app for android. In app I have a dropdown list. I am using Picker for it. I customized it to look like dropdown. Now I need to make the first Index item to nonselactable. Means user can not select the first item. If user click on it nothing should happen. But currently when user click on the first index dropdown gets collapsed.
One more thing that I have to add in dropdown is a Cross button at index 1. Means at index 1, on left side there will be Cross button and at center there will be text like Select item. And this whole row should not be selctable. If user click at cross button dropdown should collapsed.
Anyone have idea how I can do this?
You can use listview for dropdown and control its visibility as per need.I faced similar situation where I customized list view to enact dropdown.There is another thing I want to know about Picker.Does your picker accepts or adds string only or you could customize it to accept views or controls?

Custom Listview with Text and two Images

I am new to Android Development and I am making an application in which I have an EditText and below EditText there is submit Button.
I want that when I write something in EditText and then click submit, the Edittext value will show in Listview with pre defined two Images i.e. their is EditText value in listview and on the right of it two Images also added with that Submit button. These images are Delete and Edit Images so that whenever i click on delete it delete that item and whenever i click on Edit image the EditText value will be ready for editing.
I know that this will be done by getView method and a holder but i could not find any best example for that.
Can anyone provide me the best example for holder and custom listview regarding my application?

How to Call Button from List view inside fragment layout

Hello i have problem with button not updating,
I had used sample search , when user search any word ,
I had placed star button in right aligned in
I means to say suppose i search something and list view opens and at right star bookmark is there so on click it must show.
You can't get any useful replies without posting your source code.

how to create view that expand & shrink on click?

I have to display list of items along with a plus(+) sign , on click of plus sign list should expand & on click again list should shrink
You can do this but would need to do more work
as you want to show
name ,address and plus sign should changed to minus ,
you would require to make a custom list view and what you can do is use
when plus button is clicked in list
nameText.setVisibility(View.VISIBLE);
adress.setVisibility(View.VISIBLE);
btn.setBackgroundResource(R.drawable.minus);
and when minus button is clicked
nameText.setVisibility(View.GONE);
adress.setVisibility(View.GONE);
btn.setBackgroundResource(R.drawable.plus);
If you want to create a tree view like windows, then it is not a UI element that is supported by android. The similar to this is the ExplandableListView element.
Although in one business application I have found this http://code.google.com/p/tree-view-list-android/ project that does exactly what you want.

Categories

Resources