-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e10af47
commit c3fa1aa
Showing
23 changed files
with
426 additions
and
66 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
39 changes: 39 additions & 0 deletions
39
app/src/main/java/de/lukasneugebauer/nextcloudcookbook/di/TagModule.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,39 @@ | ||
package de.lukasneugebauer.nextcloudcookbook.di | ||
|
||
import com.dropbox.android.external.store4.Fetcher | ||
import com.dropbox.android.external.store4.Store | ||
import com.dropbox.android.external.store4.StoreBuilder | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import de.lukasneugebauer.nextcloudcookbook.tag.data.dto.TagDto | ||
import de.lukasneugebauer.nextcloudcookbook.tag.data.repository.TagRepositoryImpl | ||
import de.lukasneugebauer.nextcloudcookbook.tag.domain.repository.TagRepository | ||
import javax.inject.Singleton | ||
|
||
typealias TagsStore = Store<Any, List<TagDto>> | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object TagModule { | ||
|
||
@Provides | ||
@Singleton | ||
fun provideTagsStore(apiProvider: ApiProvider): TagsStore { | ||
return StoreBuilder | ||
.from( | ||
fetcher = Fetcher.of { | ||
apiProvider.getNcCookbookApi()?.getTags() | ||
?: throw NullPointerException("Nextcloud Cookbook API is null.") | ||
}, | ||
) | ||
.build() | ||
} | ||
|
||
@Provides | ||
@Singleton | ||
fun provideTagRepository( | ||
tagsStore: TagsStore, | ||
): TagRepository = TagRepositoryImpl(tagsStore) | ||
} |
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
6 changes: 6 additions & 0 deletions
6
...rc/main/java/de/lukasneugebauer/nextcloudcookbook/recipe/domain/model/RecipeListFilter.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,6 @@ | ||
package de.lukasneugebauer.nextcloudcookbook.recipe.domain.model | ||
|
||
enum class RecipeListFilter { | ||
CATEGORY, | ||
TAG, | ||
} |
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
Oops, something went wrong.