You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
to fragment (we can't use toolbar in dual pane layout).
So the dual pane layout will look something like this:
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).
Apart from issues with finish(), at some points user interaction might be required:
Missing Jetpack modal dialog
could be converted into Snackbar, but we would only have one button - YES
Or, we can expand on error view idea, like this:
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.
The text was updated successfully, but these errors were encountered:
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
to fragment (we can't use toolbar in dual pane layout).
So the dual pane layout will look something like this:
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).
Apart from issues with finish(), at some points user interaction might be required:
Missing Jetpack modal dialog
could be converted into Snackbar, but we would only have one button - YES
Or, we can expand on error view idea, like this:
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.
The text was updated successfully, but these errors were encountered: