This file contains hidden or 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
| class MainActivity : AppCompatActivity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContent { | |
| MyComposeApplication { | |
| // A surface container using the 'background' color from the theme | |
| Surface(color = MaterialTheme.colors.background) { | |
| Greeting("Android") | |
| } | |
| } |
This file contains hidden or 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
| class MainActivity : AppCompatActivity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContent { MainActivityComposable() } | |
| } | |
| } | |
| @Composable | |
| fun MainActivityComposable() { } |
This file contains hidden or 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
| buildscript { | |
| ... | |
| dependencies { | |
| ... | |
| classpath "com.google.dagger:hilt-android-gradle-plugin:2.28-alpha" | |
| } | |
| } |
This file contains hidden or 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
| @InstallIn(ApplicationComponent::class) | |
| @Module | |
| class NetworkingModule { | |
| @Provides | |
| @Singleton | |
| fun provideAuthInterceptorOkHttpClient(): OkHttpClient { | |
| return OkHttpClient.Builder() | |
| .build() | |
| } |
This file contains hidden or 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 | |
| class MessageRepository @Inject constructor(private val storage: ISharedStorage, | |
| private val networkProvider: Retrofit) { | |
| } |
This file contains hidden or 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
| @ActivityScoped | |
| class MessageViewModel @ViewModelInject constructor | |
| (@ApplicationContext context: Context, | |
| private val repository: MessageRepository) : ViewModel() { | |
| } |
This file contains hidden or 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
| @AndroidEntryPoint | |
| class MessageFragment @Inject constructor() | |
| : Fragment(R.layout.fragment_message), BaseView { | |
| } |
This file contains hidden or 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
| @AndroidEntryPoint | |
| class MessageFragment @Inject constructor() : Fragment(R.layout.fragment_message), BaseView { | |
| private val viewModel: MessageViewModel by viewModels() | |
| } |