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 = MyModule.class) | |
public interface MyComponent { | |
public void inject(MyExtendingClass myExtendingClass); | |
} |
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 MyExtendingClass extends MyClass<String>{ | |
} |
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 abstract class BasePresenterActivity<T extends BasePresenter> extends BaseActivity implements BasePresenterView { | |
private T presenter; | |
protected T getPresenter(){ | |
return presenter; | |
} | |
@Inject | |
public void setPresenter(T presenter){ | |
this.presenter = presenter; |
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
@PKHandler(container = Bundle.class, handlerImpl = PenKnifeHandlerImpl.class) | |
public class DemoApplication extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
PenKnife.initialize(new PenKnifeHandlerImpl()); | |
} | |
} |
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 i_introduction._0_Hello_World.Hello | |
import util.TODO | |
//compiles to a static function in a class HelloPackage | |
fun main(args: Array<String>) { | |
println("Hello, world!") | |
} | |
fun todoTask0() = TODO( |
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
var myBinding: MainActivityBinding? = null; | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
myBinding = DataBindingUtil.setContentView<MainActivityBinding>(this, R.layout.ac_main) as MainActivityBinding | |
///.setContentView(R.layout.ac_main) | |
val toolbar = myBinding.toolbar; | |
setSupportActionBar(toolbar) |
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 CustomView extends FrameLayout { | |
public CustomView(Context context) { | |
super(context, null); | |
} | |
public CustomView(Context context, AttributeSet attrs) { | |
super(context, attrs, 0); | |
} |
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 MockedResources extends Resources{ | |
private Map<Integer, String> stringMap; | |
public MockedResources(){ | |
this(null, null, null); | |
} | |
public MockedResources(AssetManager assets, DisplayMetrics metrics, Configuration config) { | |
super(assets, metrics, config); | |
stringMap = new HashMap<>(1); |
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 MainActivityPresenterTestOptionTwo implements IMainActivity { | |
private static final String SOME_MOCKED_MESSAGE = "Some Mocked Message"; | |
private MockedResources resources; | |
private MainActivityPresenter mainActivityPresenter; | |
@Before | |
public void setup(){ | |
resources = new MockedResources(); | |
mainActivityPresenter = new MainActivityPresenter(); |
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 MainActivityPresenterTestOptionOne implements IMainActivity { | |
private static final String SOME_MOCKED_MESSAGE = "Some Mocked Message"; | |
private Resources resources; | |
private MainActivityPresenter mainActivityPresenter; | |
@Before | |
public void setup(){ | |
resources = Mockito.mock(Resources.class); | |
Mockito.when(resources.getString(R.string.hello_world)).thenReturn(SOME_MOCKED_MESSAGE); |