-
Notifications
You must be signed in to change notification settings - Fork 4
Activity Extras builder
Roman Tcaregorodtcev edited this page Apr 2, 2018
·
1 revision
- @OmegaActivity - annotation for activity.
- @OmegaExtraModel - annotation for classes, which will be putted to bundle.
- @OmegaExtra - annotation for fields, which will be putted to bundle.
@OmegaExtraModel and @OmegaExtra support prefix for generated method name.
If you wan't annotate your class with @OmegaExtra - this class should be implements Serializable
@OmegaActivity
public class ShareFilesActivity extends Activity {
@OmegaExtra
protected String url1;
@OmegaExtraModel(prefix = "model")
Model model = new Model();
@OmegaExtra()
Model modelTwo;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_share_files);
AppOmegaIntentBuilder.inject(this);
}
}
Model class
public class Model implements Serializable {
@OmegaExtra("Var2")
String url;
public String getUrl() {
return url;
}
}
public class MainActivity extends Acitity {
AppOmegaIntentBuilder.from(context)
.appActivities()
.shareFilesActivity()
.url1("https://developer.android.com/studio/images/hero_image_studio.png")
.modelVar2("https://avatars1.githubusercontent.com/u/28600571?s=200&v=4")
.startActivity();
}
AppOmegaIntentBuilder.from(this)
.appActivities()
.shareFilesActivity()
.startActivity();