// Path: app/src/main/java/gdg/devfest/passwordmanager/view/CustomFieldDialog.java
// public class CustomFieldDialog extends DialogFragment {
//   private static final String TITLE = "TITLE";
//   private static final String NAME = "NAME";
//   private static final String VALUE = "VALUE";
// 
//   private OnCustomFieldSubmitListener customFieldSubmitListener;
//   private OnCustomFieldDeleteListener customFieldDeleteListener;
// 
//   public static CustomFieldDialog newInstance(String title, String name, String value,
//       OnCustomFieldSubmitListener customFieldSubmitListener,
//       OnCustomFieldDeleteListener customFieldDeleteListener) {
//     CustomFieldDialog fragment = new CustomFieldDialog();
// 
//     //TODO: Pass via bundle
//     fragment.customFieldSubmitListener = customFieldSubmitListener;
//     fragment.customFieldDeleteListener = customFieldDeleteListener;
// 
//     Bundle arguments = new Bundle();
//     arguments.putString(TITLE, title);
//     arguments.putString(NAME, name);
//     arguments.putString(VALUE, value);
//     fragment.setArguments(arguments);
// 
//     return fragment;
//   }
// 
//   @Override public void onCreate(Bundle savedInstanceState) {
//     super.onCreate(savedInstanceState);
// 
//     setRetainInstance(true);
//   }
// 
//   @Override public Dialog onCreateDialog(Bundle savedInstanceState) {
//     String title = getArguments().getString(TITLE);
//     String name = getArguments().getString(NAME);
//     String value = getArguments().getString(VALUE);
// 
//     View view = LayoutInflater.from(getContext()).inflate(R.layout.custom_field_dialog, null);
//     EditText etName = ((EditText) view.findViewById(R.id.etName));
//     EditText etValue = ((EditText) view.findViewById(R.id.etValue));
// 
//     etName.setText(name);
//     etValue.setText(value);
// 
//     AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()).setTitle(title)
//         .setView(view)
//         .setPositiveButton("OK",
//             (dialog1, which) -> handleOk(etName.getText().toString(), etValue.getText().toString()))
//         .setNegativeButton("Cancel", null)
//         .setCancelable(true);
// 
//     if (customFieldDeleteListener != null) {
//       builder.setNeutralButton("Delete", (dialog1, which) -> handleDelete());
//     }
// 
//     return builder.create();
//   }
// 
//   private void handleOk(String name, String value) {
//     if (customFieldSubmitListener != null) customFieldSubmitListener.submit(name, value);
//   }
// 
//   private void handleDelete() {
//     customFieldDeleteListener.delete();
//   }
// 
//   public interface OnCustomFieldSubmitListener {
//     void submit(String name, String value);
//   }
// 
//   public interface OnCustomFieldDeleteListener {
//     void delete();
//   }
// }
// 
// Path: app/src/main/java/gdg/devfest/passwordmanager/view/PasswordCreateActivity.java
// public class PasswordCreateActivity
//     extends PasswordManagerActivity<PasswordCreateActivityBinding, PasswordCreateViewModel> {
// 
//   @Override protected void onCreate(Bundle savedInstanceState) {
//     super.onCreate(savedInstanceState);
// 
//     getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//   }
// 
//   @Override protected PasswordCreateViewModel createViewModel() {
//     return new PasswordCreateViewModel(new Navigator(this), new PasswordInteractor(realm));
//   }
// }
// 
// Path: app/src/main/java/gdg/devfest/passwordmanager/view/PasswordReadActivity.java
// public class PasswordReadActivity
//     extends PasswordManagerActivity<PasswordReadActivityBinding, PasswordReadViewModel> {
// 
//   @Override protected void onCreate(Bundle savedInstanceState) {
//     super.onCreate(savedInstanceState);
// 
//     getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//   }
// 
//   @Override protected PasswordReadViewModel createViewModel() {
//     int id = getIntent().getIntExtra("id", 0);
//     return new PasswordReadViewModel(new Navigator(this), new PasswordInteractor(realm), id);
//   }
// }
// 
// Path: app/src/main/java/gdg/devfest/passwordmanager/view/PasswordUpdateActivity.java
// public class PasswordUpdateActivity
//     extends PasswordManagerActivity<PasswordUpdateActivityBinding, PasswordUpdateViewModel> {
// 
//   @Override protected void onCreate(Bundle savedInstanceState) {
//     super.onCreate(savedInstanceState);
// 
//     getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//   }
// 
//   @Override protected void onInitBinding() {
//     super.onInitBinding();
// 
//     setTitle(viewModel.name.get());
//   }
// 
//   @Override protected PasswordUpdateViewModel createViewModel() {
//     int id = getIntent().getIntExtra("id", 0);
//     return new PasswordUpdateViewModel(new Navigator(this), new PasswordInteractor(realm),
//         id);
//   }
// }


import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import gdg.devfest.passwordmanager.view.CustomFieldDialog;
import gdg.devfest.passwordmanager.view.PasswordCreateActivity;
import gdg.devfest.passwordmanager.view.PasswordReadActivity;
import gdg.devfest.passwordmanager.view.PasswordUpdateActivity;
import pl.coreorb.selectiondialogs.dialogs.IconSelectDialog;
package gdg.devfest.passwordmanager.framework;


public class Navigator {
  protected final AppCompatActivity activity;

  public Navigator(AppCompatActivity activity) {
    this.activity = activity;
  }

  public void startCreatePassword() {
// Path: app/src/main/java/gdg/devfest/passwordmanager/view/CustomFieldDialog.java
// public class CustomFieldDialog extends DialogFragment {
//   private static final String TITLE = "TITLE";
//   private static final String NAME = "NAME";
//   private static final String VALUE = "VALUE";
// 
//   private OnCustomFieldSubmitListener customFieldSubmitListener;
//   private OnCustomFieldDeleteListener customFieldDeleteListener;
// 
//   public static CustomFieldDialog newInstance(String title, String name, String value,
//       OnCustomFieldSubmitListener customFieldSubmitListener,
//       OnCustomFieldDeleteListener customFieldDeleteListener) {
//     CustomFieldDialog fragment = new CustomFieldDialog();
// 
//     //TODO: Pass via bundle
//     fragment.customFieldSubmitListener = customFieldSubmitListener;
//     fragment.customFieldDeleteListener = customFieldDeleteListener;
// 
//     Bundle arguments = new Bundle();
//     arguments.putString(TITLE, title);
//     arguments.putString(NAME, name);
//     arguments.putString(VALUE, value);
//     fragment.setArguments(arguments);
// 
//     return fragment;
//   }
// 
//   @Override public void onCreate(Bundle savedInstanceState) {
//     super.onCreate(savedInstanceState);
// 
//     setRetainInstance(true);
//   }
// 
//   @Override public Dialog onCreateDialog(Bundle savedInstanceState) {
//     String title = getArguments().getString(TITLE);
//     String name = getArguments().getString(NAME);
//     String value = getArguments().getString(VALUE);
// 
//     View view = LayoutInflater.from(getContext()).inflate(R.layout.custom_field_dialog, null);
//     EditText etName = ((EditText) view.findViewById(R.id.etName));
//     EditText etValue = ((EditText) view.findViewById(R.id.etValue));
// 
//     etName.setText(name);
//     etValue.setText(value);
// 
//     AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()).setTitle(title)
//         .setView(view)
//         .setPositiveButton("OK",
//             (dialog1, which) -> handleOk(etName.getText().toString(), etValue.getText().toString()))
//         .setNegativeButton("Cancel", null)
//         .setCancelable(true);
// 
//     if (customFieldDeleteListener != null) {
//       builder.setNeutralButton("Delete", (dialog1, which) -> handleDelete());
//     }
// 
//     return builder.create();
//   }
// 
//   private void handleOk(String name, String value) {
//     if (customFieldSubmitListener != null) customFieldSubmitListener.submit(name, value);
//   }
// 
//   private void handleDelete() {
//     customFieldDeleteListener.delete();
//   }
// 
//   public interface OnCustomFieldSubmitListener {
//     void submit(String name, String value);
//   }
// 
//   public interface OnCustomFieldDeleteListener {
//     void delete();
//   }
// }
// 
// Path: app/src/main/java/gdg/devfest/passwordmanager/view/PasswordCreateActivity.java
// public class PasswordCreateActivity
//     extends PasswordManagerActivity<PasswordCreateActivityBinding, PasswordCreateViewModel> {
// 
//   @Override protected void onCreate(Bundle savedInstanceState) {
//     super.onCreate(savedInstanceState);
// 
//     getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//   }
// 
//   @Override protected PasswordCreateViewModel createViewModel() {
//     return new PasswordCreateViewModel(new Navigator(this), new PasswordInteractor(realm));
//   }
// }
// 
// Path: app/src/main/java/gdg/devfest/passwordmanager/view/PasswordReadActivity.java
// public class PasswordReadActivity
//     extends PasswordManagerActivity<PasswordReadActivityBinding, PasswordReadViewModel> {
// 
//   @Override protected void onCreate(Bundle savedInstanceState) {
//     super.onCreate(savedInstanceState);
// 
//     getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//   }
// 
//   @Override protected PasswordReadViewModel createViewModel() {
//     int id = getIntent().getIntExtra("id", 0);
//     return new PasswordReadViewModel(new Navigator(this), new PasswordInteractor(realm), id);
//   }
// }
// 
// Path: app/src/main/java/gdg/devfest/passwordmanager/view/PasswordUpdateActivity.java
// public class PasswordUpdateActivity
//     extends PasswordManagerActivity<PasswordUpdateActivityBinding, PasswordUpdateViewModel> {
// 
//   @Override protected void onCreate(Bundle savedInstanceState) {
//     super.onCreate(savedInstanceState);
// 
//     getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//   }
// 
//   @Override protected void onInitBinding() {
//     super.onInitBinding();
// 
//     setTitle(viewModel.name.get());
//   }
// 
//   @Override protected PasswordUpdateViewModel createViewModel() {
//     int id = getIntent().getIntExtra("id", 0);
//     return new PasswordUpdateViewModel(new Navigator(this), new PasswordInteractor(realm),
//         id);
//   }
// }


// Path: app/src/main/java/gdg/devfest/passwordmanager/framework/Navigator.java
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import gdg.devfest.passwordmanager.view.CustomFieldDialog;
import gdg.devfest.passwordmanager.view.PasswordCreateActivity;
import gdg.devfest.passwordmanager.view.PasswordReadActivity;
import gdg.devfest.passwordmanager.view.PasswordUpdateActivity;
import pl.coreorb.selectiondialogs.dialogs.IconSelectDialog;

package gdg.devfest.passwordmanager.framework;


public class Navigator {
  protected final AppCompatActivity activity;

  public Navigator(AppCompatActivity activity) {
    this.activity = activity;
  }

  public void startCreatePassword() {
    activity.startActivity(new Intent(activity, PasswordCreateActivity.class));