Commit graph

106 commits

Author SHA1 Message Date
Dmitry Brant
718c70936d Cherry-pick dbrant's PR from master
Cherry-pick #1906 onto release branch
2018-09-28 01:52:10 +10:00
misaochan
feb26224b4 Revert merge of master into 2.8-release 2018-09-27 01:59:47 +10:00
Vivek Maskara
15f9895336
Merge branch 'master' into 2.8-release 2018-09-07 05:24:53 +05:30
Ashish Kumar
70099a9014 Feature/permissions library (#1855)
* Added permission for Dexter, the runtime permission handling library

* [Preparing fir issue #1773] Added a utility function which would take the user to app settings screen where he could manually give us the required permission

* Added an alert dialog with positive and negative callback [Preparing fir issue #1773]

* Improvements in the way External Storage Permission is handled in MultipleShareActivity[Bug fix #1697]
1. Used dexter to handle the external storage permission
2. Behaviour changes : When user tries to share(uppload) images to commons via MultipleShareActivity, following decision tree is followed
	a. If the app has permission for external storage, normal upload operation is followed
	b. If the app does not has the permission for external storage, dexter is used to ask for the same
	c. If the user gives us the required permission, normal upload flow is proceeded
	d. If the doesnot gives us the required permission a rationale dialog is shown with the appropriate message to let him know why we need the permission
	e. If he presses okay, steps a-c are followed and if he presses cancel, we close the app.
	f. If while asking for permission, the user chooses never ask again, then next time he tries to upload an image via MSA, the rational dialog follows the app setting screen where he could manually give us the required permission and the onActivityResult of same is handled

* Added a Constants class to handle request and result codes from one place and other related constants common to the all app elements

* replaced hardcoded strings ok and cancel in DialogUtil to string resources

* init permission rationale dialog in activities onCreate

* Code formatting, updated access modifiers wherever required, added javadocs for new methods created

* *shifted constants to app class
*Added JavaDocs in PermissionUtils

* removed class REQUEST_CODES from CommonsApplication and instead put the enclosing constants in the App class itself
2018-09-07 02:57:07 +10:00
Josephine Lim
325e0168e3
Set Traceur to only work in DEBUG mode (#1884) 2018-09-07 00:37:47 +10:00
Vivek Maskara
54caad265a Fix logout (#1875) 2018-09-05 18:25:09 +10:00
Dmitry Brant
2884bd934a Remove dependency on Glide, Picasso, SVG, and multidex. (#1859)
* Eliminate the use of Picasso.

This gets rid of the single use of the Picasso library (which was causing
the whole library to be imported and shipped) and replaces it with Glide.
TODO: replace this and the other instance(s) of Glide usage with Fresco,
or vice versa.

* Remove dependency on Glide.

This removes the dependency on Glide, as well as the SVG rendering
library, whose only purpose was to display a single SVG image in the
Notification activity. Unfortunately Android doesn't support SVG natively,
but Echo notifications have icons that are SVG formatted. Rather than
import a bunch of heavy libraries to support this single case of SVG
rendering, we can simply create a few local drawables that correspond to
the different types of notifications, and use them instead.

* Remove multidex!

Multidex is a killer of performance and should be avoided at all costs.

* Remove further unused bits.

* Remove final vestige of multidex.
2018-08-30 14:40:17 +03:00
Yusuke Matsubara
6842420aeb Use NotificationChannel and prevent crash in API 26 (#1835) 2018-08-19 13:19:00 +03:00
Vivek Maskara
11c3772dd0 Add Traceur for getting meaningful RxJava stack traces (#1832) 2018-08-18 02:31:10 +10:00
neslihanturan
d29aa2e2e5 Fix urgent crashes A and E (#1749)
* Create utility class for contribution process

* implement method to save five from given URİ

* Add file utilities for directory checks

* Add ContributionUtils for saving file during upload

* Change method call acordingly with handleImagePicked() method

* Call method to save file temproarily when a photo to upload is chosen from contributions list.

* Call method to save file temproarily when a photo to upload is chosen from nearby list and map

* Arrange method call

* Write a method to save file temporarily during upload process. It will save the file to a internal path and it will be deleted by another method after upload process is done.

* Add a method to save a file to a given path from a content provider Uri

* On openAssetFileDescriptor method, use URi from temporarily saved file, instead of Contributions.getLocalUri which was Uri from content provider

* Edit uploadContribution method so that it will use FileInputStream from temporarily saved file, insdeat of the Uri from content provider.

* Make it work

* Code cleanup

* Add directory cleaner method

* Call temp directory cleaner method at the end of uplpoad process

* Use FileInputStream insted

* Add directory cleaner method

* Add file removal method

* Use external directory instead

* Make destination file name flexible

* Make it work with share action coming from another activity

* Make it work for Multiple hare Activity

* Code cleanup

* Solve camera issue

* Fix camera crash

* Cleanup

* Revert change of commenting out posibly useles code, because I am not sure if it is useless or not. Requires discussion

* Use timestamp in temoorary file names, so that we wont never create same file and access old file reference. It was a weird problem though

* Code cleanup

* Add nullable annotation to handleImagePicked method uri parameter

* Add Nullable anotation to method

* Code cleanup

* Bugfix: use uri.getPath() instead uri.toString

* Remove unecesarry file saving operation, which was added accidentally

* Fix travis fail

* Remove temp file if upload gets failed and file is still there

* Code cleanup:Remove unused parameters from removeTempFile method

* Empty temp directory on app create, in case some of files are still there

* Add null check to array to prevent NPE on first run

* Fix multiple uploads bug

* Remove file if upload is succeed

* Add external storage utility methods

* Check external file permission before saving files temporarily

* finish activity if permission is not granted

* Add log lines

* Remove files even if user decides to go back without sharing

* Add easy null check

* Change storage permission settings in singe upload fragment too

* Finish app if permission is not granted

* Code optimisation

* Remove temp file if upload process never is finalised on activity stop

* Bugfix maybe contribution is never created

* Fix travis build
2018-08-02 06:24:08 +10:00
dlsrks1021
e8b2dd7163 remove unused imports (#1606) 2018-06-21 07:28:27 +09:00
misaochan
a9ae072c73 Merge remote-tracking branch 'refs/remotes/commons-app/master' into upload-overhaul-fork
# Conflicts:
#	app/src/main/java/fr/free/nrw/commons/upload/ShareActivity.java
2018-06-05 18:28:41 +10:00
maskara
edaa0dd05a Fix build 2018-06-01 01:15:28 +05:30
misaochan
104cb5f1d7 Change references to upload.FileUtils 2018-05-25 22:50:22 +10:00
misaochan
41673c0067 Unify FileUtils.java, misleading to have 2 of it in different packages 2018-05-25 22:48:47 +10:00
Josephine Lim
a5060053fa Change email address for logs to private mailing list (#1404)
* Change email address for logs to private mailing list

* Include version placeholder

* Add comments
2018-04-02 13:17:59 +03:00
neslihanturan
07133e02e3
Merge pull request #1194 from harisankerPradeep/Bug#1004
Fixes Bug#1004 : Black background on details and categories screen
2018-03-16 11:44:45 +02:00
neslihanturan
bc87ad5d51
Merge pull request #1237 from knight-shade/Fixes-#1225
Fixes #1225 bug causing multidex
2018-03-07 20:32:07 +02:00
knightshade
d7e0c81969 Add multidex library and extend CommonsApplication from MultiDexApplication.
Fixes #1225
2018-03-02 10:28:28 +05:30
Steinsplitter
daf13935d1
fixing upload summary
Adding link to local description page:
(Upload log) !; 15:02 . . Malabarge (talk | contribs | block) uploaded File:Spiegelung 3.jpg ‎(Uploaded using Android Commons app) (Tags: Mobile app edit, Mobile edit)

Using the same edit summary as for edits made using the app, e.g.
(diff | hist) . . ! File:Lul.jpg‎; 14:48 . . (-20)‎ . . ‎Codedoper (talk | contribs | block)‎ (Added 1 categories. Removed template Uncategorized. Via Commons Mobile App) (Tags: Mobile app edit, Mobile edit)
2018-02-26 16:52:55 +01:00
harisankerPradeep
31008e5dc1 Partially fixes Bug#1004 2018-02-25 00:18:07 +05:30
Shradheya Thakre
9dd01b9170 Improve code quality 2018-02-14 14:16:41 +08:00
maskara
e1afa6081e Refactor usage of dagger application with fixed dagger application 2018-01-13 16:16:47 +05:30
Paul Hawke
f2ed57a127 Moved Category and CategoryDao to the 'category' package 2018-01-05 08:34:48 -06:00
Paul Hawke
08673c91c6 Extracted and tested the database interactions from ModifierSequence 2018-01-04 13:27:55 -06:00
Paul Hawke
1ba8e93346 Extracted and tested the database interactions from Category 2018-01-04 08:33:40 -06:00
neslihanturan
d6d38e0564
Merge pull request #1026 from psh/extract-and-test-contribution-db
Extracted and tested the database interactions from Contribution.
2018-01-02 13:58:10 +03:00
Paul Hawke
7c80991049 Extracted and tested the database interactions from Contribution. 2017-12-21 13:56:36 -06:00
Prajeen Govardhanam
1d94b8a87c
Update CommonsApplication.java 2017-12-21 20:54:37 +05:30
Prajeen Govardhanam
8f32fc1c01
Update CommonsApplication.java 2017-12-21 20:47:17 +05:30
prajgov
3d6c6e0301 added JavaDoc comments 2017-12-19 19:11:39 +05:30
neslihanturan
32bca87305
Merge pull request #1000 from misaochan/fix-send-logs-again
Send logs only to private Google group forum (round 2)
2017-12-15 14:39:41 +03:00
Dmitry Brant
da82466a17 Take out legacy event logging from app.
These are especially old bits of code, where it seems like WMF folks had set up Eventlogging schemas for some rudimentary analytics of the Commons app. These schemas are no longer queried or monitored, and can be safely removed. When the Commons app has a stronger need for more meaningful analytics, we can revisit reintroducing new and better schemas.
2017-12-05 23:01:55 -05:00
misaochan
824569a031 Modify group that logs get sent to 2017-12-06 01:20:24 +10:00
maskara
db8cae95e4 Fix Fresco initialization 2017-12-04 02:33:36 +05:30
Paul Hawke
02b5b9b680 Merge branch 'master' into dependency-injection 2017-11-24 22:30:08 -06:00
misaochan
785bed90ba Send log file to private Google group forum instead 2017-11-22 01:16:36 +10:00
maskara
6a6ba7d542 Fix Leak canary test 2017-11-13 23:16:27 +05:30
maskara
d4bafd94e0 Fixes leaks in contribution and nearby activity 2017-11-13 23:15:53 +05:30
maskara
6a7b7cbbe8 Introduce dagger 2017-11-12 01:04:10 +05:30
Yusuke Matsubara
e317c369c1 Disable LeakCanary for Robolectric tests
See 'For Robolectric users:' https://github.com/square/leakcanary
2017-11-03 11:30:10 +09:00
Paul Hawke
f134d23ecb Merge branch 'master' into dependency-injection 2017-10-21 17:20:56 -05:00
Sergey Kozelko
43af519a16 Fix Codacy issues 2017-10-18 21:57:57 +03:00
poojithakr
fc9cd0a3b7 Fixing codacy issues. Reduced reported count from 550 to 518. 2017-10-04 00:28:11 -07:00
Paul Hawke
9aa021695b @Injected shared preferences where needed 2017-09-27 21:30:41 -05:00
Paul Hawke
e33febf506 Merge branch 'master' into dependency-injection 2017-09-23 14:24:34 -05:00
Paul Hawke
2d91e81121 Merge branch 'master' into dependency-injection 2017-09-13 20:29:50 -05:00
Paul Hawke
d4fd6f8b77 Merge branch 'master' into lint-cleanup 2017-09-13 19:16:55 -05:00
neslihanturan
ffc7c80678 Merge pull request #857 from psh/beta-cluster
Product flavors for production and the beta-cluster Wikimedia servers
2017-09-13 10:57:31 +03:00
Paul Hawke
9c0cbe7ad5 Further reduce code calling back to the CommonsApplication by pulling out a SessionManager to manage our current account. 2017-09-09 14:08:40 -05:00