Skip to content

Instantly share code, notes, and snippets.

View smaugho's full-sized avatar

Adrián Rivero smaugho

  • DSpot Sp. z o.o
  • Wrocław, Poland
View GitHub Profile
@smaugho
smaugho / DecleX.java
Last active May 4, 2017 12:52
Navigating in the app with Actions
@EActivity(R.id.activity_settings)
public class SettingsActivity extends Activity {
@Click
void showProfile() {
$ProfileFragment();
}
@Click
void showNotifications() {
$NotificationsFragment();
@smaugho
smaugho / DecleX.java
Last active April 26, 2017 23:09
AddressFragment Example
@EFragment(R.id.fragment_address)
public class AddressFragment extends Fragment {
@FragmentArg
@Model
@Populate
@Recollect(validate = true)
User user;
@Click
void save() {
@smaugho
smaugho / DecleX.java
Last active April 26, 2017 22:54
UserFragment Example
@EFragment(R.id.fragment_user)
public class UserFragment extends Fragment {
@Model
@UseModel
@Recollect(validate = true)
User user;
@Click
void next() {
$Recollect(user);
@smaugho
smaugho / DecleX.java
Last active April 26, 2017 23:12
Query in DecleX
@Model(query = "firstname='A%'")
@Populate
List<User> users;
@smaugho
smaugho / DecleX.xml
Last active April 26, 2017 23:11
ListView Layout
<ListView
android:id="@+id/users"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@layout/item_user" />
@smaugho
smaugho / DecleX.java
Last active April 26, 2017 23:01
Populate List in DecleX
@Model
@Populate
List<User> users;
@smaugho
smaugho / DecleX.java
Last active April 26, 2017 23:02
Validate Recollection
@Model
@Populate
@Recollect(validate = true)
@PutOnAction(R.id.saveUser)
User user;
@smaugho
smaugho / DecleX.java
Last active April 26, 2017 23:04
Address Model
@UseModel
class Address {
String street;
String number;
String city;
String country;
}
@smaugho
smaugho / DecleX.java
Last active April 26, 2017 23:08
User Model
@ServerModel(
baseUrl = "http://www.example.com",
get = "user/me"
)
@LocalDBModel
public class User {
@NotEmpty String firstName;
@NotEmpty String lastName;
@Email String email;
@smaugho
smaugho / DecleX.java
Last active April 26, 2017 23:01
Populate and Recollect a Model
@Model
@Populate
@Recollect
@PutOnAction(R.id.saveUser)
User user;