Skip to content

Conversation

@AndyScherzinger
Copy link
Member

Resolves: #5030

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(link));
DisplayUtils.startIntentIfAppAvailable(intent, getActivity(), R.string.no_browser_available);
} catch (Throwable throwable) {
Toast.makeText(context, R.string.error_opening_link, Toast.LENGTH_SHORT).show();
Copy link
Member

Choose a reason for hiding this comment

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

I prefer snackbar instead of toast?

Copy link
Member Author

Choose a reason for hiding this comment

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

fine with me, yes. I'll change that

Copy link
Collaborator

Choose a reason for hiding this comment

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

Toast is deprecated in Material Design in favour of Snackbar.

Copy link
Member Author

Choose a reason for hiding this comment

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

Jupp! 👍

@nextcloud nextcloud deleted a comment from tobiasKaminsky Dec 19, 2019
@AndyScherzinger
Copy link
Member Author

@tobiasKaminsky can you please rebase and fix this thing? Your PR #4890 breaks the whole concept here. We only display markdown rendering if it has the right mimetype, which you just killed via your rich-thing PR 😠

@tobiasKaminsky
Copy link
Member

Your PR #4890 breaks the whole concept here.

Idea is to have the same as in office documents or audio/video:
if the file is downloaded, show it locally.
If it is not downloaded, show it online.

I will take care of this.

Other than that your PR is working fine 👍

@AndyScherzinger
Copy link
Member Author

if the file is downloaded, show it locally.
If it is not downloaded, show it online.

That's not the point. Point is your removed/hide the OCFile (I know I can call getFile()) so markdown rendering is always triggered! Markdown should not be triggered for non markdown mimetypes!

Other than that your PR is working fine

Don't know, since we now have TextPreview and TextFilePreview while I haven't checked if both would still do proper markdown rendering and would also just do this in case of markdown present.

@tobiasKaminsky
Copy link
Member

TextPreview and TextFilePreview

TextPreview is an abstract class, which is used by PreviewTextFile and PreviewTextString

I'll take care of it next year.
Just as an hint for me: What happens if I show plain text with Markdown? (we do the same on web with text app).

AndyScherzinger and others added 3 commits January 6, 2020 09:33
Resolves: #5030

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Resolves: #5030

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
@tobiasKaminsky tobiasKaminsky force-pushed the enh/clickableMarkdownLinks branch from 163c258 to 154b9af Compare January 6, 2020 09:10
@nextcloud nextcloud deleted a comment from tobiasKaminsky Jan 6, 2020
@nextcloud nextcloud deleted a comment from ezaquarii Jan 6, 2020
@nextcloud nextcloud deleted a comment from AndyScherzinger Jan 6, 2020
@codecov
Copy link

codecov bot commented Jan 6, 2020

Codecov Report

Merging #5035 into master will increase coverage by <.01%.
The diff coverage is 25%.

@@             Coverage Diff              @@
##             master    #5035      +/-   ##
============================================
+ Coverage      17.7%   17.71%   +<.01%     
  Complexity        3        3              
============================================
  Files           389      389              
  Lines         32893    32901       +8     
  Branches       4627     4627              
============================================
+ Hits           5825     5828       +3     
- Misses        26115    26117       +2     
- Partials        953      956       +3
Impacted Files Coverage Δ Complexity Δ
...java/com/nextcloud/client/di/ComponentsModule.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...ncloud/android/ui/preview/PreviewTextFragment.java 0% <0%> (ø) 0 <0> (ø) ⬇️
.../android/ui/preview/PreviewTextStringFragment.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...cloud/android/ui/activity/FileDisplayActivity.java 20.3% <0%> (+0.31%) 0 <0> (ø) ⬇️
...ud/android/ui/preview/PreviewTextFileFragment.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...owncloud/android/ui/adapter/OCFileListAdapter.java 28.51% <37.83%> (-0.37%) 0 <0> (ø)
...om/owncloud/android/utils/FileSortOrderByName.java 14.28% <0%> (-2.86%) 0% <0%> (ø)
...in/java/com/owncloud/android/utils/ThemeUtils.java 49.41% <0%> (-1.56%) 0% <0%> (ø)
...oud/android/ui/activity/SyncedFoldersActivity.java 25.06% <0%> (-1.26%) 0% <0%> (ø)
.../java/com/owncloud/android/utils/DisplayUtils.java 24.89% <0%> (-0.85%) 0% <0%> (ø)
... and 10 more

@ContributesAndroidInjector abstract PreviewTextFragment previewTextFragment();

@ContributesAndroidInjector
abstract PreviewTextFileFragment previewTextFileFragment();
Copy link
Member Author

Choose a reason for hiding this comment

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

Should be one line

Copy link
Member

Choose a reason for hiding this comment

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

This is due to code formatting of Android Studio.
Not sure, if we want to do this then all the time manually, or stick 100% with code formatting and having line wraps…

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd then say stick with AS code formatting, doing it manually leads to manual work.

Copy link
Member Author

@AndyScherzinger AndyScherzinger left a comment

Choose a reason for hiding this comment

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

Looks good to me

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
@nextcloud nextcloud deleted a comment from AndyScherzinger Jan 6, 2020
@nextcloud nextcloud deleted a comment from tobiasKaminsky Jan 6, 2020
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
@tobiasKaminsky tobiasKaminsky force-pushed the enh/clickableMarkdownLinks branch from 994f432 to 5fce6ca Compare January 6, 2020 11:19
@nextcloud-android-bot
Copy link
Collaborator

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

Issues
======
- Added 1
           

See the complete overview on Codacy

@nextcloud-android-bot
Copy link
Collaborator

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

548

Lint

TypemasterPR
Warnings7474
Errors00

SpotBugs (new)

Warning TypeNumber
Bad practice Warnings26
Correctness Warnings71
Internationalization Warnings13
Malicious code vulnerability Warnings5
Multithreaded correctness Warnings9
Performance Warnings106
Security Warnings44
Dodgy code Warnings139
Total413

SpotBugs (master)

Warning TypeNumber
Bad practice Warnings26
Correctness Warnings71
Internationalization Warnings13
Malicious code vulnerability Warnings5
Multithreaded correctness Warnings9
Performance Warnings106
Security Warnings44
Dodgy code Warnings139
Total413

@tobiasKaminsky tobiasKaminsky merged commit 6e07d18 into master Jan 6, 2020
@delete-merged-branch delete-merged-branch bot deleted the enh/clickableMarkdownLinks branch January 6, 2020 12:03
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.10.0 milestone Jan 6, 2020
tobiasKaminsky added a commit that referenced this pull request Jan 7, 2020
f690417 Merge pull request #5102 from nextcloud/removeNC12
051423c remove support for NC12
d7d1c47 Merge pull request #5031 from nextcloud/ezaquarii/fix-npe-crash-when-storage-manager-is-not-set
9b79b85 Merge pull request #5065 from nextcloud/ezaquarii/fix-crash-when-making-new-ods-file
32ebe69 Merge pull request #5066 from nextcloud/ezaquarii/fix-shared-by-null-glitch
6e07d18 Merge pull request #5035 from nextcloud/enh/clickableMarkdownLinks
5fce6ca Removed unneeded try/catch
a680697 Removed unneeded try/catch
154b9af adjusted to master
a15f724 Make hyperlinks clickable in markdown previews
5f70ea6 Make hyperlinks clickable in markdown previews
cd0f834 [tx-robot] updated from transifex
22ab16e [tx-robot] updated from transifex
80d7d26 [tx-robot] updated from transifex
6d76582 [tx-robot] updated from transifex
167b250 Merge pull request #5085 from nextcloud/dependabot/gradle/junit-junit-4.13
7b6e1b7 [tx-robot] updated from transifex
1c12ca0 Bump junit from 4.12 to 4.13
71f919f [tx-robot] updated from transifex
fc00d7d Merge pull request #5077 from nextcloud/dependabot/gradle/daggerVersion-2.25.4
9a3bf3a Bump daggerVersion from 2.25.3 to 2.25.4
0c3b8fc [tx-robot] updated from transifex
ef84976 Fix "Shared by null" glitch in file details view
3cf3e3b Fix crash when adding new ODS file
2047079 Merge pull request #5060 from nextcloud/dependabot/gradle/io.gitlab.arturbosch.detekt-detekt-gradle-plugin-1.3.0
2882236 Bump detekt-gradle-plugin from 1.2.2 to 1.3.0
3687301 [tx-robot] updated from transifex
f53d637 [tx-robot] updated from transifex
24921f6 [tx-robot] updated from transifex
c30c6c7 daily dev 20191221
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.

Markdown Preview: Make hyperlinks clickable

5 participants