how to implement a cards layout that displays a user's string input from an EditText view?

103 views Asked by At

I am developing a workout app, but I am stuck because I don't know how to save a user's input and then display that information on cards layout in the main activity. I am going for a layout that is very similar to Google's Google Keep.

1

There are 1 answers

4
Felipe Ignacio Pezoa Pinochet On

Well so as to get the EditText string you can always do editText.getText(). I recommend you put a button somewhere and put the getText method insde the button's onClick.

One thing you can do to display it is to use a VerticalLayout as your base activity Layout and then add HorizontalLayout which will be kind of rows and each card can be a VerticalLayout. You can always save this VerticalLayout in your resources/layouts folder like card.xml and then make a method that inflates this layout and put the information on it. The thing is they will have the same height and maybe you don't want that, but I can't think of anything else right now.