Skip to content

Show campaigns on home screen #2108

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

Closed

Conversation

ashishkumar468
Copy link
Collaborator

@ashishkumar468 ashishkumar468 commented Dec 13, 2018

Description (required)
Show ongoing campaigns on home screen

Fixes #78 {Show news about ongoing campaigns/competitions}

What changes did you make and why?

  • Added a ui util class SwipableCardView which passes the onSwipe event to its children
  • NearbyCardView & CampaignView extend SwipableCardView
  • Fetch campaigns in ContributionsFragment
  • Added an option to enable disable campaign in Settings/Preferences

Tests performed (required)

Tested {build variant, ProdDebug} on OnePlus 3T with API level {26}

Screenshots showing what changed (optional - for UI changes)
device-2018-12-13-195711

* Added a ui util class SwipableCardView which passes the onSwipe event to its children
* NearbyCardView & CampaignView extend SwipableCardView
* Fetch campaigns in ContributionsFragment
* Added an option to enable disable campaign in Settings/Preferences
@codecov-io
Copy link

codecov-io commented Dec 13, 2018

Codecov Report

Merging #2108 into 2.9-release will decrease coverage by 0.05%.
The diff coverage is 0.52%.

Impacted file tree graph

@@              Coverage Diff               @@
##           2.9-release   #2108      +/-   ##
==============================================
- Coverage         4.07%   4.02%   -0.06%     
==============================================
  Files              224     230       +6     
  Lines            11337   11509     +172     
  Branches          1049    1059      +10     
==============================================
+ Hits               462     463       +1     
- Misses           10841   11012     +171     
  Partials            34      34
Impacted Files Coverage Δ
...va/fr/free/nrw/commons/campaigns/CampaignView.java 0% <0%> (ø)
...va/fr/free/nrw/commons/utils/SwipableCardView.java 0% <0%> (ø)
...ree/nrw/commons/campaigns/CampaignResponseDTO.java 0% <0%> (ø)
.../fr/free/nrw/commons/campaigns/CampaignConfig.java 0% <0%> (ø)
...w/commons/contributions/ContributionsFragment.java 0% <0%> (ø) ⬆️
...free/nrw/commons/campaigns/CampaignsPresenter.java 0% <0%> (ø)
...n/java/fr/free/nrw/commons/campaigns/Campaign.java 0% <0%> (ø)
.../nrw/commons/nearby/NearbyNoificationCardView.java 0% <0%> (ø) ⬆️
...rw/commons/mwapi/ApacheHttpClientMediaWikiApi.java 3.77% <10%> (+0.11%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 36e077f...6eb0701. Read the comment docs.

@misaochan
Copy link
Member

Thanks @ashishkumar468 . It looks good to me in general, but I think we need to modify the layout slightly to make it look more "in theme" with the Nearby card. :) I suggest adding an icon to the side, setting "Wiki Loves Monuments" to be in line with "National Insurance Academy", and removing the superfluous subtext (no point saying Wiki Loves Monuments Twice). I am not really sure what to do with the date though. We could just say:

1 Sep to
30 Sep

in line with the "1.3 km" perhaps? @neslihanturan what do you think?

@ashishkumar468
Copy link
Collaborator Author

ashishkumar468 commented Dec 13, 2018

@misaochan

and removing the superfluous subtext (no point saying Wiki Loves Monuments Twice)

The first line is the title, the second line is the description(its repeated because that's what we have in the dummy json for now), do you want me to remove the description?

Also, will do the suggested ui changes and it would be great if someone could provide me with an icon similar to nearby.


import com.google.gson.annotations.SerializedName;

public class Campaign {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add Javadocs for all the new classes and methods. :) I guess there isn't really a need to have them for every single getter and setter method in this particular class (since they are fairly self-explanatory), but there should still at least be a Javadoc for the class itself. And the methods in the other classes would need them.

Copy link
Collaborator Author

@ashishkumar468 ashishkumar468 Dec 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I was gonna, have added a lot of classes :P, will do it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

* Update ui for CampaignView
@nicolas-raoul
Copy link
Member

nicolas-raoul commented Dec 13, 2018

How about these icons? (in my order of preference)
https://material.io/tools/icons/?icon=accessibility_new&style=baseline
https://material.io/tools/icons/?icon=directions_walk&style=baseline
https://material.io/tools/icons/?icon=whatshot&style=baseline

The first implies: humans, coming together, cheering, party atmosphere
The second implies: humans, call for action, walking, exercise
The third implies: hot, right now, important, action

@ashishkumar468
Copy link
Collaborator Author

Thanks @nicolas-raoul , My vote is with this one. @misaochan @neslihanturan What do you guys say ?

@misaochan
Copy link
Member

misaochan commented Dec 13, 2018

I vote for the "whatshot" icon :) The first two look more like directions to me personally.

do you want me to remove the description?

Yes, I think we can go without the description for now.

@maskaravivek
Copy link
Member

This PR should be based on master instead of 2.9-release

@ashishkumar468
Copy link
Collaborator Author

This PR should be based on master instead of 2.9-release

Have rasied a new pr for the same

@ashishkumar468 ashishkumar468 deleted the feature/campaigns branch December 14, 2018 07:43
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

Successfully merging this pull request may close these issues.

5 participants