Skip to content

Conversation

@ezaquarii
Copy link
Collaborator

@ezaquarii ezaquarii commented Dec 25, 2019

This PR moves some account-related shared logic in BaseActivity into a mix-in.

My intention is to collect various account handling logic there, although it is still in a research phase.

@tobiasKaminsky @AndyScherzinger I tried to bring a test coverage to some acceptable level, but this code is so untestable that the task proven to be counter-productive. This code generally must go anyway.

The session mixin has the original, account-related code moved verbatim, without functional changes, so the mixin should behave indentically to the original and
#5031 (comment) is also accounted for.

@ezaquarii ezaquarii force-pushed the ezaquarii/extract-account-logic-from-base-activity-into-mixin branch from 62185ae to 3148156 Compare January 14, 2020 05:45
@codecov
Copy link

codecov bot commented Jan 14, 2020

Codecov Report

Merging #5064 into master will increase coverage by 2.24%.
The diff coverage is 61.62%.

@@             Coverage Diff              @@
##             master    #5064      +/-   ##
============================================
+ Coverage     17.71%   19.96%   +2.24%     
  Complexity        3        3              
============================================
  Files           392      397       +5     
  Lines         33147    33232      +85     
  Branches       4656     4662       +6     
============================================
+ Hits           5873     6635     +762     
+ Misses        26324    25516     -808     
- Partials        950     1081     +131
Impacted Files Coverage Δ Complexity Δ
.../nextcloud/client/onboarding/FirstRunActivity.java 37.36% <ø> (-0.69%) 0 <0> (ø)
...ud/android/ui/activity/ManageAccountsActivity.java 0.52% <ø> (ø) 0 <0> (ø) ⬇️
...java/com/nextcloud/client/di/ActivityInjector.java 92.3% <ø> (ø) 0 <0> (ø) ⬇️
...cloud/android/ui/activity/FileDisplayActivity.java 24% <ø> (+3.87%) 0 <0> (ø) ⬇️
...main/java/com/nextcloud/client/core/AsyncRunner.kt 0% <ø> (ø) 0 <0> (ø) ⬇️
...m/nextcloud/client/account/UserAccountManager.java 0% <ø> (-33.34%) 0 <0> (ø)
...m/owncloud/android/ui/activity/DrawerActivity.java 45.61% <0%> (+0.59%) 0 <0> (ø) ⬇️
...wncloud/android/ui/adapter/AccountListAdapter.java 12.38% <0%> (ø) 0 <0> (ø) ⬇️
...xtcloud/client/account/UserAccountManagerImpl.java 62.41% <0%> (-0.9%) 0 <0> (ø)
...n/java/com/nextcloud/client/mixins/SessionMixin.kt 54.28% <54.28%> (ø) 0 <0> (?)
... and 58 more

@ezaquarii ezaquarii force-pushed the ezaquarii/extract-account-logic-from-base-activity-into-mixin branch from 3148156 to 75c6622 Compare January 14, 2020 05:52
@ezaquarii ezaquarii force-pushed the ezaquarii/extract-account-logic-from-base-activity-into-mixin branch 4 times, most recently from 5472a0a to 0a56b09 Compare January 29, 2020 06:05
@ezaquarii ezaquarii force-pushed the ezaquarii/extract-account-logic-from-base-activity-into-mixin branch from 0a56b09 to 3d84267 Compare February 3, 2020 20:47
@ezaquarii ezaquarii force-pushed the ezaquarii/extract-account-logic-from-base-activity-into-mixin branch 2 times, most recently from 692ad68 to 51f893f Compare February 3, 2020 22:54
@AndyScherzinger
Copy link
Member

@ezaquarii looks good to me code-wise. 👍
Only thing missing are the license headers in the newly created files.

@ezaquarii
Copy link
Collaborator Author

ezaquarii commented Feb 4, 2020 via email

@ezaquarii ezaquarii force-pushed the ezaquarii/extract-account-logic-from-base-activity-into-mixin branch 3 times, most recently from 6b2f879 to 7b64b1d Compare February 5, 2020 00:14
@tobiasKaminsky
Copy link
Member

Did a smoke test and it works 👍

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
@ezaquarii ezaquarii force-pushed the ezaquarii/extract-account-logic-from-base-activity-into-mixin branch from 7b64b1d to 26f2d52 Compare February 5, 2020 22:09
@nextcloud-android-bot
Copy link
Collaborator

Codacy Here is an overview of what got changed by this pull request:

Complexity decreasing per file
==============================
+ src/main/java/com/owncloud/android/ui/activity/BaseActivity.java  -5
         

See the complete overview on Codacy

@nextcloud-android-bot
Copy link
Collaborator

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/12569.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

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/12570.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

337

Lint

TypemasterPR
Warnings7676
Errors00

SpotBugs (new)

Warning TypeNumber
Bad practice Warnings26
Correctness Warnings71
Internationalization Warnings13
Malicious code vulnerability Warnings5
Multithreaded correctness Warnings9
Performance Warnings79
Security Warnings45
Dodgy code Warnings138
Total386

SpotBugs (master)

Warning TypeNumber
Bad practice Warnings26
Correctness Warnings71
Internationalization Warnings13
Malicious code vulnerability Warnings5
Multithreaded correctness Warnings9
Performance Warnings79
Security Warnings45
Dodgy code Warnings138
Total386

@tobiasKaminsky tobiasKaminsky merged commit 4be18ad into master Feb 10, 2020
@delete-merged-branch delete-merged-branch bot deleted the ezaquarii/extract-account-logic-from-base-activity-into-mixin branch February 10, 2020 11:33
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.11.0 milestone Feb 10, 2020
tobiasKaminsky added a commit that referenced this pull request Feb 11, 2020
92ddf10 Merge remote-tracking branch 'origin/master' into dev
5905b1c Merge pull request #5432 from nextcloud/ezaquarii/migrate-drawer-menu-utils-to-new-user-model
4be18ad Merge pull request #5064 from nextcloud/ezaquarii/extract-account-logic-from-base-activity-into-mixin
619b5d0 Merge pull request #5419 from nextcloud/dependabot/gradle/org.projectlombok-lombok-1.18.12
2d6e73d Merge pull request #5414 from nextcloud/fixContactCrash
1bb04aa also increase annotationProcessor
6048243 Fix crash: Caused by: java.lang.ClassCastException: java.lang.Object[] cannot be cast to java.lang.Void[]
0027df9 [tx-robot] updated from transifex
6dd5d92 Merge pull request #5443 from nextcloud/fixTransifex
b4db9d0 do not break line on transifex
b5fb9c1 Migrate drawer menu utilities to new user model
a906a14 daily dev 20200208
@ezaquarii ezaquarii mentioned this pull request Mar 2, 2020
7 tasks
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.

5 participants