// Path: comm/src/main/java/br/com/hole19/marvel/comm/post_office/Postman.java
// public class Postman {
// 
//     public static final String TAG = "Postman";
// 
//     @Inject
//     RestTemplate mRequestService;
//     @Inject
//     RequestUtil mRequestUtil;
// 
//     public Postman() {
//         DaggerWrapper.getComponent().inject(this);
//     }
// 
//     public void listCharacters(Context context, String query, int limit, int offset) {
//         this.mRequestService.setUrl(mRequestUtil.buildBasicUrl(context, context.getString(R.string.MARVEL_SERVICE_LIST_CHARACTERS), query, limit, offset));
//         this.mRequestService.setBody(EventCatalog.e0000, Request.Method.GET);
//         this.mRequestService.execute(context);
//     }
// 
//     public void listComicDetails(String resourceURI, Context context) {
//         if (!"".equals(resourceURI) && context != null) {
//             this.mRequestService.setUrl(this.mRequestUtil.parseExistentRequest(resourceURI, context));
//             this.mRequestService.setBody(EventCatalog.e0001, Request.Method.GET);
//             this.mRequestService.execute(context);
//         }
//     }
// 
//     public void cancelRequests() {
//         mRequestService.cancelRequests();
//     }
// }
// 
// Path: user-intf/src/main/java/br/com/hole19/marvel/ui/commons/util/PermissionsUtil.java
// public class PermissionsUtil {
// 
//     public boolean verifyStoragePermissions(Activity activity, int callbackCode) {
//         int permission = ActivityCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE);
//         if (permission != PackageManager.PERMISSION_GRANTED) {
//             ActivityCompat.requestPermissions(activity, new String[]{ Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
//         }
//         return true;
//     }
// 
// }
// 
// Path: user-intf/src/main/java/br/com/hole19/marvel/ui/commons/util/StaticResourceProvider.java
// public class StaticResourceProvider {
// 
//     @Inject
//     App mApplication;
// 
//     public StaticResourceProvider() {
//         App.getComponent().inject(this);
//     }
// 
//     public Picasso getPicasso() {
//         return Picasso.with(this.mApplication.getContext());
//     }
// 
//     public MaterialDialog.Builder getDialogBuilder(Context context) {
//         return new MaterialDialog.Builder(context);
//     }
// }
// 
// Path: user-intf/src/main/java/br/com/hole19/marvel/ui/commons/util/managers/ToolbarManager.java
// public class ToolbarManager {
// 
//     private Toolbar mToolbar;
//     private AppCompatActivity mActivity;
// 
//     // PUBLIC INTERFACE
//     public void initToolbar(AppCompatActivity activity, int resourceId, String title, int resID) {
//         this.mActivity = activity;
//         this.mToolbar = (Toolbar) this.mActivity.findViewById(resourceId);
//         this.mActivity.setSupportActionBar(this.mToolbar);
//         this.mActivity.getSupportActionBar().setTitle(title);
//         this.mToolbar.setTitleTextColor(resID);
//     }
// 
//     public void prepareNavigationBehavior(Integer icon, final OnIconClicked executor) {
//         if (icon != null) {
//             this.mToolbar.setNavigationIcon(icon);
//         }
//         this.mActivity.getSupportActionBar().setHomeButtonEnabled(true);
//         if (executor != null) {
//             this.mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
//                 @Override
//                 public void onClick(View v) {
//                     executor.executeTask();
//                 }
//             });
//         }
//     }
// 
//     // GETTERS AND SETTERS
//     public Toolbar getToolbar() {
//         return mToolbar;
//     }
// 
//     // INNER CLASSES
//     public interface OnIconClicked {
//         public void executeTask();
//     }
// }
// 
// Path: user-intf/src/main/java/br/com/hole19/marvel/ui/infrastructure/App.java
// public class App extends Application {
// 
//     private static App mApp = null;
//     private static MainComponent component;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         this.mApp = this;
//         this.component = DaggerMainComponent
//                 .builder()
//                 .moduleUtil(new ModuleUtil(this))
//                 .build();
//     }
// 
//     public static Application getApplication() {
//         return mApp;
//     }
// 
//     public Context getContext() {
//         if (mApp == null) {
//             return new Application();
//         }
//         return mApp.getApplicationContext();
//     }
// 
//     public static MainComponent getComponent() {
//         return component;
//     }
// }


import android.content.Context;
import com.squareup.picasso.Picasso;
import javax.inject.Singleton;
import br.com.edsilfer.kiwi.layout.RecyclerViewUtil;
import br.com.edsilfer.kiwi.loading.LoaderManager;
import br.com.edsilfer.kiwi.notification.NotificationManager;
import br.com.hole19.marvel.comm.post_office.Postman;
import br.com.hole19.marvel.ui.commons.util.PermissionsUtil;
import br.com.hole19.marvel.ui.commons.util.StaticResourceProvider;
import br.com.hole19.marvel.ui.commons.util.managers.ToolbarManager;
import br.com.hole19.marvel.ui.infrastructure.App;
import dagger.Module;
import dagger.Provides;
package br.com.hole19.marvel.ui.infrastructure.modules;





/**
 * Created by edgar on 03-May-16.
 */
@Module
public class ModuleUtil {

    private final Context context;

    public ModuleUtil(Context context) {
        this.context = context;
    }

    @Provides
    public ToolbarManager provideToolbarManager() {
        return new ToolbarManager();
    }

    @Provides
    @Singleton
    public Postman providePostman() {
// Path: comm/src/main/java/br/com/hole19/marvel/comm/post_office/Postman.java
// public class Postman {
// 
//     public static final String TAG = "Postman";
// 
//     @Inject
//     RestTemplate mRequestService;
//     @Inject
//     RequestUtil mRequestUtil;
// 
//     public Postman() {
//         DaggerWrapper.getComponent().inject(this);
//     }
// 
//     public void listCharacters(Context context, String query, int limit, int offset) {
//         this.mRequestService.setUrl(mRequestUtil.buildBasicUrl(context, context.getString(R.string.MARVEL_SERVICE_LIST_CHARACTERS), query, limit, offset));
//         this.mRequestService.setBody(EventCatalog.e0000, Request.Method.GET);
//         this.mRequestService.execute(context);
//     }
// 
//     public void listComicDetails(String resourceURI, Context context) {
//         if (!"".equals(resourceURI) && context != null) {
//             this.mRequestService.setUrl(this.mRequestUtil.parseExistentRequest(resourceURI, context));
//             this.mRequestService.setBody(EventCatalog.e0001, Request.Method.GET);
//             this.mRequestService.execute(context);
//         }
//     }
// 
//     public void cancelRequests() {
//         mRequestService.cancelRequests();
//     }
// }
// 
// Path: user-intf/src/main/java/br/com/hole19/marvel/ui/commons/util/PermissionsUtil.java
// public class PermissionsUtil {
// 
//     public boolean verifyStoragePermissions(Activity activity, int callbackCode) {
//         int permission = ActivityCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE);
//         if (permission != PackageManager.PERMISSION_GRANTED) {
//             ActivityCompat.requestPermissions(activity, new String[]{ Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
//         }
//         return true;
//     }
// 
// }
// 
// Path: user-intf/src/main/java/br/com/hole19/marvel/ui/commons/util/StaticResourceProvider.java
// public class StaticResourceProvider {
// 
//     @Inject
//     App mApplication;
// 
//     public StaticResourceProvider() {
//         App.getComponent().inject(this);
//     }
// 
//     public Picasso getPicasso() {
//         return Picasso.with(this.mApplication.getContext());
//     }
// 
//     public MaterialDialog.Builder getDialogBuilder(Context context) {
//         return new MaterialDialog.Builder(context);
//     }
// }
// 
// Path: user-intf/src/main/java/br/com/hole19/marvel/ui/commons/util/managers/ToolbarManager.java
// public class ToolbarManager {
// 
//     private Toolbar mToolbar;
//     private AppCompatActivity mActivity;
// 
//     // PUBLIC INTERFACE
//     public void initToolbar(AppCompatActivity activity, int resourceId, String title, int resID) {
//         this.mActivity = activity;
//         this.mToolbar = (Toolbar) this.mActivity.findViewById(resourceId);
//         this.mActivity.setSupportActionBar(this.mToolbar);
//         this.mActivity.getSupportActionBar().setTitle(title);
//         this.mToolbar.setTitleTextColor(resID);
//     }
// 
//     public void prepareNavigationBehavior(Integer icon, final OnIconClicked executor) {
//         if (icon != null) {
//             this.mToolbar.setNavigationIcon(icon);
//         }
//         this.mActivity.getSupportActionBar().setHomeButtonEnabled(true);
//         if (executor != null) {
//             this.mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
//                 @Override
//                 public void onClick(View v) {
//                     executor.executeTask();
//                 }
//             });
//         }
//     }
// 
//     // GETTERS AND SETTERS
//     public Toolbar getToolbar() {
//         return mToolbar;
//     }
// 
//     // INNER CLASSES
//     public interface OnIconClicked {
//         public void executeTask();
//     }
// }
// 
// Path: user-intf/src/main/java/br/com/hole19/marvel/ui/infrastructure/App.java
// public class App extends Application {
// 
//     private static App mApp = null;
//     private static MainComponent component;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         this.mApp = this;
//         this.component = DaggerMainComponent
//                 .builder()
//                 .moduleUtil(new ModuleUtil(this))
//                 .build();
//     }
// 
//     public static Application getApplication() {
//         return mApp;
//     }
// 
//     public Context getContext() {
//         if (mApp == null) {
//             return new Application();
//         }
//         return mApp.getApplicationContext();
//     }
// 
//     public static MainComponent getComponent() {
//         return component;
//     }
// }


// Path: user-intf/src/main/java/br/com/hole19/marvel/ui/infrastructure/modules/ModuleUtil.java
import android.content.Context;
import com.squareup.picasso.Picasso;
import javax.inject.Singleton;
import br.com.edsilfer.kiwi.layout.RecyclerViewUtil;
import br.com.edsilfer.kiwi.loading.LoaderManager;
import br.com.edsilfer.kiwi.notification.NotificationManager;
import br.com.hole19.marvel.comm.post_office.Postman;
import br.com.hole19.marvel.ui.commons.util.PermissionsUtil;
import br.com.hole19.marvel.ui.commons.util.StaticResourceProvider;
import br.com.hole19.marvel.ui.commons.util.managers.ToolbarManager;
import br.com.hole19.marvel.ui.infrastructure.App;
import dagger.Module;
import dagger.Provides;

package br.com.hole19.marvel.ui.infrastructure.modules;





/**
 * Created by edgar on 03-May-16.
 */
@Module
public class ModuleUtil {

    private final Context context;

    public ModuleUtil(Context context) {
        this.context = context;
    }

    @Provides
    public ToolbarManager provideToolbarManager() {
        return new ToolbarManager();
    }

    @Provides
    @Singleton
    public Postman providePostman() {
        return new Postman();