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

Activity data dividers #4294

Merged

Conversation

AlexNi245
Copy link
Contributor

@AlexNi245 AlexNi245 commented Aug 4, 2019

@AndyScherzinger @tobiasKaminsky

Resolves #2216

This PR belongs to the ActivitiesAction. The date string is now sticked to the top above the RecylerView, ts has the value of first visible item in the view.

Screenshot_20190804_235239

The data string is now fully generated in the ActivitiesActivity and the ActivityListAdapter now only deals with Activities instead with Objects.
In my opinion it makes sense to change the signature of
ActivitiesContract.showActivities(List<Object> activities, OwnCloudClient client, String nextPageUrl)
to ActivitiesContract.showActivities(List<Activities> activities, OwnCloudClient client, String nextPageUrl) because no type casting is necessary anymore.

Last but not least i added some white space around the headline.

I would appreciate any improvement proposal

@AndyScherzinger AndyScherzinger changed the title #2216 activity data divers design #2216 activity data dividers design Aug 5, 2019
@AndyScherzinger AndyScherzinger changed the title #2216 activity data dividers design Activity data dividers Aug 5, 2019
@AndyScherzinger
Copy link
Member

Hi @AlexNi245,

first of all thank you for this PR, I tested it and it does what the description of the PR is saying but not what the issue #2216 requires, namely "sticky headers" which is a defined UI behavior meaning the actuall headers (kind of like section header) that have been in placce before need to be made "sticky" which means that while scrolling the actual header needs to stick at the top and will be pushed out be the next header when scrolling the list. In contrast while your PR displays the actual header at the top the list now lost all its headers! :(

An examplpe would be https://github.com/bgogetap/StickyHeaders (see readme's animaed gif while this library unfortunately only supports Android v15+ (while Nextcloud supports 14+ so that won't work)

@AlexNi245
Copy link
Contributor Author

Thank you for your feedback @AndyScherzinger. Obviously i got the issue wrong. I will change the behavior of the header like the way it behaves it the example that you mentioned.

@tobiasKaminsky
Copy link
Member

@AlexNi245 thanks for your great PR so far.
If you need any help or have questions, do not hesitate to ask directly here.

@codecov
Copy link

codecov bot commented Aug 7, 2019

Codecov Report

Merging #4294 into master will decrease coverage by 0.53%.
The diff coverage is 0%.

@@             Coverage Diff              @@
##             master    #4294      +/-   ##
============================================
- Coverage     16.61%   16.07%   -0.54%     
  Complexity        1        1              
============================================
  Files           351      341      -10     
  Lines         31397    31145     -252     
  Branches       4446     4422      -24     
============================================
- Hits           5216     5008     -208     
+ Misses        25306    25272      -34     
+ Partials        875      865      -10
Impacted Files Coverage Δ Complexity Δ
...roid/ui/fragment/FileDetailActivitiesFragment.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...loud/android/ui/activities/ActivitiesActivity.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ncloud/android/ui/adapter/ActivityListAdapter.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...roid/ui/adapter/ActivityAndVersionListAdapter.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...d/android/ui/interfaces/ActivityListInterface.java 0% <0%> (ø) 0 <0> (?)
...m/owncloud/android/ui/adapter/AccountListItem.java 0% <0%> (-16.67%) 0% <0%> (ø)
...wncloud/android/ui/adapter/AccountListAdapter.java 0% <0%> (-10.38%) 0% <0%> (ø)
...ud/android/ui/activity/ManageAccountsActivity.java 0% <0%> (-0.55%) 0% <0%> (ø)
...cloud/android/ui/activity/FileDisplayActivity.java 20.51% <0%> (-0.17%) 0% <0%> (ø)
src/main/java/com/owncloud/android/MainApp.java 54.96% <0%> (-0.15%) 0% <0%> (ø)
... and 19 more

@codecov
Copy link

codecov bot commented Aug 7, 2019

Codecov Report

Merging #4294 into master will decrease coverage by 0.09%.
The diff coverage is 0%.

@@             Coverage Diff             @@
##             master    #4294     +/-   ##
===========================================
- Coverage     16.85%   16.76%   -0.1%     
  Complexity        1        1             
===========================================
  Files           357      355      -2     
  Lines         31727    31577    -150     
  Branches       4482     4483      +1     
===========================================
- Hits           5349     5294     -55     
+ Misses        25483    25391     -92     
+ Partials        895      892      -3
Impacted Files Coverage Δ Complexity Δ
...roid/ui/activities/ActivityListItemDecoration.java 0% <0%> (ø) 0 <0> (?)
...loud/android/ui/activities/ActivitiesActivity.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ncloud/android/ui/adapter/ActivityListAdapter.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...n/java/com/nextcloud/client/device/DeviceModule.kt 83.33% <0%> (-2.39%) 0% <0%> (ø)
...ncloud/android/ui/fragment/OCFileListFragment.java 24.73% <0%> (-1.39%) 0% <0%> (ø)
src/main/java/com/owncloud/android/MainApp.java 54.54% <0%> (-1.36%) 0% <0%> (ø)
...in/java/com/owncloud/android/utils/ThemeUtils.java 51.89% <0%> (-1.36%) 0% <0%> (ø)
...ava/com/owncloud/android/ui/EmptyRecyclerView.java 61.76% <0%> (-1.1%) 0% <0%> (ø)
...ain/java/com/nextcloud/client/logger/LoggerImpl.kt 86.36% <0%> (-0.6%) 0% <0%> (ø)
...loud/android/datamodel/ThumbnailsCacheManager.java 35.66% <0%> (-0.56%) 0% <0%> (ø)
... and 22 more

@nextcloud nextcloud deleted a comment Aug 7, 2019
@nextcloud nextcloud deleted a comment Aug 7, 2019
@nextcloud nextcloud deleted a comment Aug 7, 2019
@nextcloud nextcloud deleted a comment Aug 7, 2019
@AndyScherzinger
Copy link
Member

Unfortunately the build is broken due to a compile error

/src/main/java/com/owncloud/android/ui/activities/ActivityHeaderPositioner.java:33: error: ';' expected

@AlexNi245
Copy link
Contributor Author

Yes its still work in progress. I mention you when iam done. Is there a label or something to indicate that there is work in progress?

@tobiasKaminsky
Copy link
Member

tobiasKaminsky commented Aug 8, 2019

Is there a label or something to indicate that there is work in progress?

Label "1. developing".
Once you are ready, you can switch it to "2. to review".

@AndyScherzinger
Copy link
Member

@AlexNi245 can you change the alignment of the header back to their original state as in vertically aligned with the toolbar's title and the activity item text? That be great ❤️

@nextcloud-android-bot
Copy link
Collaborator

@AlexNi245
Copy link
Contributor Author

@AndyScherzinger i reverted the branch to the previous version.I also merged the current master into it and create 3 classes related to the stickyHeaders feature. At the moment they have no affects and the app behaves like the version from the master branch.

do you think it make sense to left the pr open for discussion, or should i open a new one as soon as the feature works correctly ?

@nextcloud nextcloud deleted a comment Aug 8, 2019
@nextcloud nextcloud deleted a comment Aug 8, 2019
@nextcloud nextcloud deleted a comment Aug 8, 2019
@nextcloud nextcloud deleted a comment Aug 8, 2019
@nextcloud nextcloud deleted a comment Aug 8, 2019
@nextcloud nextcloud deleted a comment Aug 8, 2019
@AlexNi245 AlexNi245 closed this Aug 9, 2019
@AlexNi245 AlexNi245 force-pushed the #2216-activity-data-divers-design branch from ae5de2e to f4bb53b Compare August 9, 2019 18:17
@AndyScherzinger
Copy link
Member

Any reason you closed the PR?

@AndyScherzinger
Copy link
Member

@AlexNi245 Sorry I didn't see you question. Both would be fine actually. I kind of depends rather on when you want your work to be visibility, to have discussions and also get feedback from the CI job (code coverage, code analysis etc).
So a new want would be fine I think, I also think opening an PR early on makes sense to other see that you are actively working on the matter so they won't start in parallel (very rare case).

Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
…as created according to the this implementation : https://stackoverflow.com/questions/32949971/how-can-i-make-sticky-headers-in-recyclerview-without-external-lib

Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
…to fix codeacy-bot issues

Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
…odel.Activity;

Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
…coration, which is more generic

Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger AndyScherzinger force-pushed the #2216-activity-data-divers-design branch from a6a8e6c to 9624019 Compare August 20, 2019 14:48
@nextcloud-android-bot
Copy link
Collaborator

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/10524.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@nextcloud-android-bot
Copy link
Collaborator

Codacy

286

Lint

TypemasterPR
Warnings5858
Errors00

SpotBugs (new)

Warning TypeNumber
Bad practice Warnings24
Correctness Warnings69
Internationalization Warnings12
Malicious code vulnerability Warnings4
Multithreaded correctness Warnings9
Performance Warnings110
Security Warnings46
Dodgy code Warnings139
Total413

SpotBugs (master)

Warning TypeNumber
Bad practice Warnings24
Correctness Warnings69
Internationalization Warnings12
Malicious code vulnerability Warnings4
Multithreaded correctness Warnings9
Performance Warnings110
Security Warnings46
Dodgy code Warnings139
Total413

@AndyScherzinger AndyScherzinger merged commit b36067d into nextcloud:master Aug 20, 2019
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.8.0 milestone Aug 20, 2019
@AndyScherzinger
Copy link
Member

Yeah, merged for the upcoming release 🚀

Great work @AlexNi245 🎉 and thanks for taking care of this 🙏

@AlexNi245
Copy link
Contributor Author

That are great news. I'm glad that the feature made it to the upcoming release and it was fun to contribute to nextcloud android. I will search for some new issues at which i can work at.
@AndyScherzinger @tobiasKaminsky thank you for your feedback and see you later :)

@AlexNi245
Copy link
Contributor Author

By the way if you have a good issue in mind please let me know maybe i can take it :)

@AndyScherzinger
Copy link
Member

Always a pleasure to help :)

As for the issues, anything from good first issue is probably fine and easy to implement. Other than that feel free to pick any issue you want to work on, we are around and happy to help 😊

tobiasKaminsky added a commit that referenced this pull request Aug 21, 2019
b36067d Merge pull request #4294 from AlexNi245/#2216-activity-data-divers-design
9624019 activity header has now the same font size as a activity element
fa11565 fixed issue  Avoid reassigning parameters such as 'itemPosition'
5a3db5e replace do while loop in getHeaderPositionForItem with while loop
1dd2a5a change naming of Canvas c to Canvas canvas
f4e964e change class name of ActivityListItemDecoration to StickyHeaderItemDecoration, which is more generic
52a7ffe add license text
6ffa9d0 remove duplicate entry of setContentView
cdd5d38 add getHeaderPositionForItem unit test
0ac5a8b add static import for com.owncloud.android.lib.resources.activities.model.Activity;
4ea9667 unit test for isHeader(int pos)
b61f9e0 format ActivityListAdapter
9012f43 set visibility from ActivityViewHeaderHolder back to protected
7a30070 remove unnecessary TAG field and replace nested if statement with && to fix codeacy-bot issues
a26a895 apply changes to java doc
c41dd38 optimize imports
b4764f7 remove unnecessary files
792a6b9 finish implementation of sticky header implementation. This feature was created according to the this implementation : https://stackoverflow.com/questions/32949971/how-can-i-make-sticky-headers-in-recyclerview-without-external-lib
13e7aff increase height of header element and set backgroundcolor to white
a184345 first implementation of sticky header logic.
cd3d8dc start to implement sticky header behavior
259e106 Merge pull request #4355 from nextcloud/drawer
caf1842 drawer: show only server address
cb7d4a3 revert to old image (#4356)
7e44fec revert to old image
f7c4eec Merge pull request #4345 from nextcloud/push
a3fda5a no need to use owncloudClient
9a023c6 Check if app is excluded from battery optimization (#3589)
527c5db Use conscrypt (#4314)
6014e90 use conscrypt
5373660 Provide a banal 'paste' postmessage implementation. (#4189)
68cebf8 revert DeviceModule back to Kotlin
969ce78 Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
f26095f Merge pull request #4245 from fogninid/fixUploadListComparator
e72a789 show on special vendors "disable power check" in auto upload menu - tint button - change logic when to show battery warning
c8173c3 Use reloading on photo view (#2250)
c38dcf3 Delete temp file on receive external files (#4349)
c155edf Merge pull request #4347 from nextcloud/blacklistThumbnail
a03ff84 daily dev 20190820
@AndyScherzinger
Copy link
Member

@AlexNi245 you could (in case you want to) work on adding a proper amount of whitespace to the bottom of each, last activity list item per group ( to have the proper whitespace per last group item to the next header item :)

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

Successfully merging this pull request may close these issues.

Activity date dividers design
6 participants