Skip to content

[WIP] Explore nearby pictures #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open

Conversation

neslihanturan
Copy link
Owner

Description (required)

Fixes #INSERT_ISSUE_NUMBER_HERE

What changes did you make and why?

Tests performed (required)

Tested {build variant, e.g. ProdDebug} on {name of device or emulator} with API level {API level}.

Screenshots (for UI changes only)

Need help? See https://support.google.com/android/answer/9075928


Note: Please ensure that you have read CONTRIBUTING.md if this is your first pull request.

class ExploreMapMediaPresenterIml @Inject constructor(
@Named(CommonsApplicationModule.MAIN_THREAD) mainThreadScheduler: Scheduler,
dataSourceFactory: ExploreMapMediaDataSource,
isFromSearchActivity: Boolean

Choose a reason for hiding this comment

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

This dependency isn't defined so the dagger does not know how to inject it here.

class ExploreMapMediaDataSource @Inject constructor(
liveDataConverter: LiveDataConverter,
private val mediaClient: MediaClient,
val isFromSearchActivity: Boolean

Choose a reason for hiding this comment

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

This dependency isn't defined so the dagger does not know how to inject it here.

override val loadFunction: LoadFunction<Media> = { loadSize: Int, startPosition: Int ->
//TODO: change this method
// TODO: filter this result by location or display all of them on map
if (isFromSearchActivity) {

Choose a reason for hiding this comment

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

I am not sure what the objective is here but you can create a setter for isFromSearchActivity and set it manually when needed.

explorePlace.location.getLatitude(),
explorePlace.location.getLongitude()));
nearbyBaseMarker.place(explorePlace);
/* Help needed, Madhur another point that would be nice to have help is here where I want to create marker icons from thumbnails of places.

Choose a reason for hiding this comment

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

I think you can do something like this

Glide.with(context)
                    .asBitmap()
                    .load(explorePlace.thumb)
                    .into(new CustomTarget<Bitmap>() {
                        @Override
                        public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
                            nearbyBaseMarker.setIcon(IconFactory.getInstance(context).fromBitmap(resource));
                        }

                        @Override
                        public void onLoadCleared(@Nullable Drawable placeholder) {
                        }
                    });

Choose a reason for hiding this comment

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

Ah I see you already tried this, not sure why it isn't working, can you confirm if onResourceReady is called?

@codecov-commenter
Copy link

codecov-commenter commented Mar 13, 2022

Codecov Report

Merging #11 (df15e30) into master (9431e37) will decrease coverage by 1.52%.
The diff coverage is 21.95%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #11      +/-   ##
============================================
- Coverage     50.56%   49.04%   -1.53%     
- Complexity     2225     2259      +34     
============================================
  Files           338      351      +13     
  Lines         15546    16302     +756     
  Branches       1359     1433      +74     
============================================
+ Hits           7861     7995     +134     
- Misses         7101     7703     +602     
- Partials        584      604      +20     
Impacted Files Coverage Δ
...java/fr/free/nrw/commons/explore/ExplorePlace.java 0.00% <0.00%> (ø)
...fr/free/nrw/commons/explore/ExplorePlacesInfo.java 0.00% <0.00%> (ø)
...ee/nrw/commons/explore/map/ExploreMapContract.java 0.00% <0.00%> (ø)
...w/commons/explore/map/ExploreMapMediaDataSource.kt 0.00% <0.00%> (ø)
.../nrw/commons/explore/paging/BasePagingPresenter.kt 100.00% <ø> (ø)
...a/fr/free/nrw/commons/nearby/NearbyController.java 92.30% <ø> (-0.08%) ⬇️
...rc/main/java/fr/free/nrw/commons/nearby/Place.java 25.74% <0.00%> (-3.15%) ⬇️
...commons/nearby/fragments/NearbyParentFragment.java 15.36% <0.00%> (ø)
.../main/java/fr/free/nrw/commons/utils/MapUtils.java 0.00% <0.00%> (ø)
...c/main/java/fr/free/nrw/commons/utils/UiUtils.java 18.75% <0.00%> (-11.25%) ⬇️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9431e37...df15e30. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants