package com.balysv.materialmenu.demo.abs;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;

import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.balysv.materialmenu.MaterialMenuView;
import com.balysv.materialmenu.demo.R;

import static com.balysv.materialmenu.demo.BaseActivityHelper.generateState;
import static com.balysv.materialmenu.demo.BaseActivityHelper.intToState;

public class CustomViewActivity extends BaseActivity implements View.OnClickListener {

    private MaterialMenuView materialMenu;
    private int              actionBarMenuState;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initCustomActionBar();
        helper.init(getWindow().getDecorView(), materialMenu);
    }

    private void initCustomActionBar() {
        ActionBar actionBar = getSupportActionBar();
        actionBar.setHomeButtonEnabled(false);
        actionBar.setDisplayShowHomeEnabled(false);
        actionBar.setDisplayShowTitleEnabled(false);
        actionBar.setDisplayHomeAsUpEnabled(false);
        actionBar.setDisplayShowCustomEnabled(true);
        actionBar.setCustomView(R.layout.action_bar);
        materialMenu = (MaterialMenuView) actionBar.getCustomView().findViewById(R.id.action_bar_menu);
        materialMenu.setOnClickListener(this);
        new Handler().postDelayed(new Runnable() {
            @Override public void run() {
                Log.i("debug", "size: " + materialMenu.getMeasuredWidth() + " " + materialMenu.getMeasuredHeight());
                Log.i("debug", "size: " + materialMenu.getWidth() + " " + materialMenu.getHeight());
            }
        }, 2000);

    }

    @Override public void onClick(View v) {
        if (v.getId() == R.id.action_bar_menu) {
            // random state on click
            actionBarMenuState = generateState(actionBarMenuState);
            materialMenu.animatePressedState(intToState(actionBarMenuState));
            return;
        }
        helper.onClick(v);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getSupportMenuInflater().inflate(R.menu.custom_view, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            startActivity(new Intent(this, HomeIconActivity.class));
            finish();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}

@@ -97,60 +97,8 @@
 le;%0A
-import android.os.Handler;%0Aimport android.util.Log;%0A
 impo
@@ -1446,352 +1446,8 @@
 s);%0A
-        new Handler().postDelayed(new Runnable() %7B%0A            @Override public void run() %7B%0A                Log.i(%22debug%22, %22size: %22 + materialMenu.getMeasuredWidth() + %22 %22 + materialMenu.getMeasuredHeight());%0A                Log.i(%22debug%22, %22size: %22 + materialMenu.getWidth() + %22 %22 + materialMenu.getHeight());%0A            %7D%0A        %7D, 2000);%0A%0A
     

Remove redundant code in demo