// Path: presentation/src/main/java/presentation/internal/di/ApplicationComponent.java
// @Singleton @Component(modules = {DomainPresentationModule.class, DataPresentationModule.class, ApplicationModule.class})
// public interface ApplicationComponent {
//     void inject(LaunchActivity launchActivity);
// 
//     void inject(DashBoardActivity dashBoardActivity);
//     void inject(UserFragment userFragment);
//     void inject(UsersFragment usersFragment);
//     void inject(SearchUserFragment searchUserFragment);
// }


import java.io.Serializable;
import base.app.android.R;
import butterknife.Bind;
import butterknife.ButterKnife;
import presentation.internal.di.ApplicationComponent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import com.afollestad.materialdialogs.MaterialDialog;
/*
 * 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.foundation;





public abstract class BaseFragmentActivity extends AppCompatActivity {
    @Nullable @Bind(R.id.app_bar) protected AppBarLayout app_bar;
    @Nullable @Bind(R.id.toolbar) protected Toolbar toolbar;
    protected String app_name;
    private MaterialDialog materialDialog;

    @Override protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        app_name = getString(R.string.app_name);

        if (layoutRes() != null) setContentView(layoutRes());

        ButterKnife.bind(this);
        injectDagger();

        configureToolbar(toolbar, app_bar);
        initViews();
        configureFragment();
    }

    protected void initViews() {}

    private Integer layoutRes() {
        LayoutResActivity layoutRes = this.getClass().getAnnotation(LayoutResActivity.class);
        return layoutRes != null ? layoutRes.value() : null;
    }

    protected abstract void injectDagger();

    public BaseApp getBaseApp() {
        return ((BaseApp)getApplication());
    }

// Path: presentation/src/main/java/presentation/internal/di/ApplicationComponent.java
// @Singleton @Component(modules = {DomainPresentationModule.class, DataPresentationModule.class, ApplicationModule.class})
// public interface ApplicationComponent {
//     void inject(LaunchActivity launchActivity);
// 
//     void inject(DashBoardActivity dashBoardActivity);
//     void inject(UserFragment userFragment);
//     void inject(UsersFragment usersFragment);
//     void inject(SearchUserFragment searchUserFragment);
// }


// Path: presentation/src/main/java/presentation/foundation/BaseFragmentActivity.java
import java.io.Serializable;
import base.app.android.R;
import butterknife.Bind;
import butterknife.ButterKnife;
import presentation.internal.di.ApplicationComponent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import com.afollestad.materialdialogs.MaterialDialog;

/*
 * 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.foundation;





public abstract class BaseFragmentActivity extends AppCompatActivity {
    @Nullable @Bind(R.id.app_bar) protected AppBarLayout app_bar;
    @Nullable @Bind(R.id.toolbar) protected Toolbar toolbar;
    protected String app_name;
    private MaterialDialog materialDialog;

    @Override protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        app_name = getString(R.string.app_name);

        if (layoutRes() != null) setContentView(layoutRes());

        ButterKnife.bind(this);
        injectDagger();

        configureToolbar(toolbar, app_bar);
        initViews();
        configureFragment();
    }

    protected void initViews() {}

    private Integer layoutRes() {
        LayoutResActivity layoutRes = this.getClass().getAnnotation(LayoutResActivity.class);
        return layoutRes != null ? layoutRes.value() : null;
    }

    protected abstract void injectDagger();

    public BaseApp getBaseApp() {
        return ((BaseApp)getApplication());
    }

    public ApplicationComponent getApplicationComponent() {