Jason Momoa
Jason Momoa

Reputation: 133

What is name of this component in Android?

I'm building a form like below. What is name of this component, and how can I make it?

Form:

Form like this:

After I click on the down arrow icon ╲╱ it's expanded:

enter image description here

Upvotes: 1

Views: 136

Answers (1)

Henrique Monte
Henrique Monte

Reputation: 1284

Actually, this can be done by using only a LinearLayout with 2 EditTexts in which you make it visible or not, programmatically.

To animate when opening, you can set this in your parent layout:

android:animateLayoutChanges="true"

Arrow OnClick method example:

LinearLayout llExtraFields = findViewById(R.id.llExtraFields);
if (llExtraFields.getVisibility() == View.VISIBLE) {
    llExtraFields.setVisibility(View.GONE);
} else {
    llExtraFields.setVisibility(View.VISIBLE);
}

Upvotes: 1

Related Questions