mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 21:33:53 +01:00
@Inject the MediaWikiApi where needed to reduce coupling between classes.
This commit is contained in:
parent
ed1ae98d8e
commit
647cc166ef
16 changed files with 85 additions and 82 deletions
|
|
@ -34,6 +34,7 @@ import fr.free.nrw.commons.MediaWikiImageView;
|
|||
import fr.free.nrw.commons.PageTitle;
|
||||
import fr.free.nrw.commons.R;
|
||||
import fr.free.nrw.commons.location.LatLng;
|
||||
import fr.free.nrw.commons.mwapi.MediaWikiApi;
|
||||
import fr.free.nrw.commons.ui.widget.CompatTextView;
|
||||
import timber.log.Timber;
|
||||
|
||||
|
|
@ -57,8 +58,7 @@ public class MediaDetailFragment extends DaggerFragment {
|
|||
return mf;
|
||||
}
|
||||
|
||||
@Inject CommonsApplication application;
|
||||
|
||||
@Inject MediaWikiApi mwApi;
|
||||
private MediaWikiImageView image;
|
||||
private MediaDetailSpacer spacer;
|
||||
private int initialListTop = 0;
|
||||
|
|
@ -194,7 +194,7 @@ public class MediaDetailFragment extends DaggerFragment {
|
|||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
extractor = new MediaDataExtractor(media.getFilename(), licenseList, application.getMWApi());
|
||||
extractor = new MediaDataExtractor(media.getFilename(), licenseList, mwApi);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ import fr.free.nrw.commons.R;
|
|||
import fr.free.nrw.commons.contributions.Contribution;
|
||||
import fr.free.nrw.commons.contributions.ContributionsActivity;
|
||||
import fr.free.nrw.commons.mwapi.EventLog;
|
||||
import fr.free.nrw.commons.mwapi.MediaWikiApi;
|
||||
|
||||
public class MediaDetailPagerFragment extends DaggerFragment implements ViewPager.OnPageChangeListener {
|
||||
|
||||
|
|
@ -52,6 +53,7 @@ public class MediaDetailPagerFragment extends DaggerFragment implements ViewPage
|
|||
}
|
||||
|
||||
@Inject CommonsApplication application;
|
||||
@Inject MediaWikiApi mwApi;
|
||||
|
||||
private ViewPager pager;
|
||||
private Boolean editable;
|
||||
|
|
@ -134,7 +136,7 @@ public class MediaDetailPagerFragment extends DaggerFragment implements ViewPage
|
|||
switch(item.getItemId()) {
|
||||
case R.id.menu_share_current_image:
|
||||
// Share - this is just logs it, intent set in onCreateOptionsMenu, around line 252
|
||||
EventLog.schema(CommonsApplication.EVENT_SHARE_ATTEMPT, application)
|
||||
EventLog.schema(CommonsApplication.EVENT_SHARE_ATTEMPT, application, mwApi)
|
||||
.param("username", application.getCurrentAccount().name)
|
||||
.param("filename", m.getFilename())
|
||||
.log();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue