// Path: examples/todomvc/src/main/java/info/izumin/android/droidux/example/todomvc/action/AddTodoAction.java
// public class AddTodoAction implements Action {
//     public static final String TAG = AddTodoAction.class.getSimpleName();
// 
//     private final String text;
// 
//     public AddTodoAction(String text) {
//         this.text = text;
//     }
// 
//     public String getText() {
//         return text;
//     }
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: examples/todomvc/src/main/java/info/izumin/android/droidux/example/todomvc/action/ClearCompletedTodoAction.java
// public class ClearCompletedTodoAction implements Action {
//     public static final String TAG = ClearCompletedTodoAction.class.getSimpleName();
// }
// 
// Path: examples/todomvc/src/main/java/info/izumin/android/droidux/example/todomvc/action/DeleteTodoAction.java
// public class DeleteTodoAction implements Action {
//     public static final String TAG = DeleteTodoAction.class.getSimpleName();
// 
//     private final long id;
// 
//     public DeleteTodoAction(long id) {
//         this.id = id;
//     }
// 
//     public long getId() {
//         return id;
//     }
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: examples/todomvc/src/main/java/info/izumin/android/droidux/example/todomvc/action/ToggleCompletedTodoAction.java
// public class ToggleCompletedTodoAction implements Action {
//     public static final String TAG = ToggleCompletedTodoAction.class.getSimpleName();
// 
//     private final int id;
// 
//     public ToggleCompletedTodoAction(int id) {
//         this.id = id;
//     }
// 
//     public int getId() {
//         return id;
//     }
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }


import android.support.v7.app.AlertDialog;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Toast;
import info.izumin.android.droidux.example.todomvc.action.AddTodoAction;
import info.izumin.android.droidux.example.todomvc.action.ClearCompletedTodoAction;
import info.izumin.android.droidux.example.todomvc.action.DeleteTodoAction;
import info.izumin.android.droidux.example.todomvc.action.ToggleCompletedTodoAction;
import io.reactivex.BackpressureStrategy;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.subjects.PublishSubject;
import io.reactivex.subjects.SingleSubject;
package info.izumin.android.droidux.example.todomvc;



/**
 * Created by izumin on 11/5/15.
 */
public class MainActivityHelper {
    public static final String TAG = MainActivityHelper.class.getSimpleName();

    private MainActivity activity;
    private RootStore store;

    private EditText editNewTodo;
    private Button btnAddTodo;
    private ListView listTodo;

    public MainActivityHelper(MainActivity activity) {
        this.activity = activity;
    }

    public void onCreate() {
        store = ((App) activity.getApplication()).getStore();

        editNewTodo = (EditText) activity.findViewById(R.id.edit_new_todo);
        btnAddTodo = (Button) activity.findViewById(R.id.btn_add_todo);
        listTodo = (ListView) activity.findViewById(R.id.list_todo);

        observeOnClickBtnAddTodo()
// Path: examples/todomvc/src/main/java/info/izumin/android/droidux/example/todomvc/action/AddTodoAction.java
// public class AddTodoAction implements Action {
//     public static final String TAG = AddTodoAction.class.getSimpleName();
// 
//     private final String text;
// 
//     public AddTodoAction(String text) {
//         this.text = text;
//     }
// 
//     public String getText() {
//         return text;
//     }
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: examples/todomvc/src/main/java/info/izumin/android/droidux/example/todomvc/action/ClearCompletedTodoAction.java
// public class ClearCompletedTodoAction implements Action {
//     public static final String TAG = ClearCompletedTodoAction.class.getSimpleName();
// }
// 
// Path: examples/todomvc/src/main/java/info/izumin/android/droidux/example/todomvc/action/DeleteTodoAction.java
// public class DeleteTodoAction implements Action {
//     public static final String TAG = DeleteTodoAction.class.getSimpleName();
// 
//     private final long id;
// 
//     public DeleteTodoAction(long id) {
//         this.id = id;
//     }
// 
//     public long getId() {
//         return id;
//     }
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: examples/todomvc/src/main/java/info/izumin/android/droidux/example/todomvc/action/ToggleCompletedTodoAction.java
// public class ToggleCompletedTodoAction implements Action {
//     public static final String TAG = ToggleCompletedTodoAction.class.getSimpleName();
// 
//     private final int id;
// 
//     public ToggleCompletedTodoAction(int id) {
//         this.id = id;
//     }
// 
//     public int getId() {
//         return id;
//     }
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }


// Path: examples/todomvc/src/main/java/info/izumin/android/droidux/example/todomvc/MainActivityHelper.java
import android.support.v7.app.AlertDialog;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Toast;
import info.izumin.android.droidux.example.todomvc.action.AddTodoAction;
import info.izumin.android.droidux.example.todomvc.action.ClearCompletedTodoAction;
import info.izumin.android.droidux.example.todomvc.action.DeleteTodoAction;
import info.izumin.android.droidux.example.todomvc.action.ToggleCompletedTodoAction;
import io.reactivex.BackpressureStrategy;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.subjects.PublishSubject;
import io.reactivex.subjects.SingleSubject;

package info.izumin.android.droidux.example.todomvc;



/**
 * Created by izumin on 11/5/15.
 */
public class MainActivityHelper {
    public static final String TAG = MainActivityHelper.class.getSimpleName();

    private MainActivity activity;
    private RootStore store;

    private EditText editNewTodo;
    private Button btnAddTodo;
    private ListView listTodo;

    public MainActivityHelper(MainActivity activity) {
        this.activity = activity;
    }

    public void onCreate() {
        store = ((App) activity.getApplication()).getStore();

        editNewTodo = (EditText) activity.findViewById(R.id.edit_new_todo);
        btnAddTodo = (Button) activity.findViewById(R.id.btn_add_todo);
        listTodo = (ListView) activity.findViewById(R.id.list_todo);

        observeOnClickBtnAddTodo()
                .filter(s -> !s.isEmpty())