DaJackal
DaJackal

Reputation: 2095

Adding dynamic content in Linear Layout

I'm working on an Android app, which when the user taps on an icon, a Layout defined (for now) in the main layout slides up with some information.

The problem is that I have icons of different types, so when one clicks on one type of icon or another, the information in the pop up should be different (there are different objects with different structures behind those icons).

What possibilities do I have? The programmatic way just does not seem elegant enough. Are there any templating frameworks in Android? Please provide some examples, too.

Upvotes: 0

Views: 93

Answers (1)

hmartinezd
hmartinezd

Reputation: 1196

You could sub-class your icons (that means the types that are shown with each icon), like having each one it's own fragment sub-class, an then you can use a different layout on fragment.

Here is more info about Fragments

Upvotes: 1

Related Questions