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

Make Stats compatible with dual pane layout #3643

Closed
khaykov opened this issue Jan 21, 2016 · 2 comments
Closed

Make Stats compatible with dual pane layout #3643

khaykov opened this issue Jan 21, 2016 · 2 comments

Comments

@khaykov
Copy link
Member

khaykov commented Jan 21, 2016

This issue is a part of #3551

Currently StatsActivity serves as a container for multiple abstract stats fragments that display stats data.
Stats are supposed to be a default view in upcoming double pane layout (like it's currently on the website). To be able to show stas as a part of dual pane layout we need to move all the code from StatsActivity to StatsFragment.

Design wise, the main change will be to move the time frame spinner from toolbar

spinner_a

to fragment (we can't use toolbar in dual pane layout).

spinner_b

So the dual pane layout will look something like this:

landscape

About the code.
Most of the code nicely fits into fragment's lifecycle, except for couple of tricky parts:
There are multiple places in StatsActivity where finish() is called when something goes wrong, and activity just closes after showing error toast. This is fine in case of activity, but if the fragment is in dual pane layout this won't work, especially if stats will be a default fragment.

Easy solution is to make StatsFragment remove itself after showing Toast/Snack with error message. This will leave us with confused user and some empty space (we could put WP logo there, or something like this).
screenshot-2016-01-21_23 23 02 593

Apart from issues with finish(), at some points user interaction might be required:

Missing Jetpack modal dialog
jetpack

could be converted into Snackbar, but we would only have one button - YES

jetpack2

Or, we can expand on error view idea, like this:
screenshot-2016-01-21_23 48 58 8

The one issue I'm not exactly sure what to do about is the Sign in requirement for self-hosted site. I'm not sure at what circumstances exactly it happens (why would account not be signed in while browsing stats), but current code just launches SignInActivity without any prompt. I don't think this will work well within dual pane layout, especially when the fragment is default.

@maxme
Copy link
Contributor

maxme commented Jan 2, 2017

I'm not sure we want to implement dual pane anymore, we could eventually revisit the Stats view for large screen. cc @daniloercoli

@nbradbury
Copy link
Contributor

I think we can close this one since we've moved away from dual-pane as a viable solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants