forked from commons-app/apps-android-commons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert dependency inject ("di") package to kotlin (commons-app#5976)
* Convert a batch of easier modules * Convert the NetworkingModule to kotlin * Converted the ApplicationlessInjection to kotlin * Convert CommonsDaggerAppCompatActivity to kotlin * Convert CommonsDaggerContentProvider to kotlin * Convert CommonsDaggerIntentService to kotlin * Convert CommonsDaggerService to kotlin * Convert CommonsDaggerSupportFragment to kotlin * Convert CommonsDaggerBroadcastReceiver to kotlin * Convert CommonsApplicationModule to kotlin * Fix imports and make them consistent
- Loading branch information
Showing
41 changed files
with
1,274 additions
and
1,465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 0 additions & 90 deletions
90
app/src/main/java/fr/free/nrw/commons/di/ActivityBuilderModule.java
This file was deleted.
Oops, something went wrong.
89 changes: 89 additions & 0 deletions
89
app/src/main/java/fr/free/nrw/commons/di/ActivityBuilderModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package fr.free.nrw.commons.di | ||
|
||
import dagger.Module | ||
import dagger.android.ContributesAndroidInjector | ||
import fr.free.nrw.commons.AboutActivity | ||
import fr.free.nrw.commons.LocationPicker.LocationPickerActivity | ||
import fr.free.nrw.commons.WelcomeActivity | ||
import fr.free.nrw.commons.auth.LoginActivity | ||
import fr.free.nrw.commons.auth.SignupActivity | ||
import fr.free.nrw.commons.category.CategoryDetailsActivity | ||
import fr.free.nrw.commons.contributions.MainActivity | ||
import fr.free.nrw.commons.customselector.ui.selector.CustomSelectorActivity | ||
import fr.free.nrw.commons.description.DescriptionEditActivity | ||
import fr.free.nrw.commons.explore.SearchActivity | ||
import fr.free.nrw.commons.explore.depictions.WikidataItemDetailsActivity | ||
import fr.free.nrw.commons.media.ZoomableActivity | ||
import fr.free.nrw.commons.nearby.WikidataFeedback | ||
import fr.free.nrw.commons.notification.NotificationActivity | ||
import fr.free.nrw.commons.profile.ProfileActivity | ||
import fr.free.nrw.commons.review.ReviewActivity | ||
import fr.free.nrw.commons.settings.SettingsActivity | ||
import fr.free.nrw.commons.upload.UploadActivity | ||
import fr.free.nrw.commons.upload.UploadProgressActivity | ||
|
||
/** | ||
* This Class handles the dependency injection (using dagger) | ||
* so, if a developer needs to add a new activity to the commons app | ||
* then that must be mentioned here to inject the dependencies | ||
*/ | ||
@Module | ||
@Suppress("unused") | ||
abstract class ActivityBuilderModule { | ||
@ContributesAndroidInjector | ||
abstract fun bindLoginActivity(): LoginActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindWelcomeActivity(): WelcomeActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindContributionsActivity(): MainActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindCustomSelectorActivity(): CustomSelectorActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindSettingsActivity(): SettingsActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindAboutActivity(): AboutActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindLocationPickerActivity(): LocationPickerActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindSignupActivity(): SignupActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindNotificationActivity(): NotificationActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindUploadActivity(): UploadActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindSearchActivity(): SearchActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindCategoryDetailsActivity(): CategoryDetailsActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindDepictionDetailsActivity(): WikidataItemDetailsActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindAchievementsActivity(): ProfileActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindReviewActivity(): ReviewActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindDescriptionEditActivity(): DescriptionEditActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindZoomableActivity(): ZoomableActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindUploadProgressActivity(): UploadProgressActivity | ||
|
||
@ContributesAndroidInjector | ||
abstract fun bindWikiFeedback(): WikidataFeedback | ||
} |
105 changes: 0 additions & 105 deletions
105
app/src/main/java/fr/free/nrw/commons/di/ApplicationlessInjection.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.