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
class Engine{ | |
fun turnOn() { | |
Log.d("TAG", "Engine is turn on") | |
} | |
} | |
class Transmission { | |
} |
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
class MainActivity : AppCompatActivity() { | |
private lateinit var car: Car | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
// val engine = Engine() | |
// val transmission = Transmission() |
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
class Engine @Inject constructor(){ | |
fun turnOn() { | |
Log.d("TAG", "Engine is turn on") | |
} | |
} | |
class Transmission @Inject constructor(){ | |
} |
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
@Component | |
interface CarComponent { | |
fun getCar(): Car | |
} |
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
public final class DaggerCarComponent implements CarComponent { | |
private DaggerCarComponent() { | |
} | |
public static Builder builder() { | |
return new 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
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
DaggerCarComponent.builder().build().getCar().startCar() | |
} | |
} |
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
@Component | |
interface CarComponent { | |
//fun getCar(): Car | |
fun inject(mainActivity: MainActivity) | |
} |
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
class MainActivity : AppCompatActivity() { | |
@Inject | |
lateinit var car: Car | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
//DaggerCarComponent.builder().build().getCar().startCar() |
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
@SuppressWarnings({ | |
"unchecked", | |
"rawtypes" | |
}) | |
public final class DaggerCarComponent implements CarComponent { | |
private DaggerCarComponent() { | |
} |
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
public final class MainActivity_MembersInjector implements MembersInjector<MainActivity> { | |
private final Provider<Car> carProvider; | |
public MainActivity_MembersInjector(Provider<Car> carProvider) { | |
this.carProvider = carProvider; | |
} | |
public static MembersInjector<MainActivity> create(Provider<Car> carProvider) { | |
return new MainActivity_MembersInjector(carProvider); | |
} |
OlderNewer