mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-11-01 07:13:56 +01:00
Integrate notifications API
This commit is contained in:
parent
d78c7befbd
commit
28a6a3b71d
32 changed files with 1013 additions and 58 deletions
|
|
@ -13,6 +13,7 @@ import dagger.Binds;
|
|||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import fr.free.nrw.commons.BuildConfig;
|
||||
import fr.free.nrw.commons.CommonsApplication;
|
||||
import fr.free.nrw.commons.auth.AccountUtil;
|
||||
import fr.free.nrw.commons.auth.SessionManager;
|
||||
import fr.free.nrw.commons.caching.CacheController;
|
||||
|
|
@ -21,6 +22,7 @@ import fr.free.nrw.commons.location.LocationServiceManager;
|
|||
import fr.free.nrw.commons.mwapi.ApacheHttpClientMediaWikiApi;
|
||||
import fr.free.nrw.commons.mwapi.MediaWikiApi;
|
||||
import fr.free.nrw.commons.nearby.NearbyPlaces;
|
||||
import fr.free.nrw.commons.notification.NotificationClient;
|
||||
import fr.free.nrw.commons.upload.UploadController;
|
||||
|
||||
import static android.content.Context.MODE_PRIVATE;
|
||||
|
|
@ -31,7 +33,9 @@ import static fr.free.nrw.commons.modifications.ModificationsContentProvider.MOD
|
|||
@SuppressWarnings({"WeakerAccess", "unused"})
|
||||
public class CommonsApplicationModule {
|
||||
public static final String CATEGORY_AUTHORITY = "fr.free.nrw.commons.categories.contentprovider";
|
||||
public static final long OK_HTTP_CACHE_SIZE = 10 * 1024 * 1024;
|
||||
|
||||
private CommonsApplication application;
|
||||
private Context applicationContext;
|
||||
|
||||
public CommonsApplicationModule(Context applicationContext) {
|
||||
|
|
@ -100,8 +104,8 @@ public class CommonsApplicationModule {
|
|||
|
||||
@Provides
|
||||
@Singleton
|
||||
public MediaWikiApi provideMediaWikiApi() {
|
||||
return new ApacheHttpClientMediaWikiApi(BuildConfig.WIKIMEDIA_API_HOST);
|
||||
public MediaWikiApi provideMediaWikiApi(Context context) {
|
||||
return new ApacheHttpClientMediaWikiApi(context, BuildConfig.WIKIMEDIA_API_HOST);
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
|
@ -133,4 +137,10 @@ public class CommonsApplicationModule {
|
|||
public LruCache<String, String> provideLruCache() {
|
||||
return new LruCache<>(1024);
|
||||
}
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
public NotificationClient provideNotificationClient() {
|
||||
return new NotificationClient(BuildConfig.COMMONS_BASE_URL);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue