Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to create separate layouts with their own textViews & imageViews #59

Closed
fnokeke opened this issue Jan 21, 2017 · 2 comments
Closed

Comments

@fnokeke
Copy link

fnokeke commented Jan 21, 2017

Hi,

I went through the other issues but really couldn't find my response.

So far, I understand that onSwitch is where I handle when each icon is clicked and replaceFragment uses getSupportFragmentManager().beginTransaction().replace(R.id.content_frame, contentFragment).commit(); and eventually returns ContentFragment object.

My question is: how do I create multiple fragments that each has its own textView & imageView elements. For instance, when BUILDING icon is clicked, it should open a dashboard view with textView and editView elements. When ABOUT is clicked, it should open a static text view.

I've tried multiple approaches including:
**adding a FrameLayout to activity_main.xml but I couldn't create another contentFragment for getSupportFragmentManager( ) so got errors.
**I created a new Fragment class to extend ContentFragment but still got errors w
**Created custom class to extend Fragment and implement ScreenShotable and still errors

Any tip / guidance will be super appreciated. Thanks.

@warko-san
Copy link
Contributor

Hi, @fnokeke! Yours third option was right. You need to create your own fragment, and implement ScreenShotable interface.
Can you provide logs of what went wrong?

@TeeRawk
Copy link
Contributor

TeeRawk commented Mar 6, 2017

outdated

@TeeRawk TeeRawk closed this as completed Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants