My Profile - #3428
Conversation
…connected to labels
I think the only reasons to use a list view in that case are:
If we don't have one of these criteria, it seems easier (and faster to make changes) to have a simple static layout.
Yep, we should have a generic "input" dialog somewhere. You can add it to |
Agreed. |
|
Thank you both. @maxme the information will be retrieved from network and will probably be saved into the db (or somewhere), but it should be fairly static and it wouldn't change very often. If I am interpreting your comments correctly, it's still fine to go with the static view approach, right? |
Yes! |
|
Awesome! |
Yes, I mean if the list structure itself comes from the network (in that case, you don't have much choices, static won't work ;)) - for instance: Notification Settings (list of blogs). |
|
Ahhh, I misunderstood that part, thanks for the correction! |
|
Have you considered using a PreferenceFragment for the layout? I think it would be simpler than using the custom This is the bulk of the relevant work on Settings. |
|
@tonyr59h I think that link is dead, but I checked Site Settings from here instead. It looks like it might be a good fit, thanks a lot for pointing it out. It's still a bit more work than it might worth it though, especially since the current approach is almost done. There are also some slight design differences, but I guess that's not a big deal since you're already using it in Site Settings and we can look into the slight changes together for consistency. I am not sure which way to go, I'd love a second opinion. @nbradbury & @maxme what do you guys think? Do you think it'd be worth to give |
It's less flexible than a plain fragment, and in the past we had some issues with styling (I don't think this is a problem anymore). |
@nbradbury When you clear your display name, it'll actually revert to your username in the server (at least that's what happens to me). This is also the case for Calypso. It feels weird though, I agree with you there. @rickybanister is this intentional, if not should we update this in Calypso as well? |
|
This might be a core WordPress thing—let me ask someone. I'd say for now it's fine that it reverts since that's likely been the case for a very long time. |
dca7407 to
d0fe00b
Compare
|
Just to follow up on the display name showing the username in the Me screen when the display name is empty, I just realized (while I was fixing a different bug) that we're actually doing this in the client side. As far as I can tell the display name can be empty in the db, but we change it to username in the client side for both Calypso & Android app, and most likely in iOS as well. |
MeFragment now listens for the MyProfileDetailsChanged changed event and onResume of the fragment we always update the account details just to make sure.
|
Fixed the |
|
@nbradbury I think the PR is ready for another round of review, hopefully it'll be the last one. Every issue we have discussed should be handled. A few notes:
|
|
This is looking good, @oguzkocer! I think we can deal with lack of connectivity as a separate issue. If you're okay with that, I'm ready to merge 🎉 |
|
Sure thing, thanks a lot for the review @nbradbury! |
|
|
I wanted to open this PR to get some early feedback. @tonyr59h and I were discussing that his "Site Settings" implementation might have some components we can use in "My Profile" as well. I am also not completely sure I have the best approach to a couple things.
The first question I had is about the layout. When we were working on the v1 of Calypsoification of the app with @nbradbury we opted not to use a list view for the Me fragment and I've taken a similar approach. I've used styles extensively here, so the code feels clear to me and there is not much need for a lot of switch statements. Having said that, it looks like "Site Settings" is implemented with list view, so I wanted to check in if I had the best approach for this.
My second question is about the usage of dialogs. I have looked into the
WPAlertDialogFragmentand it doesn't have a builder with an input in it. So for now, I have added the dialog inside theMyProfileActivity. Should I be looking to move that implementation toWPAlertDialogFragmentinstead? Also, note that the current dialog only works for "first name" and I thought I'd pass a tag toshowInputDialogmethod and use aswitchstatement to make it work for all labels. I actually wanted to make it work with some kind of callback mechanism but couldn't really find a way to do that. Would that be possible? If not, I don't think the method would be generic enough to add inside ofWPAlertDialogFragment.For reference, here is the complete design for my profile page: https://cloudup.com/cGvJQYVBE0B
And here are some screenshots from the actual implementation: https://cloudup.com/ciJn7zQjKfx
Anyone can review the PR, I am just ping Maxime to add a name here. Thanks!
Needs review: @maxme