Code example for Path

Methods: isEmpty

0
		} 
		 
		canvas.drawPath(mFillPath, mFillPaint);
		 
		// no fill path == no indicator at all 
		if (mIndicatorFillPath.isEmpty()) {
			if (mStrokeWidth > 0) {
				canvas.drawPath(mStrokePath, mStrokePaint);
			} 
			 
			return; 
		} 
		 
		final float iP = mIndicatorPosition;
		final float iW = mIndicatorWidth;
		final float cR = mCornerRadius;
		final float sW = mStrokeWidth;
		final float iVSW = mIndicatorVerticalStrokeWidth;
		 
		float offset;
		final boolean isHorizontal = mIndicatorDirection == IndicatorDirection.TOP
				|| mIndicatorDirection == IndicatorDirection.BOTTOM;
		 
		// get the needed offset to move indicator by calculating it by given position 
		if (isHorizontal) {
			final float w = getBounds().width();
			offset = Math.min(Math.max(
					w * iP - iVSW - iW / 2f, Math.max(cR, sW)), w - cR - iVSW * 2 - iW);
		} else { 
			final float h = getBounds().height();
			offset = Math.min(Math.max(
					h * iP - iVSW - iW / 2f, Math.max(cR, sW)), h - cR - iVSW * 2 - iW);
		} 
		 
		// no need for complicated stroke clipping, because there's no stroke 
		// just draw the indicator without stroke and that's it 
		if (mStrokeWidth < 0) {
			canvas.save();
			canvas.translate(isHorizontal ? offset : 0, isHorizontal ? 0 : offset);
			canvas.drawPath(mIndicatorFillPath, mFillPaint);
			canvas.restore();
		} 
		 
		if (mStrokeWidth < 0) {
			 
		} else { 
			if (mIndicatorFillPath.isEmpty()) {
				canvas.drawPath(mStrokePath, mStrokePaint);
			} else { 
				 
				 
				canvas.translate(isHorizontal ? offset : 0, isHorizontal ? 0 : offset);
Contextual code suggestions in your IDE  Get Codota for Java