// Path: app/src/main/java/com/sefford/material/sample/common/internal/Bus.java
// public class Bus implements Postable, com.sefford.brender.interfaces.Postable {
// 
//     final EventBus bus;
// 
//     @Inject
//     public Bus(EventBus bus) {
//         this.bus = bus;
//     }
// 
//     public void register(Object target) {
//         if (!bus.isRegistered(target)) {
//             bus.register(target);
//         }
//     }
// 
//     public void unregister(Object target) {
//         if (bus.isRegistered(target)) {
//             bus.unregister(target);
//         }
//     }
// 
//     @Override
//     public void post(Object message) {
//         bus.post(message);
//     }
// }
// 
// Path: app/src/main/java/com/sefford/material/sample/contacts/details/ui/activities/ContactDetailsActivity.java
// public class ContactDetailsActivity extends BaseActivity {
// 
//     public static final String EXTRA_ID = "extra_id";
//     public static final String EXTRA_NAME = "extra_name";
//     public static final String EXTRA_COLOR = "extra_color";
// 
//     @Inject
//     ContactDetailView view;
//     @Inject
//     ContactDetailPresenter presenter;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.screen_detail);
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         view.configurePlaceholder(getIntent().getStringExtra(EXTRA_NAME), getIntent().getStringExtra(EXTRA_COLOR));
//         view.bind(getWindow().findViewById(android.R.id.content));
//         presenter.setId(getIntent().getLongExtra(EXTRA_ID, 0));
//         presenter.bind(view);
//     }
// 
// 
//     @Override
//     protected void onDestroy() {
//         super.onDestroy();
//         presenter.release();
//     }
// 
//     @Override
//     protected Object[] getExtensions(ObjectGraph originalGraph, Bundle arguments) {
//         final Object[] extensions = new Object[2];
//         extensions[0] = new LocalBusModule();
//         extensions[1] = new UiModule();
//         return extensions;
//     }
// }
// 
// Path: app/src/main/java/com/sefford/material/sample/contacts/list/ui/activities/ContactListActivity.java
// public class ContactListActivity extends BaseActivity {
// 
//     @Inject
//     ContactListView view;
//     @Inject
//     ContactListPresenter presenter;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.screen_contacts);
//     }
// 
//     @Override
//     protected Object[] getExtensions(ObjectGraph originalGraph, Bundle arguments) {
//         final Object[] extensions = new Object[2];
//         extensions[0] = new LocalBusModule();
//         extensions[1] = new UiModule();
//         return extensions;
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         view.bind(getWindow().findViewById(android.R.id.content));
//         presenter.bind(view);
//     }
// 
//     @Override
//     protected void onDestroy() {
//         super.onDestroy();
//         presenter.release();
//     }
// }


import com.sefford.brender.interfaces.Postable;
import com.sefford.material.sample.common.internal.Bus;
import com.sefford.material.sample.contacts.details.ui.activities.ContactDetailsActivity;
import com.sefford.material.sample.contacts.list.ui.activities.ContactListActivity;
import dagger.Module;
import dagger.Provides;
import javax.inject.Named;
import javax.inject.Singleton;
/*
 * Copyright (C) 2015 Saúl Díaz
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.sefford.material.sample.common.injection.modules;



/**
 * Handles the local, independent bus per screen that communicates the business logic components and its views and
 * presenters
 */
@Module(injects = {ContactListActivity.class,
        ContactDetailsActivity.class},
        library = true,
        complete = false)
public class LocalBusModule {

    public static final String LOCAL_BUS = "Local";

    @Singleton
    @Provides
    @Named(LOCAL_BUS)
// Path: app/src/main/java/com/sefford/material/sample/common/internal/Bus.java
// public class Bus implements Postable, com.sefford.brender.interfaces.Postable {
// 
//     final EventBus bus;
// 
//     @Inject
//     public Bus(EventBus bus) {
//         this.bus = bus;
//     }
// 
//     public void register(Object target) {
//         if (!bus.isRegistered(target)) {
//             bus.register(target);
//         }
//     }
// 
//     public void unregister(Object target) {
//         if (bus.isRegistered(target)) {
//             bus.unregister(target);
//         }
//     }
// 
//     @Override
//     public void post(Object message) {
//         bus.post(message);
//     }
// }
// 
// Path: app/src/main/java/com/sefford/material/sample/contacts/details/ui/activities/ContactDetailsActivity.java
// public class ContactDetailsActivity extends BaseActivity {
// 
//     public static final String EXTRA_ID = "extra_id";
//     public static final String EXTRA_NAME = "extra_name";
//     public static final String EXTRA_COLOR = "extra_color";
// 
//     @Inject
//     ContactDetailView view;
//     @Inject
//     ContactDetailPresenter presenter;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.screen_detail);
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         view.configurePlaceholder(getIntent().getStringExtra(EXTRA_NAME), getIntent().getStringExtra(EXTRA_COLOR));
//         view.bind(getWindow().findViewById(android.R.id.content));
//         presenter.setId(getIntent().getLongExtra(EXTRA_ID, 0));
//         presenter.bind(view);
//     }
// 
// 
//     @Override
//     protected void onDestroy() {
//         super.onDestroy();
//         presenter.release();
//     }
// 
//     @Override
//     protected Object[] getExtensions(ObjectGraph originalGraph, Bundle arguments) {
//         final Object[] extensions = new Object[2];
//         extensions[0] = new LocalBusModule();
//         extensions[1] = new UiModule();
//         return extensions;
//     }
// }
// 
// Path: app/src/main/java/com/sefford/material/sample/contacts/list/ui/activities/ContactListActivity.java
// public class ContactListActivity extends BaseActivity {
// 
//     @Inject
//     ContactListView view;
//     @Inject
//     ContactListPresenter presenter;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.screen_contacts);
//     }
// 
//     @Override
//     protected Object[] getExtensions(ObjectGraph originalGraph, Bundle arguments) {
//         final Object[] extensions = new Object[2];
//         extensions[0] = new LocalBusModule();
//         extensions[1] = new UiModule();
//         return extensions;
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         view.bind(getWindow().findViewById(android.R.id.content));
//         presenter.bind(view);
//     }
// 
//     @Override
//     protected void onDestroy() {
//         super.onDestroy();
//         presenter.release();
//     }
// }


// Path: app/src/main/java/com/sefford/material/sample/common/injection/modules/LocalBusModule.java
import com.sefford.brender.interfaces.Postable;
import com.sefford.material.sample.common.internal.Bus;
import com.sefford.material.sample.contacts.details.ui.activities.ContactDetailsActivity;
import com.sefford.material.sample.contacts.list.ui.activities.ContactListActivity;
import dagger.Module;
import dagger.Provides;
import javax.inject.Named;
import javax.inject.Singleton;

/*
 * Copyright (C) 2015 Saúl Díaz
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.sefford.material.sample.common.injection.modules;



/**
 * Handles the local, independent bus per screen that communicates the business logic components and its views and
 * presenters
 */
@Module(injects = {ContactListActivity.class,
        ContactDetailsActivity.class},
        library = true,
        complete = false)
public class LocalBusModule {

    public static final String LOCAL_BUS = "Local";

    @Singleton
    @Provides
    @Named(LOCAL_BUS)
    public Bus provideLocalBus(Bus bus) {