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
/** | |
* Simple helper class which extends a TabLayout to allow us to customize the font of the tab. | |
* https://gist.github.com/tmtrademarked/09926077a406959be15fc8a824a52751 | |
* https://github.com/chrisjenx/Calligraphy/issues/180 | |
*/ | |
public final class FontAwareTabLayout extends TabLayout { | |
private String fontPath; | |
public FontAwareTabLayout(Context context, AttributeSet attrs) { |
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
@Singleton | |
@Component(modules = arrayOf(NetworkModule::class, RepositoryModule::class, SubcomponentModule::class)) | |
interface ApplicationComponent : AndroidInjector<MyApplication> { | |
val userRepository: UserRepository | |
val apiService: ApiService | |
fun browserBuilder(): BrowserSubComponent.Builder | |
} | |
@Module | |
object NetworkModule { |
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
@Singleton | |
@Component(modules = arrayOf(NetworkModule::class, RepositoryModule::class, SubcomponentModule::class)) | |
interface ApplicationComponent : AndroidInjector<MyApplication> { | |
//here we declare that BrowserSubComponent is a subcomponent for ApplicationComponent, | |
//exposing an instance of the builder | |
fun browserBuilder(): BrowserSubComponent.Builder | |
} | |
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
@Singleton | |
@Component(modules = arrayOf(NetworkModule::class, RepositoryModule::class)) | |
interface ApplicationComponent : AndroidInjector<MyApplication> { | |
val userRepository: UserRepository | |
val apiService: ApiService | |
/** | |
* explicitly declare okHttp | |
**/ | |
val okHttp: OkHttp | |
} |
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
@Singleton | |
@Component(modules = arrayOf(NetworkModule::class, RepositoryModule::class)) | |
interface ApplicationComponent : AndroidInjector<MyApplication> { | |
fun networkSubComponentBuilder(): NetworkSubComponent.Builder; | |
fun repositorySubComponentBuilder(): RepositorySubComponent.Builder; | |
} |