@@ -0,0 +1,2163 @@
+package com.jborchardt.imagefeed.common;%0A%0Aimport android.os.Bundle;%0Aimport android.support.annotation.Nullable;%0Aimport android.support.v4.app.Fragment;%0Aimport android.support.v4.app.FragmentTransaction;%0Aimport android.support.v7.app.AppCompatActivity;%0Aimport android.view.MenuItem;%0Aimport android.view.View;%0A%0Aimport com.jborchardt.imagefeed.R;%0Aimport com.jborchardt.imagefeed.presentation.view.toolbar.LoadingToolbar;%0Aimport com.jborchardt.imagefeed.presentation.view.toolbar.LoadingView;%0A%0Apublic abstract class BaseActivity extends AppCompatActivity %7B%0A%0A    private View mContentView;%0A    private LoadingToolbar mToolbar;%0A%0A    @Override%0A    protected void onCreate(@Nullable final Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A%0A        setContentView(R.layout.activity_base);%0A%0A        setupContentView();%0A%0A        setupToolbar();%0A%0A%0A        showContent();%0A    %7D%0A%0A    private void showContent() %7B%0A        final Fragment fragment = getContentFragment();%0A        showFragment(fragment, false);%0A    %7D%0A%0A    private void setupContentView() %7B%0A        mContentView = findViewById(R.id.content);%0A    %7D%0A%0A    private void setupToolbar() %7B%0A        mToolbar = (LoadingToolbar) findViewById(R.id.toolbarModule);%0A        setSupportActionBar(mToolbar.getToolbar());%0A    %7D%0A%0A%0A    public View getContentView() %7B%0A        return mContentView;%0A    %7D%0A%0A    /*Action bar*/%0A%0A    public LoadingView getLoadingModule() %7B%0A        return mToolbar.getLoadingModule();%0A    %7D%0A%0A    @Override%0A    public boolean onOptionsItemSelected(final MenuItem item) %7B%0A        switch (item.getItemId()) %7B%0A            case android.R.id.home:%0A                onBackPressed(); //TODO%0A                return true;%0A        %7D%0A        return super.onOptionsItemSelected(item);%0A    %7D%0A%0A     /*Fragment transactions*/%0A%0A    protected void showFragment(Fragment fragment, boolean addToBackStack) %7B%0A        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();%0A        transaction.replace(R.id.content, fragment);%0A        if (addToBackStack) transaction.addToBackStack(null);%0A        transaction.commit();%0A    %7D%0A%0A    protected abstract Fragment getContentFragment();%0A%7D%0A

Add a base activity