Commit graph

6414 commits

Author SHA1 Message Date
Andy Scherzinger
1a193d765d
Merge pull request #2520 from nextcloud/doNotSortOnGetFolderContent
Do not sort on getFolderContent
2018-05-22 11:40:32 +02:00
Andy Scherzinger
3e08819215
Merge pull request #2544 from nextcloud/whiteBrander
Brander with white primary color
2018-05-22 11:36:59 +02:00
Tobias Kaminsky
6883098a1c
Merge pull request #2599 from nextcloud/2596-previewnavigation-overlap
res:styles: Don't use a translucent navigation bar in the Preview activity
2018-05-22 11:29:13 +02:00
Mario Đanić
e76824a872
Merge pull request #2600 from nextcloud/previewimagefragment-cleanup
Minor cleanup of the PreviewImageFragment
2018-05-22 11:17:49 +02:00
eho
5b68a221e9 datamodel: Don't try to be smarter than the JVM by calling the garbage collector.
Calling System.gc() or Runtime.getRuntime().gc() is a bad idea for a simple reason: there is no way to know exactly what will be done under the hood by the JVM because the behavior will depend on its vendor, version and options:

Will the whole application be frozen during the call?
Is the -XX:DisableExplicitGC option activated?
Will the JVM simply ignore the call?

An application relying on these unpredictable methods is also unpredictable and therefore broken. The task of running the garbage collector should be left exclusively to the JVM.
2018-05-22 11:16:23 +02:00
eho
f0b31af089 ui:preview Removed useless call to System.gc().
Calling System.gc() or Runtime.getRuntime().gc() is a bad idea for a simple reason: there is no way to know exactly what will be done under the hood by the JVM because the behavior will depend on its vendor, version and options.
2018-05-22 11:14:33 +02:00
eho
e7d53a94e5 ui:preview Added final modifiers to applicable declarations. 2018-05-22 11:05:07 +02:00
eho
4ebf83fce6 ui:preview Simplified lambda expressions. 2018-05-22 11:04:13 +02:00
eho
9ecdcdd613 ui:preview Removed unused import. 2018-05-22 11:03:39 +02:00
eho
1896ffe66e ui:preview Removed single-use downloadFile() method. 2018-05-22 11:03:22 +02:00
eho
158451d316 ui:preview Removed unused public method switchToFullScreen() 2018-05-22 10:53:20 +02:00
eho
044b59c2f2 ui:preview Moved full screen toggle code to dedicated method.
Reduces duplicate code.
2018-05-22 10:53:00 +02:00
Mario Đanić
f2039686f4
Merge pull request #2602 from nextcloud/ui-preview-checkerboardrefactor
ui:preview Simplified generateCheckerboardLayeredDrawable()
2018-05-22 10:37:53 +02:00
eho
0ae79863e5 ui:preview Simplified layerDrawable dimension calculation even further. 2018-05-22 10:36:49 +02:00
eho
e61aa30b6f ui:preview Simplified layerDrawable dimension calculation. 2018-05-22 10:30:26 +02:00
Nextcloud bot
4f8669d6d4
[tx-robot] updated from transifex 2018-05-22 00:48:17 +00:00
eho
ab13851438 ui:preview Ensure getActivity() is not null before generating LayerDrawable. 2018-05-21 22:15:33 +02:00
eho
71466768f7 ui:preview Replaced setLayerHeight and setLayerWidth calls with setLayerSize().
Saves a few lines of code. Always a good thing.
2018-05-21 22:14:32 +02:00
AndyScherzinger
637fc68581
reformat layouts due to review 2018-05-21 19:51:50 +02:00
eho
d5d6a6b4fd ui:preview Replaced anonymous types with lambdas. 2018-05-21 19:21:20 +02:00
eho
ea769e3ff7 ui:preview: Removed unused @Override method so that we simply inherit it.
Overriding a method just to call the same method from the super class without performing any other actions is useless and misleading.
2018-05-21 19:20:48 +02:00
eho
fdce4339a9 ui:preview Adjusted access declarations. Follow the principle of least privileged. 2018-05-21 19:19:29 +02:00
eho
a78ab4ba97 ui:preview Removed redundant variable. 2018-05-21 19:18:59 +02:00
eho
572ff50943 res:styles: Don't use a translucent navigation bar.
This causes view elements at the bottom to overlap with the navigation bar which makes it impossible to interact with said elements.
2018-05-21 19:13:21 +02:00
AndyScherzinger
86d60238fe
codacy: organize imports 2018-05-21 12:48:35 +02:00
tobiasKaminsky
77c253f48d
add ripple effect
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
2018-05-21 12:48:35 +02:00
Andy Scherzinger
daee7d101b
Merge pull request #2593 from nextcloud/2583-feature-photoview
Replaced legacy custom ImageView and ViewPager class with PhotoView and stock ViewPager
2018-05-21 12:16:01 +02:00
eho
066936a5f3 ui:preview Use static string constants for mime types.
Duplicating hard coded strings all over the place is generally a bad idea and will lead to typos.
2018-05-21 10:43:43 +02:00
eho
a26f3b6b44 ui:preview Refactored image rendering. Show checkerboard with svg's as well. 2018-05-21 10:40:50 +02:00
eho
2b1cff9172 ui:preview Consolidate checkerboard LayerDrawable generation in dedicated method. 2018-05-20 21:35:22 +02:00
eho
6b7f748690 ui:preview Re-introduce the setImageDrawable call to load downloaded png's into imageView. 2018-05-20 21:21:00 +02:00
eho
d1520e6a5e ui:preview Cleaned up formatting. Extracted layerDrawable bounds setting to separate method. 2018-05-20 20:00:10 +02:00
eho
1ce4c51ed2 ui:preview Use equalsIgnoreCase() for svg mime check. 2018-05-20 19:51:25 +02:00
eho
295bd2f0f1 ui:preview Updated handling of downloaded gif's.
Using a GifDrawable gives us animated gifs.
2018-05-20 19:49:12 +02:00
eho
01cb5ffc67 res:layout Removed commented block of code.
Use git to track legacy code instead of leaving commented code blocks in source.
2018-05-20 19:15:54 +02:00
eho
89655f63c0 res:layout Removed unused namespace declaration. 2018-05-20 19:14:55 +02:00
eho
d89e2178f8 ui:preview remove useless return statement in void method. 2018-05-20 19:13:58 +02:00
eho
88c942584c ui:preview Use lambdas 2018-05-20 19:13:36 +02:00
Nextcloud bot
fbe64ef06a
[tx-robot] updated from transifex 2018-05-20 00:46:51 +00:00
eho
0bc74d79f2 Merge branch '2583-feature-photoview' of github.com:nextcloud/android into 2583-feature-photoview 2018-05-19 18:49:22 +02:00
eho
0231972869 ui:preview Correctly load svg files into PhotoView. 2018-05-19 18:46:55 +02:00
ardevd
d51f1206a3
Merge c52f8e25b3 into 9430466823 2018-05-19 16:23:58 +00:00
eho
c52f8e25b3 ui: Correctly load and display downloaded gif's. 2018-05-19 18:23:49 +02:00
Nextcloud bot
b9023355f8
[tx-robot] updated from transifex 2018-05-19 00:47:14 +00:00
eho
534ae55fd3 ui:preview Replaced TouchImageViewCustom objects with PhotoView equivalents.
- Removed call to setPreviewImageFragment() as this is method no longer exists and doesnt seem to be required.
- Since PhotoView supports gif's out of the box, we should include that mimetype in the relevant if statement.
- Simplified the mime-type check.
2018-05-18 20:26:26 +02:00
eho
9937ac1c7e res: Replaced TouchImageViewCustom widget with PhotoView widget 2018-05-18 20:16:13 +02:00
eho
5998a642ad Removed ImageViewCustom class. Replaced with PhotoView 2018-05-18 20:15:23 +02:00
eho
bc53e48c47 Removde TouchImageViewCustom class.
It's being replaced by PhotoView.
2018-05-18 20:14:25 +02:00
eho
ed405e94e1 ui:preview Updated resetZoom() method to properly reset zoom level on the PhotoView object.
By calling setDisplayMatrix and setSuppMatrix, passing a new Matrix object to them, the original zoom level is restored.
2018-05-18 20:11:56 +02:00
eho
3f1c724f42 ui:preview Replace deprecated setOnPageChangeListener() method with addOnPageChangeListener(). 2018-05-18 20:10:11 +02:00
eho
5147f09d6c ui:preview Replaced ExtendedViewPager references with their ViewPager equivalents. 2018-05-18 20:05:26 +02:00
eho
2e8c395037 res: Replace the custom ExtendedViewPager widget with stock ViewPager. 2018-05-18 20:02:36 +02:00
eho
c9c65ad6bc Removed ortiz.touch.* classes.
They are being replaced by PhotoView and the stock Android View Pager API.
2018-05-18 20:00:04 +02:00
Nextcloud bot
5769ba55fd
[tx-robot] updated from transifex 2018-05-18 00:51:13 +00:00
Nextcloud bot
3ae3052fd4
[tx-robot] updated from transifex 2018-05-17 00:51:37 +00:00
Andy Scherzinger
b11cb72dbc
Merge pull request #2570 from nextcloud/2569-mimetype-contextbug
Verify context before getting file type icon.
2018-05-16 14:26:00 +02:00
Andy Scherzinger
3aa1716d7e
Merge pull request #2582 from nextcloud/accountutils-cleanup
Cleanup of the AccountUtils class.
2018-05-16 14:23:44 +02:00
Andy Scherzinger
e344d28e67
Merge pull request #2579 from nextcloud/activities-cleanup
Housekeeping of Activities Presenter and associated repository classes.
2018-05-16 14:23:05 +02:00
tobiasKaminsky
9467fadc00
Brander with white primary color
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
2018-05-16 11:24:47 +02:00
Nextcloud bot
f8987af4f7
[tx-robot] updated from transifex 2018-05-16 00:47:31 +00:00
Tobias Kaminsky
e2f34e6c0a
Merge pull request #2581 from nextcloud/mainapp-cleanup
Mainapp cleanup
2018-05-15 15:47:16 +02:00
ardevd
8919321eea authentication: Make the anonymous inner class a lambda.
With Java 8, most uses of anonymous inner classes should be replaced by lambdas to highly increase the readability of the source code.
2018-05-15 09:03:38 +02:00
ardevd
e5a1de5e50 authentication: Use single quotes around single character "lastIndexOf" calls.
An indexOf or lastIndexOf call with a single letter String can be made more performant by switching to a call with a char argument.
2018-05-15 09:02:55 +02:00
ardevd
75d10d6afb authentication: Use equalsIgnoreCase() instead of convoluted toLowerCase()
Using toLowerCase() or toUpperCase() to make case insensitive comparisons is inefficient because it requires the creation of temporary, intermediate String objects.

In this case, it also made the fi statement complex and difficult to read.
2018-05-15 09:01:56 +02:00
ardevd
21a4d56a44 authentication: Use a string constant instead of duplicating "select_oc_account" three times.
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
2018-05-15 08:58:39 +02:00
ardevd
27999b5b2c authentication: Added empty private constructor to AccountUtils.
The private constructor hides the implicit public one
2018-05-15 08:55:59 +02:00
ardevd
e2c0ccda6f mainapp: Add @Override annotation to onCreate() 2018-05-15 08:50:15 +02:00
ardevd
13a6adfbc1 mainapp: Removed unused import. 2018-05-15 08:48:42 +02:00
ardevd
5ecbd68667 touchimageview: Variable declaration should be separate.
Declaring multiple variable on one line is difficult to read.
2018-05-15 08:46:32 +02:00
ardevd
3485cbe3fb touchimageview: Removed empty statement.
; has no meaning here.
2018-05-15 08:44:15 +02:00
ardevd
89f985fccb touchimageview: Removed redundant static qualifier.
Nested enum types are implicitly static
2018-05-15 08:43:45 +02:00
Nextcloud bot
3b93315193
[tx-robot] updated from transifex 2018-05-15 00:46:24 +00:00
eho
fcd900021f util: Annotate getFileTypeIcon with Nullable.
If context is null the drawable passed back will be null as well.
2018-05-14 21:50:48 +02:00
ardevd
00badca7b3 ui:activities Fixed license header formatting. 2018-05-14 15:58:20 +02:00
ardevd
d0a4374646 data:activities Declare context before initializing Account object so that we can re-use the context variable. 2018-05-14 15:57:05 +02:00
ardevd
dd16750742 data:activities: Removed hard coded error message for no results.
Reference the file_list_empty_headline_server_search string resource instead using the context passed from MainApp.
2018-05-14 15:56:18 +02:00
ardevd
e80cef5be5 ui:activities ActivitiesPresenter formatting cleanup.
- Fixed indentation and removed redundant newlines.
2018-05-14 15:52:19 +02:00
ardevd
00d94c022b ui:activities Make ActivitiesPresenter package private. 2018-05-14 15:51:20 +02:00
tobiasKaminsky
b5bed7874e
fix again a null context
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
2018-05-14 14:09:53 +02:00
Nextcloud bot
d094946b2d
[tx-robot] updated from transifex 2018-05-14 00:46:08 +00:00
Nextcloud bot
700d3bf7f3
[tx-robot] updated from transifex 2018-05-12 00:45:52 +00:00
ardevd
e705206ca6 utils: Replace deprecated getResources().getDrawable() with ContextCompat.getDrawable()
Resources#getDrawable(int) method was deprecated in Marshmallow in favor of the new, Theme-aware replacement.
2018-05-11 12:06:22 +02:00
ardevd
9aa4c254ed utils: Verify that context is not Null before calling context.getResources(). 2018-05-11 12:03:36 +02:00
Nextcloud bot
0a122b26ad
[tx-robot] updated from transifex 2018-05-11 00:44:29 +00:00
Nextcloud bot
baaecbb2bc
[tx-robot] updated from transifex 2018-05-10 00:49:10 +00:00
Tobias Kaminsky
a2c0ae798a
Merge pull request #2549 from nextcloud/contextNull
Context null -> npe
2018-05-09 16:23:23 +02:00
tobiasKaminsky
c362398591
fix local sorting
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
2018-05-09 15:40:48 +02:00
Andy Scherzinger
c2ac4c4ddd
Merge pull request #2564 from nextcloud/bug-identical-sub-expression
MainApp: Fixed auto upload state check.
2018-05-09 15:10:35 +02:00
ardevd
cf9925249b MainApp: Fixed instant upload check.
The if statement should check whether instant photo uploads or instant video uploads are enabled.
2018-05-09 14:34:43 +02:00
Andy Scherzinger
35b7412bcd
Merge pull request #2565 from nextcloud/bug-authentication-urlnormalization
authentication: Fixed HTTPS prefixed URL normalization.
2018-05-09 14:28:12 +02:00
ardevd
3da9b5f12e authentication: Fixed HTTPS prefixed URL normalization.
I'm assuming here that the if statement is supposed to be checking whether the normalized URL starts with HTTP or HTTPS. The current version seemingly has a typo which this commit fixes.
2018-05-09 13:22:47 +02:00
ardevd
cd0268220e MainApp: Removed identical sub-expression in if statement.
This is almost certainly a mistake. Using the same value on either side of a binary operator makes no sense.
2018-05-09 13:12:22 +02:00
AndyScherzinger
200e5aac07
center tabs 2018-05-09 11:34:04 +02:00
AndyScherzinger
1349c2648c
fix lint issues 2018-05-09 11:34:02 +02:00
AndyScherzinger
e047df0f4a
fix theming/tinting for tab indicator 2018-05-09 11:34:02 +02:00
AndyScherzinger
70a9c9584d
add theming/tinting for sharing headers 2018-05-09 11:34:01 +02:00
AndyScherzinger
dc771a8d67
implemented pull-to-refresh for activities 2018-05-09 11:34:01 +02:00
AndyScherzinger
7c21f46b89
fix empty activities icon 2018-05-09 11:34:00 +02:00
AndyScherzinger
c7d8171be1
fix use of asyncDrawable 2018-05-09 11:33:59 +02:00
AndyScherzinger
27a2041db5
codacy cleanup + fixed javaDoc 2018-05-09 11:33:59 +02:00