use of view_inspector.ui.menu.LayerMenu in project ViewInspector by xfumihiro.
the class ViewInspectorToolbar method onAttachedToWindow.
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
mToolbar = findViewById(R.id.toolbar);
mToggleButton = (ImageButton) findViewById(R.id.toggle_menu);
ImageButton buttonBoundaryMenu = (ImageButton) findViewById(R.id.outline_menu);
ImageButton buttonLayerMenu = (ImageButton) findViewById(R.id.layer_menu);
ImageButton buttonEventMenu = (ImageButton) findViewById(R.id.event_menu);
ImageButton buttonSettingsMenu = (ImageButton) findViewById(R.id.settings_menu);
mToolbar.setTranslationX(mToolbarWidth);
ObjectAnimator animator = ObjectAnimator.ofFloat(mToolbar, "translationX", mToolbarWidth, mToolbarWidth - mToolbarClosedWidth);
animator.setInterpolator(new DecelerateInterpolator());
animator.start();
mToggleButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
closeMenu();
toggleToolbar();
}
});
buttonBoundaryMenu.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!(mMenu instanceof BoundaryMenu)) {
closeMenu();
mMenu = new BoundaryMenu(mContext);
windowManager.addView(mMenu, BaseMenu.createLayoutParams(mContext));
} else {
closeMenu();
}
}
});
buttonLayerMenu.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!(mMenu instanceof LayerMenu)) {
closeMenu();
mMenu = new LayerMenu(mContext);
windowManager.addView(mMenu, BaseMenu.createLayoutParams(mContext));
} else {
closeMenu();
}
}
});
buttonEventMenu.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!(mMenu instanceof EventMenu)) {
closeMenu();
mMenu = new EventMenu(mContext);
windowManager.addView(mMenu, BaseMenu.createLayoutParams(mContext));
} else {
closeMenu();
}
}
});
buttonSettingsMenu.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!(mMenu instanceof SettingsMenu)) {
closeMenu();
mMenu = new SettingsMenu(mContext);
windowManager.addView(mMenu, BaseMenu.createLayoutParams(mContext));
} else {
closeMenu();
}
}
});
}
Aggregations