// Path: zen-android/src/main/java/zenproject/meditation/android/ui/menu/dialogs/brush/BrushOptionsDialog.java
// public class BrushOptionsDialog extends ZenDialog implements ColorSelectedListener, SizeChangedListener {
//     public static final String TAG = "BrushOptionsDialog";
// 
//     private BrushColor selectedColor = BrushOptionsPreferences.newInstance().getBrushColor();
//     private int selectedSize = BrushOptionsPreferences.newInstance().getBrushSizePercentage();
//     private SizeView sizeView;
// 
//     @NonNull
//     @Override
//     public Dialog onCreateDialog(Bundle savedInstanceState) {
//         MaterialDialog materialDialog = new MaterialDialog.Builder(getActivity())
//                 .title(ContextRetriever.INSTANCE.getResources().getString(R.string.brush_options_title))
//                 .backgroundColor(Color.WHITE)
//                 .customView(R.layout.brush_options_dialog, false)
//                 .positiveText(ContextRetriever.INSTANCE.getResources().getString(R.string.option_done))
//                 .positiveColorRes(R.color.colorPrimaryDark)
//                 .negativeText(ContextRetriever.INSTANCE.getResources().getString(R.string.option_cancel))
//                 .negativeColorRes(R.color.colorAccent)
//                 .theme(Theme.LIGHT)
//                 .onPositive((dialog, which) -> {
//                     trackPreferences();
//                     storePreferences();
//                 })
//                 .build();
// 
//         ColorListView colorListView = materialDialog.getCustomView().findViewById(R.id.color_picker);
//         colorListView.setColorSelectedListener(this);
// 
//         sizeView = materialDialog.getCustomView().findViewById(R.id.brush_size);
//         sizeView.setSizeChangedListener(this);
// 
//         return materialDialog;
//     }
// 
//     private void trackPreferences() {
//         AnalyticsTracker.INSTANCE.trackBrushColor(selectedColor);
//         AnalyticsTracker.INSTANCE.trackBrushSize(selectedSize);
//     }
// 
//     private void storePreferences() {
//         BrushOptionsPreferences brushOptionsPreferences = BrushOptionsPreferences.newInstance();
//         brushOptionsPreferences.applyBrushColor(selectedColor);
//         brushOptionsPreferences.applyBrushSizePercentage(selectedSize);
//     }
// 
//     @Override
//     public void onDismiss(DialogInterface dialog) {
//         super.onDismiss(dialog);
//     }
// 
//     @Override
//     public void onColorSelected(BrushColor color) {
//         selectedColor = color;
//         sizeView.updateInkDropImageColor(color.color());
//     }
// 
//     @Override
//     public void onSizeChanged(int size) {
//         selectedSize = size;
//     }
// }
// 
// Path: zen-android/src/main/java/zenproject/meditation/android/ui/menu/dialogs/flower/FlowerOptionsDialog.java
// public class FlowerOptionsDialog extends ZenDialog implements FlowerSelectedListener {
//     public static final String TAG = "FlowerOptionsDialog";
// 
//     private Flower selectedFlower = FlowerOptionPreferences.newInstance().getFlower();
//     private FlowerSelectedListener flowerSelectedListener;
// 
//     @NonNull
//     @Override
//     public Dialog onCreateDialog(Bundle savedInstanceState) {
//         MaterialDialog materialDialog = new MaterialDialog.Builder(getActivity())
//                 .title(ContextRetriever.INSTANCE.getResources().getString(R.string.flower_options_title))
//                 .backgroundColor(Color.WHITE)
//                 .customView(R.layout.flowers_options_dialog, false)
//                 .positiveText(ContextRetriever.INSTANCE.getResources().getString(R.string.option_done))
//                 .positiveColorRes(R.color.colorPrimaryDark)
//                 .negativeText(ContextRetriever.INSTANCE.getResources().getString(R.string.option_cancel))
//                 .negativeColorRes(R.color.colorAccent)
//                 .theme(Theme.LIGHT)
//                 .onPositive((dialog, which) -> {
//                     if (hasFlowerSelectedListener()) {
//                         flowerSelectedListener.onFlowerSelected(selectedFlower);
//                     }
//                     trackPreferences();
//                     storePreferences();
//                 })
//                 .build();
// 
//         FlowerViewList flowerViewList = materialDialog.getCustomView().findViewById(R.id.flower_picker);
//         flowerViewList.setFlowerSelectedListener(this);
// 
//         return materialDialog;
//     }
// 
//     private boolean hasFlowerSelectedListener() {
//         return this.flowerSelectedListener != null;
//     }
// 
//     public void setFlowerSelectedListener(FlowerSelectedListener flowerSelectedListener) {
//         this.flowerSelectedListener = flowerSelectedListener;
//     }
// 
//     private void trackPreferences() {
//         AnalyticsTracker.INSTANCE.trackFlower(selectedFlower);
//     }
// 
//     private void storePreferences() {
//         FlowerOptionPreferences flowerOptionPreferences = FlowerOptionPreferences.newInstance();
//         flowerOptionPreferences.applyFlower(selectedFlower);
//     }
// 
//     @Override
//     public void onFlowerSelected(Flower flower) {
//         selectedFlower = flower;
//     }
// }
// 
// Path: zen-android/src/main/java/zenproject/meditation/android/ui/menu/dialogs/flower/FlowerSelectedListener.java
// public interface FlowerSelectedListener {
//     void onFlowerSelected(Flower flower);
// }


import android.app.FragmentManager;
import com.novoda.notils.caster.Classes;
import zenproject.meditation.android.ContextRetriever;
import zenproject.meditation.android.SketchRetriever;
import zenproject.meditation.android.ui.menu.dialogs.brush.BrushOptionsDialog;
import zenproject.meditation.android.ui.menu.dialogs.flower.FlowerOptionsDialog;
import zenproject.meditation.android.ui.menu.dialogs.flower.FlowerSelectedListener;
package zenproject.meditation.android.ui.menu.dialogs;




public class Navigator {

    private final FragmentManager fragmentManager;
    private final BrushOptionsDialog brushOptionsDialog;
    private final FlowerOptionsDialog flowerOptionsDialog;

    Navigator(FragmentManager fragmentManager, BrushOptionsDialog brushOptionsDialog, FlowerOptionsDialog flowerOptionsDialog) {
        this.fragmentManager = fragmentManager;
        this.brushOptionsDialog = brushOptionsDialog;
        this.flowerOptionsDialog = flowerOptionsDialog;
    }

    public static Navigator newInstance() {
        FragmentManager fragmentManager = ContextRetriever.INSTANCE.getActivity().getFragmentManager();
// Path: zen-android/src/main/java/zenproject/meditation/android/ui/menu/dialogs/brush/BrushOptionsDialog.java
// public class BrushOptionsDialog extends ZenDialog implements ColorSelectedListener, SizeChangedListener {
//     public static final String TAG = "BrushOptionsDialog";
// 
//     private BrushColor selectedColor = BrushOptionsPreferences.newInstance().getBrushColor();
//     private int selectedSize = BrushOptionsPreferences.newInstance().getBrushSizePercentage();
//     private SizeView sizeView;
// 
//     @NonNull
//     @Override
//     public Dialog onCreateDialog(Bundle savedInstanceState) {
//         MaterialDialog materialDialog = new MaterialDialog.Builder(getActivity())
//                 .title(ContextRetriever.INSTANCE.getResources().getString(R.string.brush_options_title))
//                 .backgroundColor(Color.WHITE)
//                 .customView(R.layout.brush_options_dialog, false)
//                 .positiveText(ContextRetriever.INSTANCE.getResources().getString(R.string.option_done))
//                 .positiveColorRes(R.color.colorPrimaryDark)
//                 .negativeText(ContextRetriever.INSTANCE.getResources().getString(R.string.option_cancel))
//                 .negativeColorRes(R.color.colorAccent)
//                 .theme(Theme.LIGHT)
//                 .onPositive((dialog, which) -> {
//                     trackPreferences();
//                     storePreferences();
//                 })
//                 .build();
// 
//         ColorListView colorListView = materialDialog.getCustomView().findViewById(R.id.color_picker);
//         colorListView.setColorSelectedListener(this);
// 
//         sizeView = materialDialog.getCustomView().findViewById(R.id.brush_size);
//         sizeView.setSizeChangedListener(this);
// 
//         return materialDialog;
//     }
// 
//     private void trackPreferences() {
//         AnalyticsTracker.INSTANCE.trackBrushColor(selectedColor);
//         AnalyticsTracker.INSTANCE.trackBrushSize(selectedSize);
//     }
// 
//     private void storePreferences() {
//         BrushOptionsPreferences brushOptionsPreferences = BrushOptionsPreferences.newInstance();
//         brushOptionsPreferences.applyBrushColor(selectedColor);
//         brushOptionsPreferences.applyBrushSizePercentage(selectedSize);
//     }
// 
//     @Override
//     public void onDismiss(DialogInterface dialog) {
//         super.onDismiss(dialog);
//     }
// 
//     @Override
//     public void onColorSelected(BrushColor color) {
//         selectedColor = color;
//         sizeView.updateInkDropImageColor(color.color());
//     }
// 
//     @Override
//     public void onSizeChanged(int size) {
//         selectedSize = size;
//     }
// }
// 
// Path: zen-android/src/main/java/zenproject/meditation/android/ui/menu/dialogs/flower/FlowerOptionsDialog.java
// public class FlowerOptionsDialog extends ZenDialog implements FlowerSelectedListener {
//     public static final String TAG = "FlowerOptionsDialog";
// 
//     private Flower selectedFlower = FlowerOptionPreferences.newInstance().getFlower();
//     private FlowerSelectedListener flowerSelectedListener;
// 
//     @NonNull
//     @Override
//     public Dialog onCreateDialog(Bundle savedInstanceState) {
//         MaterialDialog materialDialog = new MaterialDialog.Builder(getActivity())
//                 .title(ContextRetriever.INSTANCE.getResources().getString(R.string.flower_options_title))
//                 .backgroundColor(Color.WHITE)
//                 .customView(R.layout.flowers_options_dialog, false)
//                 .positiveText(ContextRetriever.INSTANCE.getResources().getString(R.string.option_done))
//                 .positiveColorRes(R.color.colorPrimaryDark)
//                 .negativeText(ContextRetriever.INSTANCE.getResources().getString(R.string.option_cancel))
//                 .negativeColorRes(R.color.colorAccent)
//                 .theme(Theme.LIGHT)
//                 .onPositive((dialog, which) -> {
//                     if (hasFlowerSelectedListener()) {
//                         flowerSelectedListener.onFlowerSelected(selectedFlower);
//                     }
//                     trackPreferences();
//                     storePreferences();
//                 })
//                 .build();
// 
//         FlowerViewList flowerViewList = materialDialog.getCustomView().findViewById(R.id.flower_picker);
//         flowerViewList.setFlowerSelectedListener(this);
// 
//         return materialDialog;
//     }
// 
//     private boolean hasFlowerSelectedListener() {
//         return this.flowerSelectedListener != null;
//     }
// 
//     public void setFlowerSelectedListener(FlowerSelectedListener flowerSelectedListener) {
//         this.flowerSelectedListener = flowerSelectedListener;
//     }
// 
//     private void trackPreferences() {
//         AnalyticsTracker.INSTANCE.trackFlower(selectedFlower);
//     }
// 
//     private void storePreferences() {
//         FlowerOptionPreferences flowerOptionPreferences = FlowerOptionPreferences.newInstance();
//         flowerOptionPreferences.applyFlower(selectedFlower);
//     }
// 
//     @Override
//     public void onFlowerSelected(Flower flower) {
//         selectedFlower = flower;
//     }
// }
// 
// Path: zen-android/src/main/java/zenproject/meditation/android/ui/menu/dialogs/flower/FlowerSelectedListener.java
// public interface FlowerSelectedListener {
//     void onFlowerSelected(Flower flower);
// }


// Path: zen-android/src/main/java/zenproject/meditation/android/ui/menu/dialogs/Navigator.java
import android.app.FragmentManager;
import com.novoda.notils.caster.Classes;
import zenproject.meditation.android.ContextRetriever;
import zenproject.meditation.android.SketchRetriever;
import zenproject.meditation.android.ui.menu.dialogs.brush.BrushOptionsDialog;
import zenproject.meditation.android.ui.menu.dialogs.flower.FlowerOptionsDialog;
import zenproject.meditation.android.ui.menu.dialogs.flower.FlowerSelectedListener;

package zenproject.meditation.android.ui.menu.dialogs;




public class Navigator {

    private final FragmentManager fragmentManager;
    private final BrushOptionsDialog brushOptionsDialog;
    private final FlowerOptionsDialog flowerOptionsDialog;

    Navigator(FragmentManager fragmentManager, BrushOptionsDialog brushOptionsDialog, FlowerOptionsDialog flowerOptionsDialog) {
        this.fragmentManager = fragmentManager;
        this.brushOptionsDialog = brushOptionsDialog;
        this.flowerOptionsDialog = flowerOptionsDialog;
    }

    public static Navigator newInstance() {
        FragmentManager fragmentManager = ContextRetriever.INSTANCE.getActivity().getFragmentManager();
        BrushOptionsDialog brushOptionsDialog = new BrushOptionsDialog();