Commit graph

2156 commits

Author SHA1 Message Date
Anmol Gupta
34a016d49d
Change item background according to the theme (#3480)
* Change item  background according to the theme

* Change background colour of item on being selected

* Change background colors using XML selectors
2020-03-16 10:13:20 +00:00
Kshitij Bhardwaj
668b5896a2
Chek if getContext() is instanceOf CategoryImagesCallback and only then request more images 2020-03-14 15:00:33 +05:30
Kaartic Sivaraam
a78e167676
Revert stopgaps related to beta server cert issue (#3396)
* Revert stopgaps related to beta server cert issue

The upstream issue with Commons beta server has been
fixed now[1]. So, there's no point in stopgapping
the issue anymore. So, revert the related changes.

This reverts fa87eb5661
and df426f7c42 which
correspond to PRs #3350 and #3349 respectively.

[1]: https://phabricator.wikimedia.org/T243881#5861983

* Test-fix: fix the failing CI test
2020-03-13 14:58:43 +00:00
Seán Mac Gillicuddy
4bd7a5b1e2
#3493 App freezes for 15 seconds when you press Next in UploadMediaDetailsFragment (#3499)
* #3493 App freezes for 15 seconds when you press Next in UploadMediaDetailsFragment - add apropriate schedulers and convert justs to fromCallable

* #3493 App freezes for 15 seconds when you press Next in UploadMediaDetailsFragment - remove test for removed functionality

* #3493 App freezes for 15 seconds when you press Next in UploadMediaDetailsFragment - replace kotlin with java
2020-03-13 23:47:20 +10:00
Madhur Gupta
d925e32d2f
Added AboutActivityTest (#3475)
* Added AboutActivityTest

* Changes made as per suggestions

* Removed File to resolve conflict

* Removed hardcoded packagename

* Changes as per suggestion

* Removed Unrelated changes

* Fixed Build Issues
2020-03-11 15:02:30 -07:00
taakanksha
61a3f45512
openStreetMap attribution enabled (#3485) 2020-03-11 09:51:38 +00:00
Ashish Kumar
99c6f5f105
Shift contributions to use Room DB (#3324)
* Part of #3127
* Added Room Dependency
* Shifted ContributionsDao to use RoomDB

* Save and Fetch contributions via RoomDAO

* Bugfixes, fixed test cases, injected schedulers for ContributionsPresenter

* removed stetho

* Fixed ReviewHelperTest cases

* Fixed test cases in DeleteHelperTest

* Fetch all contributions [TODO add pagination to use this, maybe later in a seperate PR]

* Update Schema false in AppDatabase

* removed parameter from fetchControbutions

* Added logs for fetch contributions

* Fixed test case ContributionsPresenter

* Added an autogenerate primary key, submit save contributions on executor

* fixed getItemAtPosition

* MainActivity Config changes +=orientation

* BugFixes
* Make AppDataBase Singleton
* Set _id as autogenerate primary key [replacing the previously used filename, seems like they are not unique]
* Replace Execxutor Utils with Subscribers on Singles in UploadService
* BugFix, Upload Progress

* Remove un-nescessary null check on contributions in ContributionsListAdapter

* removed ContributionsListFragment [not-implemeted]

* Review suggested changes
* removed un-nescessary null checks
* provide ContributionsDao
* Minor bug fixes

* wip

* delete existing contributions table (from the existing db) on upgrade

* remove un-nescessary null checks in test classes

* shifted media to be a local variable in ReviewHelperTest

* removed captured folder

* Dispose composite disposables in UploadService

* replaced size check with isEmpty ContributionsPresenter

* transform saveContributions to a Completable

* Addressed comments in review
* Typo in Contributions
* ReasonBuilderTest (create media object instead of mocking)
* Use global Gson object instead of creating a new one in Converters

* Provide Gson to Converters from the CommonsApplicationComponent

* use static method instead of field instead of static field to provide GSON in Converters

* Modified gitignore to exclude captures/*
2020-03-10 00:13:20 +03:00
Kshitij Bhardwaj
642ed51c8c
Fixes #3414: For v2.13, Handle zoom in media details view (#3422)
* MediaDetailFragment: add zoom feature

* fragment_media_detail: add SimpleDrawee for Scroll picture

* ZoomableActivity: activity which facilitates zoom in

* activity_zoomable: xml for zoom activity

* zoomControllers: controllers for handling gesture and zooming

* MediaDetailFragment: fixing name of image variable

* MediaDetailFragment: display as per the aspect ratio of image

* add zoom activity to AndroidManifest

* fix travis ci faliure

* fix resizing of image
2020-03-09 21:07:48 +03:00
Kshitij Bhardwaj
7450b44ab7
Fixes #3295: Ultimate achievement: Too many contributions (#3378) 2020-03-08 17:09:38 +00:00
Seán Mac Gillicuddy
1584ffe0e2
Added Support for System Wide Dark Theme (#3460)
* Added Support for System Wide Dark Theme

* changed methods to private

* Moved Strings to strings.xml

* Used Dagger to reduce code repetition

* Changes made as per review suggestions

* Minor Changes

* Fixes as per suggestions

* Minor Fixes as per suggestion

* made the variables static

* removed irrelevant code
2020-03-05 14:33:57 +00:00
Kaartic Sivaraam
48b6745349
Open external links in same activity (#3395)
It's common for users to expect that re-opening the app would
allow them to "continue where they left off". This also applies
for the case where they leave the app after opening an
external link. It's natural for them to expect that they would
see the webpage they left open when they re-open the app. This
doesn't happen for our app as we open custom tabs in a separate
activity. As a consequence, this makes the experience
un-intuitive.

Fix this by opening custom tabs in the same activity.

Fixes: #2944

Co-authored-by: Adam Jones <jones_adam@rocketmail.com>
2020-03-02 19:59:26 +10:00
Madhur Gupta
e68751f0b9
Moved some Java files to kotlin (#3439)
* Converted NetworkConnectionType.java to Kotlin

* Converted Urls.java to Kotlin and Updated AboutActivity

* Improved code quality
2020-03-01 16:13:08 -07:00
Aristos Pasalidis
78057b6a8a
Fix #3091: Remove odd code in CategoryImagesListFragment (#3133) 2020-03-01 15:30:58 +00:00
Aryan Tyagi
fffff62f5c
Fixed a type in NearbyParentFragment.java where significantly was written instead of slightly while adding a log using Timber (#3432) 2020-02-25 13:56:50 +02:00
Madhur Gupta
3d0048a771
Added progress dialog for setting wallpaper (#3427)
* Added progress dialog for setting wallpaper

* Updated dialog strings
2020-02-23 16:51:15 -07:00
Yash Khare
39cb190571
Fix #3416 Add snackbar on clicking add/remove from bookmarks (#3419) 2020-02-21 20:01:28 +10:00
Kshitij Bhardwaj
96f4a5c08f
Fixes #3355 : Do not display pins at all when "Needs Photo" is selected (#3407)
* ic_custom_greyed_out_marker: removing grey marker

* NearbyParentFragment: changing function name and description

* change method name to hideAllMarkers
2020-02-19 20:43:19 +02:00
Aastha Bist
4038519012
code-quality: remove CDATA and <u> tags from string.xml (#3310)
Remove CDATA and <u> tags from string resources. Instead use setUnderlinedText() method added in Utils to create underlined string resources.
2020-02-17 00:34:46 -07:00
Kaartic Sivaraam
6683ea40ec
Don't show the quiz pop-up twice (#3398)
* Avoid showing the quiz pop-up twice to the user

Due to the current flow of code it's possible that in
some cases the quiz pop-up is shown to the user twice.
This is unnecessary and unintentional.

So, change the logic in such a way that the quiz pop-up
would be never be shown twice to the user.

Fixes: #3281

* Quiz: remove unused parameters from methods

Some methods don't seem to be using the parameters that
they receive. So, just remove the unused parameters.
2020-02-11 11:28:07 -07:00
Yash Khare
b65e4a1841
Fix #3191 Make the username along with the rewards icon clickable in the Navigation Drawer (#3401) 2020-02-11 19:27:54 +02:00
Kaartic Sivaraam
e387e9a8d3
Hide Review for logged out users (#3390)
It makes sense to not show the review activity for logged
out users for the same reasons that we don't allow users
to upload images.

We're even considering to limit the review activity to users
with a particular level of achievement[1]. So, it's valid to
not show review activity for logged out users who don't
have achievements levels at all.

[1]: https://github.com/commons-app/apps-android-commons/issues/2852
2020-02-10 04:41:33 +10:00
Ashish Kumar
fdbe53d1e5
Fixes #3371 (#3372)
* Is UserBrowsing should first check if last known location is non-null before checkig if last location and current locations are close
2020-02-05 01:00:57 +10:00
Ashish Kumar
05e98307be
Fixes #3303 (#3322)
* Fixes #3303
* Refactor Nearby to alig lifecycle methods

* Pass updated place list to listfragment

* Added default zoom rate to mapbox

* Removed NearbyListFragmet and added the ui login to handle the same in NearbyParentFragment

* More code refactor
* Make BottomSheetList hideable
* onFragmentHide, hide the bottom sheets

* BigFix, Fragmet visibility, register/un-register camera move based on fragments lifecycke

* More code refactor
* Let the ExecutorUtil have non-ui thread
* Add Location Marker on non-ui thread (the non-ui stuffs)

* BugFixes
* Removed configchanges "orientation" from MainActivity in Manifest (That was messing with the fragment lifecycle)
* Some null checks
* Initialise lastknown location in onMapReady

* UI Fixes
* Adjusted UI to support dark and no-dark themes both (in nearby)
* Do not update map on Location Slightly changed

* Fix failing test case, let TestCommonsApplication extend Application instead of CommonsApplication

* start map view when nearby is visible

* start the map when NearbyFragmet is visible

* More bugfixes
* Added DUMMY view for NearbyPresenter's onDetach State
* Added a wrapper frame layout parent for MapView to preven it from drawing above other views

* More bugfixes (Fixes #3287)
* Gray out the un-selected markers from the nearby filter list

* BugFix, search this area should search the nearby places for the current camera position

* More BugFixes
* Handle null primitives with proxy
* Current location marker flow via permission flow

* onCameraMove should have null-check on NearbyController.latestSearchLocation instead of currentLocation

* Search for places around last focus location

* Handle location updates
* If the user is browsing the map, donot update the map with current location
2020-02-04 11:05:29 +02:00
animeshk08
bfb6dfdeaf
Fix: Issue #3367 Bug: SoftKeyboard showing even after switching from nearby tab to contribution tab (#3368)
Hide keyboard when switched back from NearbyFragment to ContributionsListFragment
2020-02-03 01:54:00 +05:30
Josephine Lim
0068820ac2 Merge branch '2.12-release' 2020-01-30 02:31:59 +10:00
Vivek Maskara
2290545bc9
Suggest and auto fill title and description based on image location (#3323)
* Suggest and auto fill title and description based on image location

* with java docs
2020-01-29 13:24:37 +03:00
Kshitij Bhardwaj
afdeaae075
Fixes: #3179 Make category search non case-sensitive (#3326)
* CategoryClient: fix category search case-sensitivity by converting to lower case as MW api is inherently case-sensitive, the results obtained will be same

* CategoryItem: reverting javadoc changes

* CategoriesModel: make category search case-insensitive

* CategoryItem: fix whitespaces

* Add tests for case-insensitivity

* CategoryClientTest: add more test cases

* CategoryClientTest: fix travis ci test

* CategoriesModelTest: changes mage to CategoriesModel and tested
2020-01-28 20:38:07 -07:00
Kshitij Bhardwaj
0affe71745 Fixes: #3278: Add java docs to methods which have it missing (#3351)
* achievements/: add Javadocs

* actions/: add Javadocs

* WikiAccountAuthenticator: add Javadocs

* ReasonBuilder: add Javadocs

* di: Add javadocs to DI files

* bookmarks: add Javadocs to bookmarks files

* di: Added more Javadocs

* file: add Javadocs for file picker

* actions: add proper decription to the classes
2020-01-28 11:45:15 -07:00
Somanshu
d235e5a85b Fixes #3327: Trim whitespaces from title on upload (#3348)
Trim WhiteSpaces from Image-Title while upload
2020-01-28 10:15:09 +05:30
Ashish Kumar
721d2feb45 Fixes #3336 Hotfix: Coordinates of picture are not uploaded (#3339)
* Fixes #3336
 * Donot redact locatio by default

* Correction inn default tag save

* Use same key across application for managedExifTags

* Updated key name to avoid class cast in existing build
2020-01-27 15:48:11 +03:00
Ashish Kumar
fa87eb5661 Fixes #3345 (#3350)
* Fixes #3345
* Trust all hosts for beta
* Added a custom NetworkFetcger for Fresco when on beta

* removed unused assets

* make TestCommonsApplication extend Application instead of Commons Application
2020-01-26 22:13:18 -07:00
Ashish Kumar
df426f7c42 Fixes #3320 (#3349)
* Fixes #3320
* Added SSL certificate for commons beta
* Asked OKHTTP client to use SSLContext from beta certificate
* Probable Fix of #3345

* Use ConfigUtils to verify flavor
2020-01-26 12:31:14 -07:00
Josephine Lim
0fb8f97b50 Merge branch 'master' of https://github.com/commons-app/apps-android-commons 2020-01-22 22:57:10 +10:00
Josephine Lim
095d047370 Merge branch '2.12-release' 2020-01-22 22:57:02 +10:00
Ashish Kumar
bae3fa8bbf Fixes #3335 (#3337)
Handled sqlitexception for adding existig column in app versions which already have COLUMN location_pic
2020-01-22 03:22:35 +10:00
Malcolm Smith
14ea6c0cba Change tempalte character case from EXIF to Exif (#3330) 2020-01-20 12:42:49 -07:00
Kshitij Bhardwaj
cd4fc2cdf0 CategoryItem: add javadocs to the file (#3332) 2020-01-20 12:39:31 -07:00
Josephine Lim
ef9e2986b2 Versioning and changelog for v2.12.1 2020-01-20 00:21:24 +10:00
Ashish Kumar
824d6ac05e Bugfix/null revision in review (#3309)
* Fixes #3305
 * Handle null firstRevision

* initialise explanation
2019-12-24 14:02:56 +05:30
Vivek Maskara
a8ee5bd201 Fix UI tests (#3297) 2019-12-17 14:24:41 +03:00
Josephine Lim
e23b80dfcd Merge branch '2.12-release' 2019-12-10 23:52:22 +10:00
neslihanturan
959b3afd4c Fixes #3231 "Nearby" always first puts me in Punta Arenas (#3271)
* Update tables from 10 to 11

* Remove unneeded changes
2019-12-10 23:47:10 +10:00
Vivek Maskara
b0be4970ef Convert few model classes to kotlin (#3270) 2019-12-07 02:36:53 +10:00
Manuel Alcaraz
f7cca31c53 Optimize imports (#3272) 2019-12-06 17:51:36 +09:00
Vivek Maskara
2f9a71911a Remove unused code from the app (#3276) 2019-12-05 18:07:21 +05:30
Ashish Kumar
bb0a21929e Added unit-tests for CacheController (#3275) 2019-12-05 16:33:55 +05:30
Vivek Maskara
f27749fa51 With more unit test cases (#3269) 2019-12-04 18:51:02 +10:00
Ashish Kumar
fa7deb3d34 Closes #3262, npe in touching edit text drawable area while uploading images (#3263) 2019-12-03 17:44:56 +10:00
Ashish Kumar
1359f706d9 Closes #3264, disable options menu for null media from provider (#3265) 2019-12-03 17:44:48 +10:00
Ashish Kumar
452f799cb3 Fixes #3260, handle null latlng when adding current location marker (#3261) 2019-12-03 17:44:31 +10:00