コード例 #1
0
ファイル: ChartView.java プロジェクト: ZhongXiaoBei/NBAPlus
	/**
	 * Adds a tooltip to {@link ChartView}. If is not the case already,
	 * the whole tooltip is forced to be inside {@link ChartView} bounds.
	 *
	 * @param tooltip   {@link Tooltip} view to be added
	 * @param correctPos   False if tooltip should not be forced to be inside ChartView.
	 *               You may want to take care of it
	 */
	public void showTooltip(Tooltip tooltip, boolean correctPos) {

		if (correctPos) {
			tooltip.correctPosition(mChartLeft - getPaddingLeft(),
					mChartTop - getPaddingTop(),
					mChartRight - getPaddingRight(),
					(int) (getInnerChartBottom() - getPaddingBottom()));
		}

		if(tooltip.hasEnterAnimation())
			tooltip.animateEnter();

		this.addTooltip(tooltip);

	}