// Path: data/src/main/java/data/internal/di/DataModule.java
// @Module
// public class DataModule {
// 
//     @Singleton @Provides RestApi provideRestApi() {
//         return new Retrofit.Builder()
//                 .baseUrl(RestApi.URL_BASE)
//                 .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
//                 .addConverterFactory(GsonConverterFactory.create())
//                 .build().create(RestApi.class);
//     }
// 
//     @Singleton @Provides RxProviders provideRxProviders(RepositoryAdapter repositoryAdapter) {
//         return new RxCache.Builder()
//                 .persistence(repositoryAdapter.cacheDirectory())
//                 .using(RxProviders.class);
//     }
// 
//     @Provides @Singleton public UserDemoRepository provideUserDemoDataRepository(UserDemoDataRepository userDemoDataRepository) {
//         return userDemoDataRepository;
//     }
// }
// 
// Path: data/src/main/java/data/sections/UI.java
// public interface UI {
//     Observable<String> genericError();
// }
// 
// Path: data/src/main/java/data/storage/RepositoryAdapter.java
// public interface RepositoryAdapter {
//     File cacheDirectory();
// }
// 
// Path: presentation/src/main/java/presentation/foundation/BaseApp.java
// public class BaseApp extends Application {
//     private ApplicationComponent applicationComponent;
// 
//     @Override public void onCreate() {
//         super.onCreate();
//         initInject();
//         AppCare.YesSir.takeCareOn(this);
//     }
// 
//     private void initInject() {
//         applicationComponent = DaggerApplicationComponent.builder()
//                 .applicationModule(new ApplicationModule(this))
//                 .build();
//     }
// 
//     public ApplicationComponent getApplicationComponent() {
//         return applicationComponent;
//     }
// 
//     @Nullable public BaseFragmentActivity getLiveActivity(){
//         return (BaseFragmentActivity) AppCare.YesSir.getLiveActivityOrNull();
//     }
// }
// 
// Path: presentation/src/main/java/presentation/sections/UIData.java
// public class UIData implements UI {
//     private final BaseApp baseApp;
// 
//     public UIData(BaseApp baseApp) {
//         this.baseApp = baseApp;
//     }
// 
//     @Override public Observable<String> genericError() {
//         return Observable.just(baseApp.getString(R.string.generic_error));
//     }
// }


import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import data.internal.di.DataModule;
import data.sections.UI;
import data.storage.RepositoryAdapter;
import presentation.foundation.BaseApp;
import presentation.sections.UIData;
/*
 * Copyright 2015 RefineriaWeb
 *
 * 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 presentation.internal.di;




/**
 * Dependencies required by the data layer need to be provided in this dagger module
 */
@Module(includes = {DataModule.class, ApplicationModule.class})
public class DataPresentationModule {

    /**
     * Provides the file system for the data layer
     * @see RepositoryAdapter
     */
    @Singleton @Provides RepositoryAdapter provideRepositoryAdapter(BaseApp baseApp) {
        return () -> baseApp.getFilesDir();
    }

    /**
     * Provides the locale for the data layer
     * @see UI
     */
    @Singleton @Provides
    UI provideLocale(BaseApp baseApp) {
// Path: data/src/main/java/data/internal/di/DataModule.java
// @Module
// public class DataModule {
// 
//     @Singleton @Provides RestApi provideRestApi() {
//         return new Retrofit.Builder()
//                 .baseUrl(RestApi.URL_BASE)
//                 .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
//                 .addConverterFactory(GsonConverterFactory.create())
//                 .build().create(RestApi.class);
//     }
// 
//     @Singleton @Provides RxProviders provideRxProviders(RepositoryAdapter repositoryAdapter) {
//         return new RxCache.Builder()
//                 .persistence(repositoryAdapter.cacheDirectory())
//                 .using(RxProviders.class);
//     }
// 
//     @Provides @Singleton public UserDemoRepository provideUserDemoDataRepository(UserDemoDataRepository userDemoDataRepository) {
//         return userDemoDataRepository;
//     }
// }
// 
// Path: data/src/main/java/data/sections/UI.java
// public interface UI {
//     Observable<String> genericError();
// }
// 
// Path: data/src/main/java/data/storage/RepositoryAdapter.java
// public interface RepositoryAdapter {
//     File cacheDirectory();
// }
// 
// Path: presentation/src/main/java/presentation/foundation/BaseApp.java
// public class BaseApp extends Application {
//     private ApplicationComponent applicationComponent;
// 
//     @Override public void onCreate() {
//         super.onCreate();
//         initInject();
//         AppCare.YesSir.takeCareOn(this);
//     }
// 
//     private void initInject() {
//         applicationComponent = DaggerApplicationComponent.builder()
//                 .applicationModule(new ApplicationModule(this))
//                 .build();
//     }
// 
//     public ApplicationComponent getApplicationComponent() {
//         return applicationComponent;
//     }
// 
//     @Nullable public BaseFragmentActivity getLiveActivity(){
//         return (BaseFragmentActivity) AppCare.YesSir.getLiveActivityOrNull();
//     }
// }
// 
// Path: presentation/src/main/java/presentation/sections/UIData.java
// public class UIData implements UI {
//     private final BaseApp baseApp;
// 
//     public UIData(BaseApp baseApp) {
//         this.baseApp = baseApp;
//     }
// 
//     @Override public Observable<String> genericError() {
//         return Observable.just(baseApp.getString(R.string.generic_error));
//     }
// }


// Path: presentation/src/main/java/presentation/internal/di/DataPresentationModule.java
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import data.internal.di.DataModule;
import data.sections.UI;
import data.storage.RepositoryAdapter;
import presentation.foundation.BaseApp;
import presentation.sections.UIData;

/*
 * Copyright 2015 RefineriaWeb
 *
 * 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 presentation.internal.di;




/**
 * Dependencies required by the data layer need to be provided in this dagger module
 */
@Module(includes = {DataModule.class, ApplicationModule.class})
public class DataPresentationModule {

    /**
     * Provides the file system for the data layer
     * @see RepositoryAdapter
     */
    @Singleton @Provides RepositoryAdapter provideRepositoryAdapter(BaseApp baseApp) {
        return () -> baseApp.getFilesDir();
    }

    /**
     * Provides the locale for the data layer
     * @see UI
     */
    @Singleton @Provides
    UI provideLocale(BaseApp baseApp) {
        return new UIData(baseApp);