// Path: library/src/main/java/net/derohimat/baseapp/ui/BaseActivity.java
// public abstract class BaseActivity extends AppCompatActivity {
// 
//     protected Context mContext = this;
//     protected Toolbar mToolbar;
//     protected LayoutInflater mInflater;
// 
//     protected ActionBar mActionBar;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(getResourceLayout());
//         ButterKnife.bind(this);
//         Timber.tag(getClass().getSimpleName());
//         mInflater = LayoutInflater.from(mContext);
//         onViewReady(savedInstanceState);
//     }
// 
//     public FragmentManager getBaseFragmentManager() {
//         return super.getSupportFragmentManager();
//     }
// 
//     protected void setupToolbar(final Toolbar toolbar) {
//         setupToolbar(toolbar, null);
//     }
// 
//     @TargetApi(Build.VERSION_CODES.LOLLIPOP)
//     protected void setupToolbar(final Toolbar toolbar, final View.OnClickListener onClickListener) {
// 
//         mToolbar = toolbar;
//         setSupportActionBar(toolbar);
//         mActionBar = getSupportActionBar();
//         if (mActionBar != null)
//             mActionBar.setHomeButtonEnabled(true);
// 
//         if (onClickListener != null)
//             toolbar.setNavigationOnClickListener(onClickListener);
//     }
// 
//     public Toolbar getToolbar() {
//         return mToolbar;
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         switch (item.getItemId()) {
//             case android.R.id.home:
//                 onBackPressed();
//                 return true;
//             default:
//                 return super.onOptionsItemSelected(item);
//         }
//     }
// 
//     @Override
//     public void setTitle(int title) {
//         super.setTitle(title);
//         if (mActionBar != null)
//             mActionBar.setTitle(getString(title));
//     }
// 
//     public ActionBar getBaseActionBar() {
//         ActionBar actionBar = getSupportActionBar();
//         assert actionBar != null;
//         return actionBar;
//     }
// 
//     @Override
//     public void onBackPressed() {
//         if (getBaseFragmentManager().getBackStackEntryCount() > 0) {
//             getBaseFragmentManager().popBackStack();
//         } else {
//             super.onBackPressed();
//         }
//     }
// 
//     protected void showToast(String message) {
//         Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
//     }
// 
//     protected abstract int getResourceLayout();
// 
//     protected abstract void onViewReady(Bundle savedInstanceState);
// }


import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.widget.Toast;
import net.derohimat.baseapp.ui.BaseActivity;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import timber.log.Timber;
package net.derohimat.baseapp.ui.fragment.dialog;




/**
 * Created on : 05-03-2016
 * Author     : derohimat
 * Name       : Deni Rohimat
 * Email      : rohimatdeni@gmail.com
 * GitHub     : https://github.com/derohimat
 * LinkedIn   : https://www.linkedin.com/in/derohimat
 */
public abstract class BaseDialogFragment extends DialogFragment {

    protected Context mContext;
    protected LayoutInflater mInflater;
    private Unbinder unbinder;

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        mContext = activity;
        mInflater = LayoutInflater.from(mContext);
    }

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        View view = mInflater.inflate(getResourceLayout(), null);
        unbinder = ButterKnife.bind(this, view);
        Timber.tag(getClass().getSimpleName());
        return setupDialog(view);
    }

    protected Dialog setupDialog(View view) {
        final Dialog dialog = new Dialog(getActivity());
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setContentView(view);
        dialog.getWindow().setBackgroundDrawable(new ColorDrawable(0x4000));
        return dialog;
    }

    protected abstract int getResourceLayout();

// Path: library/src/main/java/net/derohimat/baseapp/ui/BaseActivity.java
// public abstract class BaseActivity extends AppCompatActivity {
// 
//     protected Context mContext = this;
//     protected Toolbar mToolbar;
//     protected LayoutInflater mInflater;
// 
//     protected ActionBar mActionBar;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(getResourceLayout());
//         ButterKnife.bind(this);
//         Timber.tag(getClass().getSimpleName());
//         mInflater = LayoutInflater.from(mContext);
//         onViewReady(savedInstanceState);
//     }
// 
//     public FragmentManager getBaseFragmentManager() {
//         return super.getSupportFragmentManager();
//     }
// 
//     protected void setupToolbar(final Toolbar toolbar) {
//         setupToolbar(toolbar, null);
//     }
// 
//     @TargetApi(Build.VERSION_CODES.LOLLIPOP)
//     protected void setupToolbar(final Toolbar toolbar, final View.OnClickListener onClickListener) {
// 
//         mToolbar = toolbar;
//         setSupportActionBar(toolbar);
//         mActionBar = getSupportActionBar();
//         if (mActionBar != null)
//             mActionBar.setHomeButtonEnabled(true);
// 
//         if (onClickListener != null)
//             toolbar.setNavigationOnClickListener(onClickListener);
//     }
// 
//     public Toolbar getToolbar() {
//         return mToolbar;
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         switch (item.getItemId()) {
//             case android.R.id.home:
//                 onBackPressed();
//                 return true;
//             default:
//                 return super.onOptionsItemSelected(item);
//         }
//     }
// 
//     @Override
//     public void setTitle(int title) {
//         super.setTitle(title);
//         if (mActionBar != null)
//             mActionBar.setTitle(getString(title));
//     }
// 
//     public ActionBar getBaseActionBar() {
//         ActionBar actionBar = getSupportActionBar();
//         assert actionBar != null;
//         return actionBar;
//     }
// 
//     @Override
//     public void onBackPressed() {
//         if (getBaseFragmentManager().getBackStackEntryCount() > 0) {
//             getBaseFragmentManager().popBackStack();
//         } else {
//             super.onBackPressed();
//         }
//     }
// 
//     protected void showToast(String message) {
//         Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
//     }
// 
//     protected abstract int getResourceLayout();
// 
//     protected abstract void onViewReady(Bundle savedInstanceState);
// }


// Path: library/src/main/java/net/derohimat/baseapp/ui/fragment/dialog/BaseDialogFragment.java
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.widget.Toast;
import net.derohimat.baseapp.ui.BaseActivity;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import timber.log.Timber;

package net.derohimat.baseapp.ui.fragment.dialog;




/**
 * Created on : 05-03-2016
 * Author     : derohimat
 * Name       : Deni Rohimat
 * Email      : rohimatdeni@gmail.com
 * GitHub     : https://github.com/derohimat
 * LinkedIn   : https://www.linkedin.com/in/derohimat
 */
public abstract class BaseDialogFragment extends DialogFragment {

    protected Context mContext;
    protected LayoutInflater mInflater;
    private Unbinder unbinder;

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        mContext = activity;
        mInflater = LayoutInflater.from(mContext);
    }

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        View view = mInflater.inflate(getResourceLayout(), null);
        unbinder = ButterKnife.bind(this, view);
        Timber.tag(getClass().getSimpleName());
        return setupDialog(view);
    }

    protected Dialog setupDialog(View view) {
        final Dialog dialog = new Dialog(getActivity());
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setContentView(view);
        dialog.getWindow().setBackgroundDrawable(new ColorDrawable(0x4000));
        return dialog;
    }

    protected abstract int getResourceLayout();

    protected BaseActivity getBaseActivity() {