Skip to content

Conversation

@ezaquarii
Copy link
Collaborator

@ezaquarii ezaquarii commented Aug 11, 2019

  • added log search in logs browser
  • added logs browser view model test
  • added universal async filtering utility
  • refactored async runner and added manual runner
  • migrated logs browser to Android DataBinding and Kotlin
  • disabled imports ordering Ktlint rule as IDE does not
    support ktlint ordering
  • added some missing tests around logger

Closes #4311

Signed-off-by: Chris Narkiewicz hello@ezaquarii.com

@ezaquarii
Copy link
Collaborator Author

@tobiasKaminsky @AndyScherzinger This is a follow-up on #4275 with discussed UI improvements.

@ezaquarii ezaquarii force-pushed the ezaquarii/logs-search branch 2 times, most recently from 12ec2b5 to 59f770a Compare August 11, 2019 12:21
@ezaquarii ezaquarii force-pushed the ezaquarii/logs-search branch from 59f770a to 0b77175 Compare August 11, 2019 12:25
@AndyScherzinger
Copy link
Member

@ezaquarii I haven't had a chance to test it yet, first review looks good code-wise. Did you take care of themeing (search icon / search view)? If not @tobiasKaminsky might be able to help :)

@ezaquarii ezaquarii force-pushed the ezaquarii/logs-search branch 3 times, most recently from 15677ea to 3c1c8be Compare August 11, 2019 15:36
@codecov
Copy link

codecov bot commented Aug 11, 2019

Codecov Report

Merging #4309 into master will increase coverage by 0.19%.
The diff coverage is 62.74%.

@@             Coverage Diff              @@
##             master    #4309      +/-   ##
============================================
+ Coverage     16.63%   16.83%   +0.19%     
  Complexity        1        1              
============================================
  Files           351      354       +3     
  Lines         31408    31498      +90     
  Branches       4446     4471      +25     
============================================
+ Hits           5225     5302      +77     
  Misses        25308    25308              
- Partials        875      888      +13
Impacted Files Coverage Δ Complexity Δ
...java/com/nextcloud/client/di/ComponentsModule.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...owncloud/android/ui/activity/SettingsActivity.java 38.44% <ø> (ø) 0 <0> (ø) ⬇️
...c/main/java/com/nextcloud/client/di/AppModule.java 72.72% <0%> (ø) 0 <0> (ø) ⬇️
...in/java/com/owncloud/android/utils/ThemeUtils.java 51.89% <0%> (-0.67%) 0 <0> (ø)
...ava/com/nextcloud/client/logger/ui/LogsActivity.kt 0% <0%> (ø) 0 <0> (?)
...java/com/nextcloud/client/logger/ui/LogsAdapter.kt 0% <0%> (ø) 0 <0> (ø) ⬇️
...java/com/nextcloud/client/logger/FileLogHandler.kt 92.45% <100%> (+0.45%) 0 <0> (ø) ⬇️
src/main/java/com/nextcloud/client/core/Task.kt 100% <100%> (ø) 0 <0> (?)
...com/nextcloud/client/core/ThreadPoolAsyncRunner.kt 100% <100%> (ø) 0 <0> (?)
...va/com/nextcloud/client/logger/ui/LogsViewModel.kt 60.78% <67.44%> (+60.78%) 0 <0> (ø) ⬇️
... and 10 more

@codecov
Copy link

codecov bot commented Aug 11, 2019

Codecov Report

Merging #4309 into master will increase coverage by 0.19%.
The diff coverage is 62.33%.

@@             Coverage Diff             @@
##             master   #4309      +/-   ##
===========================================
+ Coverage      16.6%   16.8%   +0.19%     
  Complexity        1       1              
===========================================
  Files           351     354       +3     
  Lines         31410   31499      +89     
  Branches       4447    4472      +25     
===========================================
+ Hits           5215    5292      +77     
+ Misses        25317   25316       -1     
- Partials        878     891      +13
Impacted Files Coverage Δ Complexity Δ
...java/com/nextcloud/client/di/ComponentsModule.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...owncloud/android/ui/activity/SettingsActivity.java 38.44% <ø> (ø) 0 <0> (ø) ⬇️
...c/main/java/com/nextcloud/client/di/AppModule.java 72.72% <0%> (ø) 0 <0> (ø) ⬇️
...ava/com/nextcloud/client/logger/ui/LogsActivity.kt 0% <0%> (ø) 0 <0> (?)
...in/java/com/owncloud/android/utils/ThemeUtils.java 51.89% <0%> (-0.67%) 0 <0> (ø)
...java/com/nextcloud/client/logger/ui/LogsAdapter.kt 0% <0%> (ø) 0 <0> (ø) ⬇️
src/main/java/com/nextcloud/client/core/Task.kt 100% <100%> (ø) 0 <0> (?)
...com/nextcloud/client/core/ThreadPoolAsyncRunner.kt 100% <100%> (ø) 0 <0> (?)
...java/com/nextcloud/client/logger/FileLogHandler.kt 92.45% <100%> (+0.45%) 0 <0> (ø) ⬇️
...va/com/nextcloud/client/logger/ui/LogsViewModel.kt 60.78% <67.44%> (+60.78%) 0 <0> (ø) ⬇️
... and 17 more

@ezaquarii ezaquarii force-pushed the ezaquarii/logs-search branch from 3c1c8be to daccd56 Compare August 11, 2019 15:48
@ezaquarii ezaquarii force-pushed the ezaquarii/logs-search branch 2 times, most recently from 3c13da0 to 8dbb0d2 Compare August 11, 2019 16:19
@nextcloud-android-bot
Copy link
Collaborator

@ezaquarii
Copy link
Collaborator Author

@AndyScherzinger @tobiasKaminsky I tried to copy the solution from ExtendedListFragment.onCreateOptionsMenu but the search view won't budge - it's still dimmed. I'm not sure how the theming is done there, but it looks like it depends on some hidden state set elsewhere.

@ezaquarii ezaquarii force-pushed the ezaquarii/logs-search branch from 3e62bea to 2b143e8 Compare August 12, 2019 14:32
@nextcloud-android-bot
Copy link
Collaborator

@AndyScherzinger
Copy link
Member

AndyScherzinger commented Aug 12, 2019

@tobiasKaminsky can you provide @ezaquarii with the infos for search bar theming (which you already implemented elsewhere in the app)? :)

@tobiasKaminsky
Copy link
Member

Regarding translation strings:
Please do not rename keys that are already in use, otherwise they will conflict with older version (we translate master and 1-2 older versions within the same transifex repository)
Just create a new string, even when it is with the same content. It causes overhead to the translation team, but this way we are bulletproof.

As transifex is using only values/strings.xml as source, we do not need to change the translated files. In best case they will be overwritten by next transifex update, and in worst case they result in a conflict.
Modifying only values/strings.xml makes review also a bit easier.

After that I am happy to review it (currently my browser refuses a bit to show that many changes…)

I will add both to our contributing.md

@tobiasKaminsky
Copy link
Member

@AndyScherzinger @tobiasKaminsky I tried to copy the solution from ExtendedListFragment.onCreateOptionsMenu but the search view won't budge - it's still dimmed. I'm not sure how the theming is done there, but it looks like it depends on some hidden state set elsewhere.

@tobiasKaminsky can you provide @ezaquarii with the infos for search bar theming (which you already implement4ed elsewhere in the app)? :)

Sorry, I do not get the term "budge". What is wrong?
At a quick test, only three dots are tinted wrong on a light theme?
(not sure if this is even a problem with this PR, I doubt so…)

2019-08-13-083909 2019-08-13-083827
2019-08-13-083818

@AndyScherzinger
Copy link
Member

@tobiasKaminsky - could you test if it works with (very) light Background and dark text/icons? Else it seems fine (except for the 3-dot icon)

@tobiasKaminsky
Copy link
Member

I reverted translation files and rebased.
I'll review & test it today and then let's merge it.

After that I'll have a look again at the tinting problematic, as I think that the ThemeUtils.themeSearchView() is not working and thus it might be changed also in other places.

Copy link
Member

@tobiasKaminsky tobiasKaminsky left a comment

Choose a reason for hiding this comment

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

Only minor changes.

* added log search in logs browser
* added logs browser view model test
* added universal async filtering utility
* refactored async runner and added manual runner
* migrated logs browser to Android DataBinding and Kotlin
* disabled imports ordering Ktlint rule as IDE does not
  support ktlint ordering
* added some missing tests around logger

Closes #4311

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
@ezaquarii ezaquarii force-pushed the ezaquarii/logs-search branch from c6d14b8 to c35873f Compare August 14, 2019 19:21
drone and others added 2 commits August 14, 2019 20:38
@nextcloud-android-bot
Copy link
Collaborator

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

276

Lint

TypemasterPR
Warnings5958
Errors00

SpotBugs (new)

Warning TypeNumber
Bad practice Warnings24
Correctness Warnings69
Internationalization Warnings12
Malicious code vulnerability Warnings4
Multithreaded correctness Warnings9
Performance Warnings111
Security Warnings46
Dodgy code Warnings135
Total410

SpotBugs (master)

Warning TypeNumber
Bad practice Warnings24
Correctness Warnings69
Internationalization Warnings12
Malicious code vulnerability Warnings4
Multithreaded correctness Warnings9
Performance Warnings111
Security Warnings46
Dodgy code Warnings135
Total410

@AndyScherzinger AndyScherzinger merged commit 1d17b35 into master Aug 14, 2019
@delete-merged-branch delete-merged-branch bot deleted the ezaquarii/logs-search branch August 14, 2019 21:03
@AndyScherzinger
Copy link
Member

Ready, steady, merge 🌟

@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.8.0 milestone Aug 14, 2019
tobiasKaminsky added a commit that referenced this pull request Aug 15, 2019
1d17b35 Merge pull request #4309 from nextcloud/ezaquarii/logs-search
725ffc4 Drone: update Lint results to reflect reduced error/warning count [skip ci]
92e2234 Merge commit 'c35873f5dcb77bf9a33111c1fee2d25584f6a22d'
c35873f Log search functionality and log browser refactoring
496f101 Merge pull request #4324 from nextcloud/translate
ceb3999 Extract strings to be translatable
e48a874 Merge pull request #4322 from nextcloud/contributingLicense
05dcedb add licene sample
c6abcd2 [tx-robot] updated from transifex
d6eb9de daily dev 20190813
AlexNi245 pushed a commit to AlexNi245/android that referenced this pull request Aug 19, 2019
1d17b35 Merge pull request nextcloud#4309 from nextcloud/ezaquarii/logs-search
725ffc4 Drone: update Lint results to reflect reduced error/warning count [skip ci]
92e2234 Merge commit 'c35873f5dcb77bf9a33111c1fee2d25584f6a22d'
c35873f Log search functionality and log browser refactoring
496f101 Merge pull request nextcloud#4324 from nextcloud/translate
ceb3999 Extract strings to be translatable
e48a874 Merge pull request nextcloud#4322 from nextcloud/contributingLicense
05dcedb add licene sample
c6abcd2 [tx-robot] updated from transifex
d6eb9de daily dev 20190813

Signed-off-by: alex <alex.plutta@googlemail.com>
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.

Log: do not quit view after reset

5 participants