// Path: chartlibrary/src/com/db/chart/listener/OnTooltipEventListener.java
// public interface OnTooltipEventListener {
// 
// 	void onEnter(View view);
// 	void onExit(View view);
// 	
// }


import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Rect;
import android.os.Build;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.db.chart.listener.OnTooltipEventListener;
/*
 * Copyright 2015 Diogo Bernardino
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.db.chart.view;




/**
 * Class representing chart's tooltips. It works basically as a wrapper.
 */
public class Tooltip extends RelativeLayout{

    private TextView mTooltipValue;

    private OnTooltipEventListener mTooltipEventListener;

    private ObjectAnimator mEnterAnimator;
    private ObjectAnimator mExitAnimator;

    private boolean mOn;


    public Tooltip(Context context){
        super(context);
    }

    public Tooltip(Context context, int layoutId) {
        super(context);
        init(layoutId);
    }

    public Tooltip(Context context, int layoutId, int valueId) {
        super(context);
        init(layoutId);
        mTooltipValue = (TextView) findViewById(valueId);
    }


    private void init(int layoutId){
        addView(inflate(getContext(), layoutId, null));
        mOn = false;
    }



    /**
     *
     * @param listener
     */
// Path: chartlibrary/src/com/db/chart/listener/OnTooltipEventListener.java
// public interface OnTooltipEventListener {
// 
// 	void onEnter(View view);
// 	void onExit(View view);
// 	
// }


// Path: chartlibrary/src/com/db/chart/view/Tooltip.java
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Rect;
import android.os.Build;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.db.chart.listener.OnTooltipEventListener;

/*
 * Copyright 2015 Diogo Bernardino
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.db.chart.view;




/**
 * Class representing chart's tooltips. It works basically as a wrapper.
 */
public class Tooltip extends RelativeLayout{

    private TextView mTooltipValue;

    private OnTooltipEventListener mTooltipEventListener;

    private ObjectAnimator mEnterAnimator;
    private ObjectAnimator mExitAnimator;

    private boolean mOn;


    public Tooltip(Context context){
        super(context);
    }

    public Tooltip(Context context, int layoutId) {
        super(context);
        init(layoutId);
    }

    public Tooltip(Context context, int layoutId, int valueId) {
        super(context);
        init(layoutId);
        mTooltipValue = (TextView) findViewById(valueId);
    }


    private void init(int layoutId){
        addView(inflate(getContext(), layoutId, null));
        mOn = false;
    }



    /**
     *
     * @param listener
     */
    public void setEventListener(OnTooltipEventListener listener){