@@ -0,0 +1,2315 @@
+package com.ae.apps.lib.activities;%0A%0Aimport android.os.Build;%0Aimport android.os.Bundle;%0Aimport android.view.KeyEvent;%0A%0Aimport androidx.appcompat.app.AppCompatActivity;%0Aimport androidx.appcompat.widget.Toolbar;%0A%0Apublic abstract class ToolBarBaseActivity extends AppCompatActivity %7B%0A    Toolbar mToolbar = null;%0A%0A    @Override%0A    protected void onCreate(Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A%0A        setContentView(getLayoutResourceId());%0A%0A        // Find the toolbar and set it as action bar%0A        mToolbar = findViewById(getToolbarResourceId());%0A        if (null != mToolbar) %7B%0A            setSupportActionBar(mToolbar);%0A        %7D%0A    %7D%0A%0A    /**%0A     * Sets the toolbartitle%0A     *%0A     * @param title Title for the toolbar%0A     */%0A    protected void setToolbarTitle(String title) %7B%0A        if (null != getSupportActionBar()) %7B%0A            getSupportActionBar().setTitle(title);%0A        %7D%0A    %7D%0A%0A    /**%0A     * Returns the toolbar instance%0A     *%0A     * @return the toolbar instance%0A     */%0A    protected Toolbar getToolBar() %7B%0A        return mToolbar;%0A    %7D%0A%0A    /**%0A     * Returns the toolbar resource id. Should be R.id.toolbar in most cases%0A     *%0A     * @return return the toolbar resource id%0A     */%0A    protected abstract int getToolbarResourceId();%0A%0A    /**%0A     * Returns the layout resource id for the activity%0A     *%0A     * @return return the layout resource id%0A     */%0A    protected abstract int getLayoutResourceId();%0A%0A    protected void displayHomeAsUp() %7B%0A        // Show the back arrow in toolbar to go back%0A        getSupportActionBar().setHomeButtonEnabled(true);%0A        getSupportActionBar().setDisplayHomeAsUpEnabled(true);%0A    %7D%0A%0A    @Override%0A    public boolean onKeyDown(int keyCode, KeyEvent event) %7B%0A        // Fix for NPE on LG Devices when pressing hardware menu button%0A        return keyCode == KeyEvent.KEYCODE_MENU && %22LGE%22.equals(Build.BRAND)%0A                %7C%7C super.onKeyDown(keyCode, event);%0A    %7D%0A%0A    @Override%0A    public boolean onKeyUp(int keyCode, KeyEvent event) %7B%0A        // Fix for NPE on LG Devices when pressing hardware menu button%0A        if (keyCode == KeyEvent.KEYCODE_MENU && %22LGE%22.equals(Build.BRAND)) %7B%0A            openOptionsMenu();%0A            return true;%0A        %7D%0A        return super.onKeyUp(keyCode, event);%0A    %7D%0A%0A%7D%0A

add ToolBarBaseActivity