Answer the question
In order to leave comments, you need to log in
Single element for audio/video/photo output?
There is a need to display one of the file formats on the page. The file is selected by the user on the previous layout (layout). You can simply implement three different elements under each other and hide unnecessary ones in onCreate, but this seems like some kind of crutch.
Is there any "beautiful" solution to this problem?
Answer the question
In order to leave comments, you need to log in
Try ViewStub . Depending on which file came from the previous screen, you will inflate different layouts (for audio/photo/video) and work with them.
You can even select three different custom widgets that implement one common MediaFileHandler interface. This interface will have a handleFile(File) method. When you hit the media output screen, you inflate the appropriate layout containing your custom widget and call handleFile() on the widget.
Is there any "beautiful" solution to this problem?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question