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
android { | |
... | |
buildFeatures { | |
compose true | |
} | |
... | |
} | |
dependencies { |
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 class FriedRice { | |
public static final int VEG_FRIED_RICE = 100; | |
public static final int CHICKEN_FRIED_RICE =101; | |
private String out = ""; | |
public FriedRice(int TYPE){ | |
switch (TYPE){ | |
case VEG_FRIED_RICE: out = "VEG FRIED RICE @ plate"; break; | |
case CHICKEN_FRIED_RICE: out = "CHICKEN FRIED RICE @ plate"; break; |
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
@SwiggyScope | |
@Component(modules = DhabaModule.class) | |
public interface SwiggyBoyComponent { | |
void inject(EbinHomeActivity target ); | |
} |
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 | |
public class DhabaModule { | |
@VegFriedRice | |
@Provides | |
FriedRice getVegFriedRice(){ | |
return new FriedRice(FriedRice.VEG_FRIED_RICE); | |
} | |
} |
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 class EbinHomeActivity extends AppCompatActivity { | |
@Inject | |
FriedRice friedRice; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_ebin_home); |
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 interface SimService { | |
void sendSim(Sim sim); | |
} | |
public class Phone implements SimService { | |
Sim sim; | |
@Override | |
public void sendSim(Sim sim) { | |
this.sim = sim; | |
} |
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 class Phone { | |
private Sim sim; | |
public void Phone(Sim sim) { | |
this.sim = sim; | |
} | |
} |
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 class Phone { | |
private Sim sim; | |
public Sim getSim() { | |
return sim; | |
} | |
public void setSim(Sim sim) { | |
this.sim = sim; |
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
//Type1 | |
class A { | |
private final B b; | |
public A() { //Tightly coupled(Not good) | |
b = new B(a,b,c,d,e); //passing ingrediants | |
} | |
} | |
//Type2 |