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
package com.siu.android.univelo.paris.ui.view.util | |
import android.content.res.AssetManager | |
import android.graphics.Typeface | |
import android.view.View | |
import java.util.* | |
/** | |
* @author Lukasz Piliszczuk - [email protected] | |
*/ |
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
package lukaspili.angelus.mvp.home.drawer | |
import android.content.Context | |
import android.graphics.Color | |
import android.view.View | |
import android.view.ViewGroup | |
import android.widget.LinearLayout | |
import android.widget.TextView | |
import architect.MortarFactory | |
import architect.Screen |
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
public class SimpleView extends LinearLayout { | |
@Inject | |
SimpleScreen.Presenter presenter; | |
public SimpleView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
DaggerService.<SimpleScreen.Component>getDaggerComponent(context) | |
.inject(this); | |
} |
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
public class SimpleScreen { | |
@dagger.Component(dependencies = SimpleMortarActivity.Component.class) | |
@CustomScope(Component.class) | |
public static interface Component | |
extends SimpleMortarActivity.Component { | |
void inject(SimpleView view); | |
} |
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
public class App extends Application { | |
private MortarScope mortarScope; | |
private Component component; | |
@Override | |
public Object getSystemService(String name) { | |
return mortarScope.hasService(name) ? mortarScope.getService(name) : super.getSystemService(name); | |
} |
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
@Layout(R.layout.view_login) | |
@WithComponent(LoginScreen.Component.class) | |
public class LoginScreen extends Path { | |
@dagger.Component(dependencies = RootActivity.Component.class) | |
@PerScreenScope(Component.class) | |
public static interface Component extends RootActivity.Component { | |
void inject(LoginView view); | |
} |
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
public class SimpleActivity extends Activity { | |
@Inject | |
Api api; | |
@Inject | |
ApiManager apiManager; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { |
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 | |
public class ApiManager { | |
@Inject | |
Api api; | |
@Inject | |
public ApiManager() { | |
} |
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
@Component(modules = {ApiModule.class, DatabaseModule.class}) | |
@Singleton | |
public interface DataAccessComponent { | |
Api api(); | |
Database database(); | |
void inject(SimpleActivity simpleActivity); | |
} |
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
public class SimpleActivity extends Activity { | |
@Inject | |
Api api; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
DemortarApp.getDemortarApp(this).getComponent().inject(this); |