Last active
July 15, 2018 22:16
-
-
Save passsy/4c2cf0bfd2ef3fe6ac1ee02ce9abceb5 to your computer and use it in GitHub Desktop.
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 HelloWorldActivity | |
extends TiActivity<HelloWorldPresenter, HelloWorldView> | |
implements HelloWorldView { | |
private TextView mOutput; | |
@NonNull | |
@Override | |
public HelloWorldPresenter providePresenter() { | |
return new HelloWorldPresenter(); | |
} | |
@Override | |
public void showText(final String text) { | |
mOutput.setText(text); | |
} | |
@Override | |
protected void onCreate(final Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_hello_world); | |
mOutput = (TextView) findViewById(R.id.output); | |
} | |
} |
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 HelloWorldPresenter extends TiPresenter<HelloWorldView> { | |
@Override | |
protected void onAttachView(final HelloWorldView view) { | |
super.onAttachView(); | |
view.showText("Hello World!"); | |
} | |
} |
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 HelloWorldView extends TiView { | |
@CallOnMainThread | |
void showText(final String text); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment