dhis2 / dhis2-android-dashboard

:no_entry: [DEPRECATED] Android application for DHIS2 which implements basic dashboard functionality.
BSD 3-Clause "New" or "Revised" License
17 stars 47 forks source link

Added Edit User Profile Activity #32

Closed krishnarb3 closed 8 years ago

krishnarb3 commented 8 years ago

9 These are the changes I have made, please report if there are any bugs /changes to be made :

api

AndroidManifest.xml Added ACCES_NETWORK_STATE permission DhisController Added setUserProfileDetails function which takes credentials and userAccount as argument and calls updateProfileDetails function in Usercontroller Usercontroller Added updateProfileDetails function which gets a userAccount as Argument and creates a json object as body and placeholder settings and calls postUserAccount function in DhisApi class DhisApi Added route for POST request to /me/user-account DateTimeManager Changed commit() to apply() for better perfomance app AndroidManifest.xml Added EditUserProfileActivity EditUserProfileActivity Uses Recycler View for getting input from user through AccountEditFieldAdapter Network and Loader states Handled in the activity getUserAccountFromFields function : switch statement to change "Male" to "gender_male" for POST request etc. AccountEditFieldAdapter 3 types of view : Edittext, Spinner (for gender) , TextView (which pops up a DatePicker Dialog) 3 different ViewHolder classes for each type onBindViewHolder Edittext : Email Validation , textChangeListener Spinner : Spinner item selection and display Gender DatePicker : DatePicker dialog and listener for selecting date and converting to string and vice-versa AccountFragment Added Floating action button for opening EditUserProfileActivity FontSpinner Added new FontSpinner class for selecting gender DhisService Added editProfileDetails function for calling setUserProfileDetails from DhisController

layout Added EditUserProfileActivity layout Added FloatingActionButton to fragment_account Added Layouts for Recycler View adapter for different viewTypes

arazabishov commented 8 years ago

@krishnarb3 Great job and thank you for contribution.

Unfortunately I cannot merge this pull-request because some of the implementation details do not conform to the project's codebase. However, if you have time to modify it, we could discuss details through email.

Thanks.

krishnarb3 commented 8 years ago

I will be very delighted if you could discuss about the implementation details , Currently I am working on using POJO instead of ObjectNode and changing it to fragment instead of activity as you had mentioned. Can you elaborate on creating a model for settings i.e. From where I can get the data required to make the settings object for the api call Regards, R B Krishna

On Tue, Mar 15, 2016 at 8:20 PM, Araz Abishov notifications@github.com wrote:

@krishnarb3 https://github.com/krishnarb3 Great job and thank you for contribution.

Unfortunately I cannot merge this pull-request because some of the implementation details do not conform to the project's codebase. However, if you have time to modify it, we could discuss details through email.

Thanks.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub:

https://github.com/dhis2/dhis2-android-dashboard/pull/32#issuecomment-196853264

arazabishov commented 8 years ago

Thanks for fast reply.

1) It could be a lot better to use fragment instead of activity for editing profile. 2) Please, do not implement user settings (like locale switching). Instead, focus on user profile information.

krishnarb3 commented 8 years ago

So is placeholder settings json (as it is right now ) fine for the api call ?

On Tue, Mar 15, 2016 at 9:07 PM, Araz Abishov notifications@github.com wrote:

Thanks for fast reply.

1) It could be a lot better to use fragment instead of activity for editing profile. 2) Please, do not implement user settings (like locale switching). Instead, focus on user profile information.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub:

https://github.com/dhis2/dhis2-android-dashboard/pull/32#issuecomment-196883981

arazabishov commented 8 years ago

No, we don't want to support user settings at this point.

krishnarb3 commented 8 years ago

Cool , I will change it to fragment instead of activity and use POJO instead of jsonNode. Thanks, R B Krishna

No, we don't want to support user settings at this point.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/dhis2/dhis2-android-dashboard/pull/32#issuecomment-196887989