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
import android.content.ComponentName | |
import android.content.Intent | |
import android.os.Bundle | |
import androidx.annotation.StyleRes | |
import androidx.core.util.Preconditions | |
import androidx.fragment.app.Fragment | |
import androidx.fragment.app.FragmentFactory | |
import androidx.fragment.app.testing.FragmentScenario.EmptyFragmentActivity | |
import androidx.test.core.app.ActivityScenario | |
import androidx.test.core.app.ApplicationProvider |
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
<?xml version="1.0" encoding="utf-8"?> | |
<ScrollView | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
> |
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
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import dagger.Module | |
import dagger.Provides | |
import dagger.hilt.InstallIn | |
import dagger.hilt.android.AndroidEntryPoint | |
import dagger.hilt.android.components.ApplicationComponent | |
import javax.inject.Inject | |
import javax.inject.Qualifier | |
import javax.inject.Singleton |
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
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import androidx.fragment.app.Fragment | |
import com.google.gson.Gson | |
import dagger.Binds | |
import dagger.Module | |
import dagger.hilt.InstallIn | |
import dagger.hilt.android.AndroidEntryPoint | |
import dagger.hilt.android.components.ApplicationComponent | |
import javax.inject.Inject |
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
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import androidx.fragment.app.Fragment | |
import dagger.hilt.android.AndroidEntryPoint | |
import javax.inject.Inject | |
@AndroidEntryPoint | |
class MainActivity : AppCompatActivity() { | |
@Inject |
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
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import androidx.fragment.app.Fragment | |
import dagger.hilt.android.AndroidEntryPoint | |
import javax.inject.Inject | |
@AndroidEntryPoint | |
class MainActivity : AppCompatActivity() { | |
@Inject |
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
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import androidx.fragment.app.Fragment | |
import dagger.hilt.android.AndroidEntryPoint | |
import dagger.hilt.android.scopes.ActivityScoped | |
import javax.inject.Inject | |
@AndroidEntryPoint | |
class MainActivity : AppCompatActivity() { |
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
import android.app.Application | |
import dagger.hilt.android.HiltAndroidApp | |
@HiltAndroidApp | |
class MyApplication : Application(){ | |
override fun onCreate() { | |
super.onCreate() | |
} | |
} |
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
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import dagger.hilt.android.AndroidEntryPoint | |
import javax.inject.Inject | |
@AndroidEntryPoint | |
class MainActivity : AppCompatActivity() { | |
@Inject | |
lateinit var someClass: SomeClass |
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
@Module | |
@InstallIn(ApplicationComponent::class) | |
object NetworkModule { | |
@Singleton | |
@Provides | |
fun provideBlogService(): BlogService{ | |
return Retrofit.Builder() | |
.baseUrl("https://open-api.xyz/placeholder/") | |
.build() |