If you think the Android project GuiLib listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/*
* Copyright 2014 Alex Curran//www.java2s.com
*
* 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.github.amlcurran.showcaseview;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import com.gandulf.guilib.R;
/**
* Created by curraa01 on 13/10/2013.
*/class NewShowcaseDrawer extends StandardShowcaseDrawer {
privatestaticfinalint ALPHA_60_PERCENT = 153;
privatefinalfloat outerRadius;
privatefinalfloat innerRadius;
public NewShowcaseDrawer(Resources resources) {
super(resources);
outerRadius = resources.getDimension(R.dimen.showcase_radius_outer);
innerRadius = resources.getDimension(R.dimen.showcase_radius_inner);
}
@Override
publicvoid setShowcaseColour(int color) {
eraserPaint.setColor(color);
}
@Override
publicvoid drawShowcase(Bitmap buffer, float x, float y, float scaleMultiplier) {
Canvas bufferCanvas = new Canvas(buffer);
eraserPaint.setAlpha(ALPHA_60_PERCENT);
bufferCanvas.drawCircle(x, y, outerRadius, eraserPaint);
eraserPaint.setAlpha(0);
bufferCanvas.drawCircle(x, y, innerRadius, eraserPaint);
}
@Override
publicint getShowcaseWidth() {
return (int) (outerRadius * 2);
}
@Override
publicint getShowcaseHeight() {
return (int) (outerRadius * 2);
}
@Override
publicfloat getBlockedRadius() {
return innerRadius;
}
@Override
publicvoid setBackgroundColour(int backgroundColor) {
this.backgroundColour = backgroundColor;
}
}