-
Notifications
You must be signed in to change notification settings - Fork 5
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
58634d7
commit 36967e5
Showing
21 changed files
with
189 additions
and
120 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package io.catter2.di; | ||
|
||
public class EmptyModuleException extends RuntimeException { | ||
} |
23 changes: 20 additions & 3 deletions
23
app/src/main/java/io/catter2/di/FavoritesRepoDIModule.java
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,9 +1,26 @@ | ||
package io.catter2.di; | ||
|
||
import android.content.Context; | ||
|
||
import javax.inject.Named; | ||
|
||
import dagger.Module; | ||
import dagger.Provides; | ||
import io.catter2.favorites.FavoritesRepository; | ||
|
||
public interface FavoritesRepoDIModule { | ||
AppDIComponent getAppDIComponent(); | ||
@Module | ||
public class FavoritesRepoDIModule { | ||
@Provides | ||
@UserScope | ||
public FavoritesRepository provideFavoritesRepository( | ||
Context appContext, @Named("UserToken") String userToken) { | ||
throw new EmptyModuleException(); | ||
} | ||
|
||
FavoritesRepository provideFavoritesRepository(); | ||
@Provides | ||
@Named("UserToken") | ||
@UserScope | ||
public String provideUserToken() { | ||
throw new EmptyModuleException(); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/io/catter2/di/RetrofitCatApiDIModule.java
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,10 @@ | ||
package io.catter2.di; | ||
|
||
import io.catter2.cat_api.TheCatAPI; | ||
|
||
public class RetrofitCatApiDIModule extends CachedRetrofitCatApiDIModule { | ||
@Override | ||
public TheCatAPI provideTheCatAPI() { | ||
return super.provideTheCatAPIRetrofit(); | ||
} | ||
} |
16 changes: 6 additions & 10 deletions
16
app/src/main/java/io/catter2/di/SharedPrefFavoritesRepoDIModule.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
package io.catter2.di; | ||
|
||
import javax.inject.Singleton; | ||
|
||
import dagger.Module; | ||
import dagger.Provides; | ||
import io.catter2.cat_api.TheCatAPI; | ||
|
||
public interface TheCatAPIDIModule { | ||
TheCatAPI provideTheCatAPI(); | ||
@Module | ||
public class TheCatAPIDIModule { | ||
@Provides | ||
@Singleton | ||
public TheCatAPI provideTheCatAPI() { | ||
throw new EmptyModuleException(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.catter2.di; | ||
|
||
import javax.inject.Scope; | ||
|
||
@Scope | ||
public @interface UserScope { | ||
} |
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.