// Path: material-life-android/src/main/java/com/juankysoriano/materiallife/ui/util/ViewMeasurer.java
// public class ViewMeasurer {
// 
//     private ViewMeasurer() {
//         //no-op
//     }
// 
//     public static Point getViewCenter(View view) {
//         int centerX = view.getLeft() + view.getWidth() / 2;
//         int centerY = view.getTop() + view.getHeight() / 2;
// 
//         return new Point(centerX, centerY);
//     }
// 
//     public static Point getViewCenterOnScreen(View view) {
//         int[] location = new int[2];
// 
//         view.getLocationOnScreen(location);
// 
//         int centerX = location[0] + view.getWidth() / 2;
//         int centerY = location[1] + view.getHeight() / 2;
// 
//         return new Point(centerX, centerY);
//     }
//     public static int getRadiusFrom(Point point, View view) {
//         int hypotenuseA = Math.max(point.x, view.getWidth() - point.x);
//         int hypotenuseB = Math.max(point.y, view.getHeight() - point.y);
// 
//         return (int) Math.sqrt(Math.pow(hypotenuseA, 2) + Math.pow(hypotenuseB, 2));
//     }
// }


import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
import com.juankysoriano.materiallife.R;
import com.juankysoriano.materiallife.ui.util.ViewMeasurer;
import com.novoda.notils.caster.Views;
package com.juankysoriano.materiallife.ui.sketch.menu;



public class MenuView extends RelativeLayout {
    private MenuButton menuButton;
    private MenuOptionsView menuOptionsView;
    private boolean menuOpened;

    public MenuView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MenuView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        menuButton = Views.findById(this, R.id.menu_fab_button);
        menuOptionsView = Views.findById(this, R.id.menu_list);
        menuOptionsView.setAdapter(MenuItemAdapter.newInstance());
    }

// Path: material-life-android/src/main/java/com/juankysoriano/materiallife/ui/util/ViewMeasurer.java
// public class ViewMeasurer {
// 
//     private ViewMeasurer() {
//         //no-op
//     }
// 
//     public static Point getViewCenter(View view) {
//         int centerX = view.getLeft() + view.getWidth() / 2;
//         int centerY = view.getTop() + view.getHeight() / 2;
// 
//         return new Point(centerX, centerY);
//     }
// 
//     public static Point getViewCenterOnScreen(View view) {
//         int[] location = new int[2];
// 
//         view.getLocationOnScreen(location);
// 
//         int centerX = location[0] + view.getWidth() / 2;
//         int centerY = location[1] + view.getHeight() / 2;
// 
//         return new Point(centerX, centerY);
//     }
//     public static int getRadiusFrom(Point point, View view) {
//         int hypotenuseA = Math.max(point.x, view.getWidth() - point.x);
//         int hypotenuseB = Math.max(point.y, view.getHeight() - point.y);
// 
//         return (int) Math.sqrt(Math.pow(hypotenuseA, 2) + Math.pow(hypotenuseB, 2));
//     }
// }


// Path: material-life-android/src/main/java/com/juankysoriano/materiallife/ui/sketch/menu/MenuView.java
import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
import com.juankysoriano.materiallife.R;
import com.juankysoriano.materiallife.ui.util.ViewMeasurer;
import com.novoda.notils.caster.Views;

package com.juankysoriano.materiallife.ui.sketch.menu;



public class MenuView extends RelativeLayout {
    private MenuButton menuButton;
    private MenuOptionsView menuOptionsView;
    private boolean menuOpened;

    public MenuView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MenuView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        menuButton = Views.findById(this, R.id.menu_fab_button);
        menuOptionsView = Views.findById(this, R.id.menu_list);
        menuOptionsView.setAdapter(MenuItemAdapter.newInstance());
    }

    public void openMenu() {