-
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.
Showing
240 changed files
with
3,017 additions
and
669 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
29 changes: 29 additions & 0 deletions
29
app/src/main/java/com/melonhead/mangadexfollower/AppNavigationMap.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,29 @@ | ||
package com.melonhead.mangadexfollower | ||
|
||
import com.melonhead.feature_authentication.navigation.LoginScreenResolver | ||
import com.melonhead.feature_native_chapter_viewer.NativeChapterViewerActivityResolver | ||
import com.melonhead.feature_webview_chapter_viewer.WebViewChapterViewerActivityResolver | ||
import com.melonhead.lib_navigation.keys.ActivityKey | ||
import com.melonhead.lib_navigation.keys.ScreenKey | ||
import com.melonhead.lib_navigation.resolvers.ResolverMap | ||
import com.melonhead.mangadexfollower.navigation.MainActivityResolver | ||
|
||
class AppNavigationMap( | ||
resolverMap: ResolverMap, | ||
|
||
mainActivityResolver: MainActivityResolver, | ||
nativeChapterViewerActivityResolver: NativeChapterViewerActivityResolver, | ||
webViewActivityResolver: WebViewChapterViewerActivityResolver, | ||
|
||
loginScreenResolver: LoginScreenResolver, | ||
) { | ||
init { | ||
// activities | ||
resolverMap.registerResolver(ActivityKey.WebViewActivity::class.java, webViewActivityResolver) | ||
resolverMap.registerResolver(ActivityKey.ChapterActivity::class.java, nativeChapterViewerActivityResolver) | ||
resolverMap.registerResolver(ActivityKey.MainActivity::class.java, mainActivityResolver) | ||
|
||
// screens | ||
resolverMap.registerResolver(ScreenKey.LoginScreen::class.java, loginScreenResolver) | ||
} | ||
} |
61 changes: 18 additions & 43 deletions
61
app/src/main/java/com/melonhead/mangadexfollower/di/AppModule.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 |
---|---|---|
@@ -1,56 +1,31 @@ | ||
package com.melonhead.mangadexfollower.di | ||
|
||
import com.melonhead.mangadexfollower.repositories.AuthRepository | ||
import com.melonhead.mangadexfollower.repositories.MangaRepository | ||
import com.melonhead.mangadexfollower.services.* | ||
import com.melonhead.mangadexfollower.ui.viewmodels.ChapterViewModel | ||
import com.melonhead.data_app_data.di.AppDataServiceModule | ||
import com.melonhead.feature_authentication.di.FeatureAuthenticationModule | ||
import com.melonhead.feature_native_chapter_viewer.di.FeatureNativeChapterViewerModule | ||
import com.melonhead.feature_webview_chapter_viewer.di.FeatureWebViewChapterViewerModule | ||
import com.melonhead.lib_app_events.di.LibAppEventsModule | ||
import com.melonhead.lib_navigation.di.LibNavigationModule | ||
import com.melonhead.mangadexfollower.AppNavigationMap | ||
import com.melonhead.mangadexfollower.navigation.MainActivityResolver | ||
import com.melonhead.mangadexfollower.ui.viewmodels.MainViewModel | ||
import com.melonhead.mangadexfollower.ui.viewmodels.WebViewViewModel | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Dispatchers | ||
import org.koin.androidx.viewmodel.dsl.viewModel | ||
import org.koin.dsl.module | ||
|
||
val appModule = module { | ||
single<AppDataService> { | ||
AppDataServiceImpl(get(), get()) | ||
} | ||
val AppModule = module { | ||
includes(LibAppEventsModule) | ||
includes(LibNavigationModule) | ||
|
||
single<LoginService> { | ||
LoginServiceImpl(get()) | ||
} | ||
includes(AppDataServiceModule) | ||
|
||
single<UserService> { | ||
UserServiceImpl(get()) | ||
} | ||
|
||
single<MangaService> { | ||
MangaServiceImpl(get()) | ||
} | ||
|
||
single<AtHomeService> { | ||
AtHomeServiceImpl(get()) | ||
} | ||
|
||
factory { CoroutineScope(Dispatchers.IO) } | ||
|
||
single { | ||
MangaRepository(get(), get(), get(), get(), get(), get(), get(), get(), get()) | ||
} | ||
|
||
single(createdAtStart = true) { | ||
AuthRepository(get(), get(), get(), get(), get()) | ||
} | ||
|
||
viewModel { | ||
MainViewModel(get(), get(), get()) | ||
} | ||
includes(FeatureAuthenticationModule) | ||
includes(FeatureNativeChapterViewerModule) | ||
includes(FeatureWebViewChapterViewerModule) | ||
|
||
viewModel { | ||
WebViewViewModel(get()) | ||
MainViewModel(get(), get(), get(), get(), get()) | ||
} | ||
|
||
viewModel { | ||
ChapterViewModel(get(), get()) | ||
} | ||
single(createdAtStart = true) { MainActivityResolver() } | ||
single(createdAtStart = true) { AppNavigationMap(get(), get(), get(), get(), get()) } | ||
} |
6 changes: 0 additions & 6 deletions
6
app/src/main/java/com/melonhead/mangadexfollower/extensions/LiveDataExtensions.kt
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
app/src/main/java/com/melonhead/mangadexfollower/models/auth/AuthRequest.kt
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
app/src/main/java/com/melonhead/mangadexfollower/models/auth/AuthToken.kt
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
app/src/main/java/com/melonhead/mangadexfollower/models/auth/CheckTokenResponse.kt
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
app/src/main/java/com/melonhead/mangadexfollower/models/auth/RefreshTokenRequest.kt
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
app/src/main/java/com/melonhead/mangadexfollower/models/content/CoverAttributes.kt
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
app/src/main/java/com/melonhead/mangadexfollower/models/content/Manga.kt
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
app/src/main/java/com/melonhead/mangadexfollower/models/content/MangaReadMarkersResponse.kt
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
app/src/main/java/com/melonhead/mangadexfollower/navigation/MainActivityResolver.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,13 @@ | ||
package com.melonhead.mangadexfollower.navigation | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import com.melonhead.lib_navigation.keys.ActivityKey | ||
import com.melonhead.lib_navigation.resolvers.ActivityResolver | ||
import com.melonhead.mangadexfollower.ui.scenes.MainActivity | ||
|
||
class MainActivityResolver: ActivityResolver<ActivityKey.MainActivity> { | ||
override fun intentForKey(context: Context, key: ActivityKey.MainActivity): Intent { | ||
return Intent(context, MainActivity::class.java) | ||
} | ||
} |
Oops, something went wrong.